phalcana/project

Phalcana项目基础模板。

v0.8.0 2015-09-11 02:12 UTC

This package is not auto-updated.

Last update: 2024-09-28 18:10:41 UTC


README

Latest Stable Version Build Status Total Downloads License

Phalcana项目

这是Phalcana基础项目的起点,旨在作为您添加代码的模板。该仓库不是为了与您的项目保持同步而更新的,因为框架的主要组件是通过composer加载的。

要求

使用composer安装

composer create-project phalcana/project project-folder

设置虚拟主机

Phalcana项目需要重写规则。以下提供nginx和Apache的示例,以帮助您开始。

nginx虚拟主机

server {
    listen 80;
    server_name phalcana.com;
    root /var/www/phalcana;


    access_log /var/log/nginx/phalcana.com.access.log;
    error_log /var/log/nginx/phalcana.com.error.log;

    index index.php index.html index.htm;

    try_files $uri $uri/ @rewrite;

    location @rewrite {
        rewrite ^(.*)$ /index.php?_url=$1;
    }

    location ~ \.php {
        # try_files    $uri =404;

        fastcgi_index  /index.php;
        fastcgi_pass   unix:/var/run/php5-fpm.sock;

        include fastcgi_params;
        fastcgi_split_path_info       ^(.+\.php)(/.+)$;
        fastcgi_param PATH_INFO       $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

Apache .htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Replace with the directory of your installation
    RewriteBase /

    # Remove trailing slashes unless the directory exists
    RewriteCond %{REQUEST_URI} (.*)/$
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ $1 [L,R=301]

    # Protect application and system root files from being viewed
    RewriteRule ^(?:app|modules|system|example.htaccess|README.md|bower.json|Gruntfile.js|composer.json|package.json|phalcana|phalcana.bat)\b.* index.php?_url=/$0 [QSA,L]


    # Allow any files or directories that exist to be displayed directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # Rewrite all other URLs to index.php/URL  [QSA,L]
    RewriteRule .* index.php?_url=/$0 [QSA,L]

</IfModule>

入门指南

您可以通过访问浏览器中配置的路径来检查安装是否成功。如果安装成功完成,您应该看到欢迎页面。

现在您已经安装了基本设置,可以开始构建项目。有关使用框架的更多信息,请访问Phalcana文档。Phalcana构建在Phalcon之上,因此您可能还需要参考Phalcon框架的文档。