• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

OneFox: A Simple PHP Framework

原作者: [db:作者] 来自: 网络 收藏 邀请

OneFox

Introduction

build PHP version license download author

[Simplified Chinese]

OneFox is a simple php framework(require php5.4+). It's very convenient to use. Simple reading manual can quickly develop their own web site. Advantages are as follows:

  • The frame core is not bulky, and the loading speed is fast.
  • More suitable for API and other interface services.
  • Templates don't rely on template engines, reducing the cost of learning template languages.
  • The core code is concise and can be adjusted according to business needs.

Install and Configure

Install

$ git clone https://github.com/zer0131/OneFox.git /home/project

Of course, you can also customize other clone directories.

Nginx

server {    listen  80;    server_name  www.appryan.com appryan.com;    index index.php index.html index.html;    root /home/project/app/public;    location / {        try_files $uri $uri/ /index.php?$args;    }    location ~ .*\.(php|php5)?$ {        fastcgi_pass  127.0.0.1:9000;        fastcgi_index index.php;        include fastcgi.conf;    }    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {        #expires 30d;    }    location ~ .*\.(js|css)?$ {        #expires 1h;    }    access_log  /usr/local/nginx/logs/OneFox.log;}

301 redirect.

if ($host != 'www.appryan.com') {    rewrite ^/(.*)$ http://www.appryan.com/$1 permanent;}

Apache

<VirtualHost 80>    DocumentRoot "/home/project/app/public"    ServerName www.appryan.com    ServerAlias www.appryan.com    ErrorLog "logs/OneFox.error.log"    CustomLog "logs/OneFox.access.log" common</VirtualHost>

.htaccess

<IfModule mod_rewrite.c>    Options +FollowSymlinks    RewriteEngine On    RewriteCond %{REQUEST_FILENAME} !-d    RewriteCond %{REQUEST_FILENAME} !-f    RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]</IfModule>

Tip: The part of the annotation can be modified according to the actual situation

Directory

project           Project dir ├─LICENSE         LICENSE├─README.md       README ├─app             App Dir ├─extend          Extended class library└─onefox          Framework dir

App Directory

├─app │  ├─actions       │  ├─cache          │  ├─config      │  ├─controller  │  │  ├─index     │  ├─lib          │  ├─model        │  ├─tpl          │  │  ├─comm      │  │  ├─index    │  │  │  ├─index  │  ├─logs         │  ├─daemon       │  └─public      

Framework Directory

├─onefox│  ├─caches             Caches│  ├─tpl                Sys Tpl│  ├─C.php              Static function│  ├─Cache.php          Abstract cache class│  ├─Config.php         Config class│  ├─Controller.php     Abstract controller class│  ├─DB.php             Database class│  ├─Dispatcher.php     Routing class│  ├─Log.php            Log class│  ├─Model.php          Basic Model│  ├─Request.php        Request class│  ├─Response.php       Response class│  ├─View.php           View class│  ├─functions.php      Common functions│  └─OneFox.php         Entry class

Development specification

1、The module directory needs to be lowercase, and the controller file name is uppercase

2、The class name in the extension library uses the hump naming method, and the file name should be the same as the class name, such as: MyClass

3、Using namespaces, and the prefix should be the same as the directory name, such as namespace lib\MySpace\MyClass, file name lib/MySpace/MyClass

4、The initial letter of the template controller should be lowercase

Composer

The framework automatically identifies the vendor directory in composer. Please introduce the class library you want to use in composer.json.

Install

curl -sS https://getcomposer.org/installer | php

Or

php -r "readfile('https://getcomposer.org/installer');" | php

Composer Usage

Document

http://www.zhangenrui.com/category/#onefox


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap