Description
This tool is an official own tool, but it has been adjusted according to the [Lnmp]yii 2.x application directory structure (based on the official advanced version), so using this tool must be in accordance with the directory specification.
Role
- Application run-Environment checks
- Composer Tool, library code file in/: /verdor/
- Fast initialization of applications, including: Index file deployment under Web directory, directory read/write permission settings, file read/write file settings, profile initialization settings, file soft chain settings
- Switch the operating mode of the application, including development mode, production mode (configurable extension)
- Template file deployment in different modes (e.g. robots.txt files)
Tool structure
requirements.php Run Environment Checker (web tools) Composer.phar composer Run script Composer.json Composer code Source configuration Composer.lock composer lock file init Initialization tool Script Init.bat Initialization Tool Script (window) environments/ Application template file
environments/
index.php
return [//Development mode ' development ' + [//Template Code directory ' path ' = ' dev ',//Set writable directory ' Setwritab Le ' = ' [' backend/assets ', ' frontend/assets ', ' Runtime ', ' data ',], Set executable file ' setexecutable ' = [' console/yii ', ' console/yii.bat ', ' Tests /codeception/bin/yii ',],//Set Cookie key ' setcookievalidationkey ' = [' config/backend/ Main.php ', ' config/frontend/main.php ',],//soft-chain set ' createsymlink ' = [' Index . php ' = ' frontend/index.php ', ' index-test.php ' = ' frontend/index-test.php ', ' robots ' = ' Frontend/robots ', ' assets ' = ' frontend/assets ', '/frontend/data ' = '/data ', '/fro ' Ntend/static ' = ' and '/static ', '/backend/data ' = '/data ', '/backend/static ' and '/static ', ],//directory cleared before run ' Setcleanpath ' =>[' frontend ', ' backend ',],//user running Web program ' WebUser ' =& gt; ' Nobody ',],];
Dev
Template files in development mode
config/console/frontend/backend/
Prod
Template files in production mode
config/console/frontend/backend/
Tool Run
Pre-run Configuration
The settings file is executable:
Cd/path/tools/chmod u+x Init Composer.phar
To configure the actual path of the PHP command: At the beginning of the init file
#!/usr/local/php5.6.15/bin/php "!--? php ... Use the composer tool cd/path/tools/./composer.phar
Environment Check tool Http://xxx.xxx.xxx/ tools/requirements.php
Initialization Tool cd/path/tools/./init
Run effect
environment Check (Yii 2.x comes with)
Normal checked results
Initialization Tool
Run