search
HomeBackend DevelopmentPHP Tutorial qeephp和CI的优缺点解决方法

qeephp和CI的优缺点
用qeephp做了几个项目了,突然想学一个新的框架,感觉ci还不错,不知道它们之间的优缺点,希望大家畅所欲言,有好的框架给推荐个也行。

------解决方案--------------------
CI比较简单,上手快,中文文档齐全,以下为CI的主要优点:

CodeIgniter 是什么?
CodeIgniter 是一个应用程序框架
CodeIgniter 是一个为用 PHP 编写网络应用程序的人员提供的工具包。它的目标是实现让你比从零开始编写代码更快速地开发项目,为此,CI 提供了一套丰富的类库来满足通常的任务需求,并且提供了一个简单的接口和逻辑结构来调用这些库。CodeIgniter 可以将需要完成的任务代码量最小化,这样你就可以把更多的精力放到项目的开发上了。

CodeIgniter 是免费的
CodeIgniter 是经过 Apache/BSD-style 开源许可授权的,只要你愿意就可以使用它。阅读 许可协议 可获得更多的信息。

CodeIgniter 在 PHP 4 上运行
CodeIgniter 的编写完全兼容 PHP 4。尽管 PHP 5 在面向对象处理方面更具优势,我们本该利用此优势来简化我们(在 PHP4 下的)实现创造性解决方案的(例如:多继承)工作,但是我们建立此框架时,PHP 5 并未被广泛使用,这意味着(如果用 PHP 5来写)我们将要放弃大部分的潜在用户。主流操作系统供应商比如 REDHAT 非常缓慢得转向对 PHP5 的支持,并且短期内他们不大可能会全面支持 PHP5。所以,我们认为用 PHP 5 来写 CodeIgniter 不合 PHP 社区的最大利益。

注解: CodeIgniter 能够在PHP5环境下运行。只是它没有使用PHP5独有的高级特征。

CodeIgniter 是轻量级的
真正的轻量级。我们的核心系统只需要一些非常小的库,这与那些需要更多资源的框架完全相反。额外的库文件只在请求的时候加载,依需求而定,所以核心系统是非常快而且轻的。

CodeIgniter 是快速的
速度非常快。你要找到一个比 CodeIgniter 表现更优的框架应该很难吧。

CodeIgniter 使用 M-V-C 模型
CodeIgniter 使用了模型(Model)- 视图(View)- 控制器(Controllers)的方法,这样可以更好地使表现层和逻辑层分离。这对项目的模板设计者来说是非常有用的,它最小化了模板中的程序代码量。我们在 MVC 各自的页面中对此做了更多的介绍。

CodeIgniter 生成干净的 URL
CodeIgniter 生成的 URL 非常干净而且是对搜索引擎友好化的。不同于标准的“字符串查询”方法,CodeIgniter使用了 segment-based 这样的方法:

example.com/news/article/345
 
注意:index.php 文件是被默认包含在 URL 中的,但是可以通过更改 .htaccess 文件来改变这个设置。

CodeIgniter 功能强大
CodeIgniter 拥有全范围的类库,可以完成大多数通常需要的网络开发任务,包括: 读取数据库、发送电子邮件、数据确认、保存 session 、对图片的操作,以及支持 XML-RPC 数据传输等。

CodeIgniter 是可扩展的
这个系统可以非常简单的通过插件和 helper 类库来进行扩展,或者也可以通过扩展类、系统钩子来实现。

CodeIgniter 不需要模板引擎
虽然 CodeIgniter 确实 自带了一个可选的模板解析器程序,但不要求你必须使用模板。模板引擎完全与本地化PHP代码的性能需求不符,使用模板引擎我们要学习其语法,这最低限度只比学PHP基础要容易一点点。考虑以下PHP代码:





  • =$name?>






再来对比模板引擎所使用的伪代码:



    {foreach from=$addressbook item="name"}

  • {$name}


  • {/foreach}



的确,例中模板引擎的代码比较清晰,但这带来一个性能问题,因为伪代码要先被转换成PHP才能运行。我们的目标是性能最大化, 所以我们选择不使用专用的模板引擎。

CodeIgniter 已彻底文档化
程序员都喜欢写代码讨厌写文档。当然我们也一样,但是既然文档和代码本身一样重要,我们就要完成它了。况且我们代码资源极其干净而且方便注释。

CodeIgniter 拥有一个友好的用户社区
你可以在我们的 社区论坛 中看到一个成长中的积极活跃的用户社区。


------解决方案--------------------
QeePHP里数据模型比较死板,为了oo而oo,而不是为了数据库查询优化。
比如每次它都会查询表结构.....

及其不喜欢
------解决方案--------------------
ci兼容php4 , 中文文档比较全。 在model层设计 比cakephp差点
------解决方案--------------------
因为它要有数据库是映射,所以必须要有表结构!然后生成模型对象!

这和cakephp是一样的!


但ci和 zendframe都不做这个,特别是zendframe!

它认为,数据库模型不一定要做表映射!

相反,数据库模型应基于业务逻辑!(这个更快)

与此相关的还有表单验证有,有的放在模型类中,有的放在控制器方法中!

比如: zend的就在控制器方法!(这也是因为,有的验证可能和数据库不相关,或者关联到多个表)


------解决方案--------------------
ci 上手快 功能全 但是不适合大型网站
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What is the difference between absolute and idle session timeouts?What is the difference between absolute and idle session timeouts?May 03, 2025 am 12:21 AM

Absolute session timeout starts at the time of session creation, while an idle session timeout starts at the time of user's no operation. Absolute session timeout is suitable for scenarios where strict control of the session life cycle is required, such as financial applications; idle session timeout is suitable for applications that want users to keep their session active for a long time, such as social media.

What steps would you take if sessions aren't working on your server?What steps would you take if sessions aren't working on your server?May 03, 2025 am 12:19 AM

The server session failure can be solved through the following steps: 1. Check the server configuration to ensure that the session is set correctly. 2. Verify client cookies, confirm that the browser supports it and send it correctly. 3. Check session storage services, such as Redis, to ensure that they are running normally. 4. Review the application code to ensure the correct session logic. Through these steps, conversation problems can be effectively diagnosed and repaired and user experience can be improved.

What is the significance of the session_start() function?What is the significance of the session_start() function?May 03, 2025 am 12:18 AM

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.

What is the importance of setting the httponly flag for session cookies?What is the importance of setting the httponly flag for session cookies?May 03, 2025 am 12:10 AM

Setting the httponly flag is crucial for session cookies because it can effectively prevent XSS attacks and protect user session information. Specifically, 1) the httponly flag prevents JavaScript from accessing cookies, 2) the flag can be set through setcookies and make_response in PHP and Flask, 3) Although it cannot be prevented from all attacks, it should be part of the overall security policy.

What problem do PHP sessions solve in web development?What problem do PHP sessions solve in web development?May 03, 2025 am 12:02 AM

PHPsessionssolvetheproblemofmaintainingstateacrossmultipleHTTPrequestsbystoringdataontheserverandassociatingitwithauniquesessionID.1)Theystoredataserver-side,typicallyinfilesordatabases,anduseasessionIDstoredinacookietoretrievedata.2)Sessionsenhances

What data can be stored in a PHP session?What data can be stored in a PHP session?May 02, 2025 am 12:17 AM

PHPsessionscanstorestrings,numbers,arrays,andobjects.1.Strings:textdatalikeusernames.2.Numbers:integersorfloatsforcounters.3.Arrays:listslikeshoppingcarts.4.Objects:complexstructuresthatareserialized.

How do you start a PHP session?How do you start a PHP session?May 02, 2025 am 12:16 AM

TostartaPHPsession,usesession_start()atthescript'sbeginning.1)Placeitbeforeanyoutputtosetthesessioncookie.2)Usesessionsforuserdatalikeloginstatusorshoppingcarts.3)RegeneratesessionIDstopreventfixationattacks.4)Considerusingadatabaseforsessionstoragei

What is session regeneration, and how does it improve security?What is session regeneration, and how does it improve security?May 02, 2025 am 12:15 AM

Session regeneration refers to generating a new session ID and invalidating the old ID when the user performs sensitive operations in case of session fixed attacks. The implementation steps include: 1. Detect sensitive operations, 2. Generate new session ID, 3. Destroy old session ID, 4. Update user-side session information.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment