2017 © Pedro Peláez
 

library focusphp

FocusPHP 微框架

image

aicode/focusphp

FocusPHP 微框架

  • Friday, October 7, 2016
  • by mylxsw
  • Repository
  • 4 Watchers
  • 4 Stars
  • 48 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

FocusPHP

FocusPHP is a micro php framework, (*1)

Build Status, (*2)

TODO

  • 完善docker开发环境
  • 增加后台管理
  • 框架与项目分离
  • 完善单元测试,使用Travis CI持续集成

备注

数据库文件中,username=admin, password=administrator, (*3)

安装使用

composer require aicode/focusphp

MVC支持

框架本身可选的对MVC提供了支持,只需要在创建Focus\Server对象时注册Focus\MVC\Router对象即可。, (*4)

$server->registerRouter(new Focus\MVC\Router('Demo\Controllers'));

创建Focus\MVC\Router是需要提供控制器命名空间作为参数,这样框架就回到该命名空间下寻找适合处理当前请求的控制器。, (*5)

视图对象

视图类需要实现Focus\MVC\View接口,框架内置了一套简单的视图实现Focus\MVC\SimpleView, 该实现使用.php文件作为视图文件模板,在模板文件中,直接使用原始的PHP语法即可。, (*6)

默认视图Focus\MVC\SimpleView提供了layout支持。, (*7)

隐藏的模板变量, (*8)

变量名 说明
__body__ 解析模板后的内容,该变量只在layout中可用
__data__ 给模板对象传递的字符串数据(无key)

框架异常消息

消息 含义
INVALID_ROUTER 路由不合法
INVALID_ROUTER_ARGS 路由参数不合法
INVALID_ROUTER_FUNC 路由规则执行函数不合法
NONSUPPORT_PHP_VERSION PHP版本不支持,请使用5.6.0以上版本
CONFIG_FILE_NOT_FOUND 配置文件不存在
INVALID_CONFIG_FORMAT 不合法的配置文件格式

日志

如果定义了FOCUS_DEBUG常量,并且该常量的值为true,则启用框架日志,框架日志将合并到应用的debug日志中, 默认情况下是不开启框架的日志的., (*9)

框架记录的所有日志均为debug日志, (*10)

The Versions

07/10 2016

dev-master

9999999-dev

FocusPHP 微框架

  Sources   Download

MIT

The Requires

 

by 管宜尧

framework php focus

31/12 2015

0.1.1

0.1.1.0

FocusPHP 微框架

  Sources   Download

MIT

The Requires

 

by 管宜尧

framework php focus

10/12 2015

dev-focusphp-7

dev-focusphp-7

FocusPHP 微框架

  Sources   Download

MIT

The Requires

 

by 管宜尧

framework php focus

23/10 2015

0.1

0.1.0.0

FocusPHP 微框架

  Sources   Download

MIT

The Requires

 

by 管宜尧

framework php focus