LazyPHP 是一个简单的PHP框架。整合了 Yui css,Mootools,Simple Test和JsUnit等组件和工具,适合于项目启动时作为初始框架使用.
所有的请求都将通过/index.php进行转发.在请求数据中,变量m和变量a标示了该请求会转发到的class 和method.未指明时,LP自动加载/core/config /core.config.php中的设置.以下代码说明了请求转发的过程.[code]$post_fix = '.class.php';
$mod_file = AROOT . 'mod' . DS . $m . $post_fix;
if( !class_exists( $m.'Mod' ) ) die('Can\'t find class - ' . $m . 'Mod');
$class_name =$m.'Mod';
$o = new $class_name;
if( !method_exists( $o , $a ) ) die('Can\'t find method - ' . $a . ' ');
call_user_method( $a , $o );[/code]由以上代码可知,每次请求,LP都会执行 /app/mod/目录下的某个class的实例的方法. 通常我们会将一组功能放置到一个mod文件中,如user.class.php,包含了 reg,save,modify,update,login,logout等方法。
项目主页:http://code.google.com/p/lazyphp/
下载地址:http://code.google.com/p/lazyphp/downloads/list
来自:开源中国社区