The DIY yaf Framework.

Maintainers

Details

github.com/test-lin/yaf

Source

Issues

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:project

v1.0.0 2019-10-23 07:55 UTC

This package is auto-updated.

Last update: 2024-04-23 18:13:10 UTC


README

环境要求

  • php7.0+
    • yaf
    • yar
  • composer

安装

composer create-project --prefer-dist test-lin/yaf blog

配置

1、nginx 站点

server {
    listen 80;
    root   /var/www/yaf-framework/public;
    server_name www.yaf.com;
    index  index.php;

    charset utf-8;
    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }
    error_log  /var/log/nginx/yaf.log error;

    location / {
        if (!-e $request_filename) {
            rewrite ^/(.*)$  /index.php?$1 last;
        }
    }

    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

开发规范

  • 基础规范 RSP-4
  • 文件夹命名:全英文小写
  • 类文件及类名命名:大驼峰
  • 变量、类属性命名:小驼峰
  • 常量命名:大写英文 + 下划线
  • 类方法命名:小驼峰
  • 函数命名:小写英文 + 下划线
  • 无任何关联的函数全部放置在公共函数中