2017 © Pedro Peláez
 

library fatephp

A light php framework

image

yulipu/fatephp

A light php framework

  • Thursday, August 2, 2018
  • by yulipu
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

小型 php 框架 非线程安全

DOC

php 版本
  • php5.4+
  • php7
变更
  • v3.0.1 重构部分代码
  • v2.1.0 重构数据库部分
  • v2.0.0 修改框架名 yphp 更名为 fatephp 所有类路径 有 y\xxx 变为 fate\xxx
  • v1.3.0 更改 y\helpers\LinkedQueue 到 y\util\LinkedQueue
  • v1.3.0 修改 y\web\Request::getParam() 为 y\web\Request::getQueryString()
  • v1.3.0 修改 y\web\Request::postParam() 为 y\web\Request::getParameter()
  • v1.3.0 修改 y\web\Controller::view 的获取方式 $this->view 为 $this->getView()
本程序特点
  • 采用控制器单一入口执行程序 解决单一文件过大不好维护问题
  • 以控制器目录分组的方式组织代码 结构清晰 支持无限级子目录 (模块控制器除外)
系统内置别名
  • @fate 系统目录
  • @app 项目目录 由 appPath 指定
  • @runtime 缓存目录 指向 @app/runtime
项目目录结构
|- index.php
|
|- public 目录
|
|- app 项目目录
|  |
|  |-- controllers 普通控制器目录
|      |
|      |-- user 用户组目录
|      |   |
|      |   |-- IndexController.php 用户组下的控制器
|      |   |-- OtherController.php
|      |
|      |-- goods 商品组目录
|      |   |
|      |   |-- IndexController.php
|      |   |-- OtherController.php
|      |
|   -- views 普通控制器模板目录
|      |
|      |-- user 用户组模板 对应上面用户组
|      |   |
|      |   |-- index.php
|      |   |-- other.php
|      |
|   -- goods 商品组模板
|      |   |
|      |   |-- index.php
|      |   |-- other.php
|      |
|   -- modules 模块
|      |
|      |-- reg
|      |   |
|      |   |-- controllers 模块控制器目录 其下无子目录
|      |   |   |
|      |   |   |-- IndexController.php
|      |   |
|      |   |-- views 模块模板目录
|      |   |   |
|      |   |   |-- index.php
|      |   |
|      |   |-- 其他目录
|      |
|   -- runtime 缓存目录
|
路由格式

/index.php?r=[route_prefix|moduleId]/[controllerId]
index.php

<?php
require(__DIR__ . '/system/Fate.php');

$res = (new fate\web\Application([
    'id'=>1, 
    'appPath'=> __DIR__ . '/app',
    'modules' => [
        'reg' => 'app\\modules\\reg'
    ],
    'db' => [
        'main' => [
            'dsn' => 'mysql:host=localhost;dbname=xxx',
            'username' => 'root',
            'password' => 'root',
            'charset' => 'utf8'
        ]
    ],
    'cache' => [
        'file' => [
            'class' => 'fate\cache\file\Cache'
        ]
    ],
    'log' => [
        'targets' => [
            'file' => [
                'class' => 'fate\log\file\Log'
            ]
        ]
    ]

]))->run();
install
  1. use composer
composer require afuafuyo/fatephp
  1. github source

Download source code from github and place it under the project, (*1)

The Versions

02/08 2018

dev-master

9999999-dev https://github.com/yulipu/fatephp

A light php framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

framework

29/07 2018

v2.1.0

2.1.0.0 https://github.com/yulipu/fatephp

A light php framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

framework

24/06 2018

v2.0.0

2.0.0.0 https://github.com/yulipu/yphp

A light php framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

framework

29/11 2017

v1.3.0

1.3.0.0 https://github.com/yulipu/YFramework

A light php framework

  Sources   Download

Apache License

The Requires

  • php >=5.4.0

 

framework

11/01 2017

v1.2.0

1.2.0.0 https://github.com/yulipu/YFramework

A light php framework

  Sources   Download

Apache License

The Requires

  • php >=5.4.0

 

framework