+ -
当前位置:首页 → 问答吧 → Punny:PHP Bunny - 打造最简单易用的微型MVC框架(预览版)

Punny:PHP Bunny - 打造最简单易用的微型MVC框架(预览版)

时间:2009-02-05

来源:互联网

前几天发了一个Demo.然后我完善了下.不掉大家胃口了.
今天发布出来.
Punny意为PHP Bunny
Bunny意为敏捷机灵的兔子.正好我是属兔的:).
立志打造最简单易用的小型MVC框架

主要功能有:

1.完全实现MVC
2.如果启用urlrewrite可以完全隐藏PHP程序.(全自动)
3.简单易用的Config配置.(稍后我会发布一个专门配置Punny的程序)
4.可以实现伪静态(这个是半自动的)
5.速度快.框架的核心代码只有几行.整个框架压缩后只有10K(代码含注释)
6.尽量没有更改PHP传统编程思路.
7.使用了Discuz的框架引擎
8.可以自动转义POST GET COOKIE
9.框架代码容易理解.可以自己DIY

另外需要注意的一点.个人觉得再强大的OO数据库操作类也不如SQL语句强大.所以只提供了最基础的DB类.如果你不喜欢可以自己DIY

这只是一个预览版.希望大家能够帮我测试找出BUG..

注意:帮助文档和学习手册我正在写.过几天发布.这其中带了一个Demo.大家可以首先体会一下.

第一个BUG被于安发现.
就是在没有开启urlrewrite的情况下index.php会出现目录错误.因为我是以'.'来判断目录了
这个BUG我已经解决.但是不知道是否完美.希望大家继续帮我测试.
谁有什么好的建议呢?在URL中用什么符号来分割目录??

Punny.rar (10.1 KB)

下载次数:232

2009-2-5 16:14

作者: TankMe   发布时间: 2009-02-05

好 !

作者: shanji   发布时间: 2009-02-05

支持

作者: cnkiller   发布时间: 2009-02-05

广告位招租

作者: 生命如蓝   发布时间: 2009-02-05

支持楼主

作者: analyzer   发布时间: 2009-02-05

本地测试失败...

http://127.0.0.1/Punny/Test1/aaa/111/bbb/5555  找不到文件...

作者: 冯.于安   发布时间: 2009-02-05

如果你开启了urlrewrite才可以这样用
不然的话得这样
http://127.0.0.1/Punny/index.php/Test1/aaa/111/bbb/5555
开启了第一次执行一下http://127.0.0.1/Punny.让框架自动生成.htaccess
第二次
http://127.0.0.1/Punny/Test1/aaa/111/bbb/5555 执行这个就可以了
还有你这个路径对应的是Test1这个Action
检查你的Controller有没有这个Action

作者: TankMe   发布时间: 2009-02-05

本地环境,APMsev 好像用不了urlrewrite

作者: 冯.于安   发布时间: 2009-02-05

位置没有我的好

作者: cnkiller   发布时间: 2009-02-05

那就在config.ini.php中关闭urlrewrite
我以后会出个配置器.
还有因为现在没文档.所以你问的正是我帮助文档中想说的.等有了文档就一切OK了

作者: TankMe   发布时间: 2009-02-05

http://127.0.0.1/Punny/index.php/Test1/aaa/111/bbb/5555

这样访问也报错..
Fatal error: Uncaught exception 'Exception' with message '错误的请求,找不到Controller文件(./Controller/index/php.php)' in F:\APMServ5.2.6\www\htdocs\Punny\Punny\Controller.class.php:178 Stack trace: #0 F:\APMServ5.2.6\www\htdocs\Punny\Punny\Controller.class.php(148): Controller->throwException('???????????????...') #1 F:\APMServ5.2.6\www\htdocs\Punny\Punny\Controller.class.php(101): Controller->getControllerFile() #2 F:\APMServ5.2.6\www\htdocs\Punny\Punny\Punny.class.php(54): Controller->run() #3 F:\APMServ5.2.6\www\htdocs\Punny\index.php(3): Punny->__construct('F:\APMServ5.2.6...', 'config.ini.php') #4 {main} thrown in F:\APMServ5.2.6\www\htdocs\Punny\Punny\Controller.class.php on line 178回复:突然发现一个设计缺陷.谢谢于安.不能以'.'来判断路径...谁有更好的提议??
马上修改

作者: 冯.于安   发布时间: 2009-02-05

已经好了.于安你重新下载下试试

作者: TankMe   发布时间: 2009-02-05

不玩了,  回头我也写一个框架...

      什么叫简易..  打败你.

作者: TankMe   发布时间: 2009-02-05

Fatal error: Uncaught exception 'Exception' with message '错误的请求,找不到Controller文件(./Controller/Test1.php)' in D:\WEB\WAMP\xampp\htdocs\PHP_F\Punny\Punny\Controller.class.php:180 Stack trace: #0 D:\WEB\WAMP\xampp\htdocs\PHP_F\Punny\Punny\Controller.class.php(150): Controller->throwException('???????????????...') #1 D:\WEB\WAMP\xampp\htdocs\PHP_F\Punny\Punny\Controller.class.php(101): Controller->getControllerFile() #2 D:\WEB\WAMP\xampp\htdocs\PHP_F\Punny\Punny\Punny.class.php(54): Controller->run() #3 D:\WEB\WAMP\xampp\htdocs\PHP_F\Punny\index.php(3): Punny->__construct('D:\WEB\WAMP\xam...', 'config.ini.php') #4 {main} thrown in D:\WEB\WAMP\xampp\htdocs\PHP_F\Punny\Punny\Controller.class.php on line 180

作者: 冯.于安   发布时间: 2009-02-05

原帖由 kakashilw 于 2009-2-5 16:37 发表
Fatal error: Uncaught exception 'Exception' with message '错误的请求,找不到Controller文件(./Controller/Test1.php)' in D:\WEB\WAMP\xampp\htdocs\PHP_F\Punny\Punny\Controller.class.php:180 Stack trace:  ...
你的请求是Test1.你得有Test1这个Action.

作者: kakashilw   发布时间: 2009-02-05

支持一哈哈

作者: TankMe   发布时间: 2009-02-05

学习 学习

作者: iminto   发布时间: 2009-02-06

呵呵。。都是高手一,,

作者: goodko   发布时间: 2009-02-12

建议 ?abc=123 用_分割 目录还是 / 分割

作者: teri   发布时间: 2009-02-12

支持,如能增加一个权限就好了

作者: kth007   发布时间: 2009-02-24

来支持下!!!!

作者: xieguolun   发布时间: 2009-04-10