# zdapp **Repository Path**: zd8/zdapp ## Basic Information - **Project Name**: zdapp - **Description**: 非洲--加纳 zdapp 物流系统,yii2 - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-05-06 - **Last Updated**: 2024-06-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 商城系统 Yii 2 Advanced Project Template =============================== Yii 2 Advanced Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for developing complex Web applications with multiple tiers. The template includes three tiers: front end, back end, and console, each of which is a separate Yii application. The template is designed to work in a team development environment. It supports deploying the application in different environments. Documentation is at [docs/guide/README.md](docs/guide/README.md). [![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2-app-advanced/v/stable.png)](https://packagist.org/packages/yiisoft/yii2-app-advanced) [![Total Downloads](https://poser.pugx.org/yiisoft/yii2-app-advanced/downloads.png)](https://packagist.org/packages/yiisoft/yii2-app-advanced) [![Build Status](https://travis-ci.org/yiisoft/yii2-app-advanced.svg?branch=master)](https://travis-ci.org/yiisoft/yii2-app-advanced) DIRECTORY STRUCTURE ------------------- ``` common config/ contains shared configurations mail/ contains view files for e-mails models/ contains model classes used in both backend and frontend tests/ contains tests for common classes console config/ contains console configurations controllers/ contains console controllers (commands) migrations/ contains database migrations models/ contains console-specific model classes runtime/ contains files generated during runtime backend assets/ contains application assets such as JavaScript and CSS config/ contains backend configurations controllers/ contains Web controller classes models/ contains backend-specific model classes runtime/ contains files generated during runtime tests/ contains tests for backend application views/ contains view files for the Web application web/ contains the entry script and Web resources frontend assets/ contains application assets such as JavaScript and CSS config/ contains frontend configurations controllers/ contains Web controller classes models/ contains frontend-specific model classes runtime/ contains files generated during runtime tests/ contains tests for frontend application views/ contains view files for the Web application web/ contains the entry script and Web resources widgets/ contains frontend widgets vendor/ contains dependent 3rd-party packages environments/ contains environment-based overrides ``` nginx 配置 ``` server { listen 80; server_name coupon.www.com tanhui.www.com; root "D:/coupon/public"; index index.html index.htm index.php; location / { try_files $uri $uri/ /index.php$is_args$args; } location /admin { try_files $uri $uri/ /admin/index.php$is_args$args; } location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { access_log off; expires 30d; try_files $uri =404; } location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; try_files $uri =404; } location ~ /\.(ht|svn|git) { deny all; } } ``` apache 配置 ``` AddDefaultCharset UTF-8 Options FollowSymLinks DirectoryIndex index.php index.html RewriteEngine on RewriteRule /\. - [L,F] # define the app environment variable RewriteCond %{REQUEST_URI} !^/(admin|api) RewriteRule ^ - [E=APP:frontend] RewriteCond %{REQUEST_URI} ^/admin RewriteRule ^ - [E=APP:backend] RewriteCond %{REQUEST_URI} ^/api RewriteRule ^ - [E=APP:api] # rewrite the URI of the frontend app RewriteCond %{ENV:APP} =frontend # RewriteRule ^ %{REQUEST_URI} # if a directory or a file exists, use the request directly RewriteCond %{ENV:APP} =frontend RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward the request to index.php RewriteRule ^ index.php [L] # redirect to the URL without a trailing slash (uncomment if necessary) #RewriteRule ^admin/$ /admin [L,R=301] # rewrite the URI of the backend app RewriteCond %{ENV:APP} =backend RewriteRule ^admin/?(.*)$ admin/$1 # if a directory or a file exists, use the request directly RewriteCond %{ENV:APP} =backend RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward the request to index.php RewriteRule ^ admin/index.php [L] # rewrite the URI of the api app RewriteCond %{ENV:APP} =api RewriteRule ^api/?(.*)$ api/$1 # if a directory or a file exists, use the request directly RewriteCond %{ENV:APP} =api RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward the request to index.php RewriteRule ^ api/index.php [L] # handle a directory trailing slash, redirect to the initial URI instead the rewritten one RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [L,R=301] ```