Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I have yii protected folder outside htdocs by using Netbeans

I'm currently developing a PHP web application which uses Yii framework.

As I want to prevent direct access from web browser to some files required by Yii, I moved both framework and protected folders outside htdocs folder.

As a result, I ended up with the following folder setup:

/apache22/htdocs

/apache22/htdocs/myproject/index.php -- Yii bootstrap file
/apache22/htdocs/myproject/css
/apache22/htdocs/myproject/js
/apache22/htdocs/myproject/images

/apache22/vendor/yii-1.1.10 -- Yii framework folder outside documents root

/apache22/htdocs-private/myproject/protected
/apache22/htdocs-private/myproject/runtime

As you can see, only the bootstrap file and some other required css, js and image files are available to be accessed directly from the web browser. All other files such as Yii core framework and specific application private files generated by Yii inside protected and runtime folders are located outside my application web root.

While this setup is fine and secure as recommended by Yii framework, when putting all of them together in Netbeans I'm unable to have this separation. It seems Netbeans does not allow me to have files in the same project located in different folder levels in my webserver.

I'm wondering whether or not the only solution would be to create separate netbeans projects: One for the public website part and the other one for the private website part.

Any suggestions ?

Best Regards.

like image 267
edilima Avatar asked Jul 06 '12 00:07

edilima


1 Answers

Although it may only be a partially solution to your problem, you could add an additional include path to your project.

Assuming /apache22/htdocs/myproject/ ist your project folder.

  • right click on project name
  • select "Properties"
  • select "PHP Include Path"
  • click "Add Folder..."
  • add /apache22/htdocs-private/myproject/

It should now appear in the left sidebar under "Include Path". But it looks like you're not able to commit from there.

like image 171
schmunk Avatar answered Sep 17 '22 18:09

schmunk