发布于 2016-11-12 10:18:46 | 94 次阅读 | 评论: 0 | 来源: 网友投递
Phalcon开源PHP框架
PhalconPHP 是一个使用 C 扩展开发的 PHP Web 框架,提供高性能和低资源占用。
添加抽象类 PhalconMvcUserLogic,可以设置调度器绑定逻辑类,会根据控制器方法参数自动调用逻辑类静态方法call完成实例化,然后调用start完成初始化操作, 当控制器方法执行结束后,将调用finish方法:
<?php $di->set('dispatcher', function () { $dispatcher = new Dispatcher(); $dispatcher->setLogicBinding(true); return $dispatcher; });
控制器实现:
<?php class LogicController extends PhalconMvcController { public function indexAction(MyLogic $logic) { // ... } }
添加二进制数据数据读取、写入类 PhalconBinaryReader和PhalconBinaryWriter:
<?php $fp = fopen('test.bin', 'rb'); $bin = new PhalconBinaryReader($fp); $flag = $bin->readUnsignedChar(); $num = $bin->readUnsignedInt16(); $name = $bin->readString(); $fp = fopen('test.bin', 'wb'); $bin = new PhalconBinaryWrite($fp); $bin->writeUnsignedChar(1); $bin->writeUnsignedInt16(240); $bin->writeString('Phalcon7');
以及修复了一些发现的BUG和改进了表单类。