Learn DooPHP: High performance PHP framework

Moving protected folder outside your Web Root

In the latest trunk of the framework, we are able to move the protected folder in an application outside your web server root directory. Let’s say you have a structure as below:

www/
    superapp/
        proctected/
            index.php
            global/

To move it outside the WWW folder:

     superapp/
        proctected/

    www/
        superapp/
            index.php
            global/

Just change the configs after you move your files, SITE_PATH setting

//original
C:/wamp/www/superapp/

//changes
C:/wamp/superapp/

If you don’t wish to keep the name protected and wanted everything under superapp, try this:

    superapp/
        view/
        controller/
        .....
    www/
        superapp/
            index.php
            global/

Add on a new setting to common.conf.php, PROTECTED_FOLDER:

$config['PROTECTED_FOLDER'] = '';

  • I’m not sure I would keep the superapp/ under www/ once the protected folder has been removed. I do not see that it would contain any files?

    I would just have index.php, .htaccess and ./global/*

  • it’s just an example, you might have multiple app superapp, superapp2, superapp3. Well of course you can put in under www if you need to app on the root domain :)

  • great work :)