Yii Framework Forum: Public folder - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Public folder

#1 User is offline   wisp 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 192
  • Joined: 04-February 11

Posted 20 July 2012 - 01:56 PM

By default, Yii uses the root folder as public folder. Although this works, it's pretty ugly, since all your downloadable files will be in the root. I think it would be better to have a seperate folder like 'public' where you put your assets and downloadable files. A lot of frameworks currently use this like Cake and Rails.
I've tried to fix this myself using mod_rewrite but it's pretty difficult to get right, and you have to make a lot of customizations to file paths. Making it the default right from the start in 2.0 would solve this.
1

#2 User is offline   Suralc 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 46
  • Joined: 10-January 12
  • Location:Germany

Posted 20 July 2012 - 03:41 PM

You can already do that in 1.1

The protected folder can be placed anywhere or even be renamed. You do not have to change any paths (except the one pointing to the config-file).

I'm using currently something simliar to this (multiple yii-apps on the machine)

/blah/apps/app1/config/main.php
/blah/apps/app2/config/main.php

/wwwbase/vhosts/app1/index.php (all files which can be delivered directly are placed here)
/wwwbase/vhosts/app2/index.php
(Deployment is handled via git and post-receive/symlinks)
You just need to change the $config path in your entry script.

Also you could place anything to a private place and just symlink anything you need into an apache-readable directory.

But agreed having the option to create the app outside of the webroot, or to have a "www" folder which we can symlink( one (static) folder instead of 3+) into a vhost would be nice.
0

#3 User is offline   wisp 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 192
  • Joined: 04-February 11

Posted 20 July 2012 - 04:19 PM

Well I know it's possible, but why would you force everyone to do this every project, while you could offer it as the default. If anyone uses his own custom implementation it's hard to make extensions/tutorials where you have to take into account every possible configuration.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users