
php
gnicky
这个作者很懒,什么都没留下…
展开
-
With one file handling all requests, you can centralize things such as security handling, configurat
http://symfony.cn/docs/book/from_flat_php_to_symfony2.html No error-checking: What if the connection to the database fails? Poor organization: If the application grows, this single file will becom原创 2015-08-21 22:33:07 · 456 阅读 · 0 评论 -
spl_autoload_register
说一下常用的避免require/include的方法。1、使用魔术函数__autoload php5可以使用__autoload来避免require,用的好的话,代码里头甚至看不到几个require,真是不错的东西。测试结果表明,使用__autoload之后比 require_once然后再实例化大概要快3倍左右。这个函数最大的用处就是在实例化一个未明确定义的类时去寻找相应的文件并载入(是动态加载转载 2016-01-21 14:04:33 · 433 阅读 · 0 评论