raducorp/rii2-app-advanced

Yii/Rii 2 高级项目模板

dev-master 2016-12-27 15:49 UTC

This package is not auto-updated.

Last update: 2024-09-23 16:06:27 UTC


README

安装

$ composer global require "fxp/composer-asset-plugin:^1.2.0"

$ composer install

控制台

$ ./riic console/test/test # The useless command!

URLs

http://hostname/                        # -> frontend (web)
http://hostname/login                   # -> frontend (web)
http://hostname/admin                   # -> backend (web)
http://hostname/api/v1/users            # -> restapi/users/1 (rest)
http://hostname/api/v1/users/1/products # -> restapi/products # (rest sub-resources)

待办事项

  • WIP:找到链接子资源的方法:获取属于用户:1的产品
  • REST API 模块版本子文件夹 restapi/v1/ restapi/v2.2/
  • 改进配置
  • 更好的表单小部件 common\component\FormWidget
  • 使用两步流程登录(用户名步骤 & 密码步骤)请参阅 AuthController.php
  • 缓存预热!?
  • 需要一个更好的模块类:自动加载其配置文件。
  • ./riic console/test/test 中删除 console

NGINX

server {
    charset utf-8;
    client_max_body_size 128M;
    sendfile off;
    
    listen 80; ## listen for ipv4
    #listen [::]:80 default_server ipv6only=on; ## listen for ipv6
    
    server_name rii2.app.advanced;
    root        /var/www/rii2.app.advanced/web/; # all folders require +x rights
    index       app.php;
    
    access_log  /var/log/access.rii2.app.advanced.log;
    error_log   /var/log/error.rii2.app.advanced.log;
    
    location / {
        # Redirect everything that isn't a real file to app.php
        try_files $uri $uri/ /app.php$is_args$args;
    }
    
    # uncomment to avoid processing of calls to non-existing static files by Yii
    location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
        try_files $uri =404;
    }
    error_page 404 /404.html;
    
    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass  127.0.0.1:9000; # @see cgi.fix_pathinfo=0 in php.ini
        try_files $uri =404;
    }
    
    location ~ /\.(ht|svn|git) {
        deny all;
    }
}