caffeina-core / base-application
Caffeina Core - 应用骨架
1.0.6
2016-04-18 15:55 UTC
Requires
- php: >=5.4
- caffeina-core/core: *
- caffeina-core/twig: *
This package is auto-updated.
Last update: 2024-09-16 21:12:45 UTC
README
Web 应用纯模板。
安装
通过composer创建此项目的新的副本
$ composer create-project caffeina-core/base-application ./my-awesome-new-app
$ cd my-awesome-new-app
$ composer dump-autoload -o
完成。
Docker
从
docker pull caffeina/core-app
前端控制器
像所有基于URL路由的Web应用一样,您需要将每个请求传递给前端控制器public/index.php
。
NginX + PHP-FPM
将PATH_TO_YOUR_APP_DIR
更改为您项目目录的绝对路径。
server { listen 80 default_server; root PATH_TO_YOUR_APP_DIR/public/; index index.php index.html index.htm; location / { try_files $uri /index.php$is_args$args; } # pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock location ~ \.php$ { try_files $uri /index.php =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
Apache2
确保虚拟主机的文档根指向PATH_TO_YOUR_APP_DIR/public/
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>