Application Initialization tool for YII 2.x

Source: Internet
Author: User
Tags set cookie yii

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

    1. Application run-Environment checks
    2. Composer Tool, library code file in/: /verdor/
    3. 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
    4. Switch the operating mode of the application, including development mode, production mode (configurable extension)
    5. 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

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.