When you generate Yii 1.x auto-generated application, app's private yiic
is placed in protected
folder. However, when I use it to execute yiic help shell
, I see following message:
It is recommended that you execute this command under
the directory that contains the entry script file of
the Web application.
And then:
* entry-script | config-file: optional, the path to
the entry script file or the configuration file for
the Web application. If not given, it is assumed to be
the 'index.php' file under the current directory.
What am I missing? The protected
folder is not the same folder as entry script's one (index.php
). Should I move my yiic
there for the purpose of executing console commands?
If yes, then why yiic
is placed protected
folder by default, not there, where entry script is?
If not, then why yiic
assumes, that index.php
exists in the same folder as yiic
itself and why do I have to change this every time with using entry-script
flag? This just doesn't make any sense!
I think, the answer is to keep yiic
in protected
folder, which is secured from web access by .htaccess
file. Entry script's folder is not secured that way and is web accessible. I would personally be very worried about moving yiic
to root folder, where index.php
file exists. If this is the correct answer, then what is the purpose of this confusing message, cited above?
This answer seems to be supporting my idea, as it shows that CRON call should point to yiic
placed in protected
folder, not to the one in root folder.
Why Yii developers put yiic
, where it is not supposed to be (it is looking for index.php
in the same folder, so in default auto-generated application, it will fail, not finding it)? How should I understand this situation? Why I'm forced to use extra flag every time? Why default folder structure and file placement does not replicate, what yiic
assumes as default?