如何组合zend框架和Codeigniter? [英] How to combine zend framework and Codeigniter?

查看:121
本文介绍了如何组合zend框架和Codeigniter?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何组合zend框架和Codeigniter?



我有两个应用程序,一个是zend,另一个是codeigniter,一个项目?如果是,如何结合这两个框架和这是什么文件结构?



感谢您的帮助。



我曾经在一个项目中使用了Zend + CodeIgniter。

p>

这里是您需要做的:



1。 (library)into CodeIgniter的库或者将CodeIgniter库复制到zend库文件夹中。



2。如果在codeigniter中, c $ c> $ this-> load-> library('Zend','{anything here}')
或在Zend中使用 autoloader



您将面临的问题我遇到):


  1. 验证

Zend使用Zend Auth命名空间,它使用$ _SESSION。而CI不使用$ _SESSION,但它有自己的内置系统。使用Zend和(假设你的整个应用程序只在同一个域)看到它存储的身份,通过CI直接检查$ _SESSION并分配CI Cookie。这是我发生了什么并检查解决方案


  1. 安全性和表单

和Zend有不同的窗体库,不要在加载Zend库(在CI下)的类中使用CI的形式,只需记住这是一个缩略规则。所以,你需要策略如何实现它,Zend上的CI或CI上的Zend。不要使用CI形式的Zend验证器(我知道没有人会这样做,但是,一旦我做了,任何人都可以做到!使用相同的库安全性您将用于表单的库



个人来说,我的项目做了很多(ofc经过大量的研究),它是:CI在Zend,其中我HAD使用Zend Auth。



有问题吗? :)


How to combine zend framework and Codeigniter ?

I have two applications, one is zend and other one is codeigniter, is it possible to combine the two framework in to one project ? If so, How to combine the two framework and what are the files structure for this ?

Thank you for you help.

解决方案

Ofcourse it is possible.

I have worked on one project where we had Zend + CodeIgniter both.

Here is what you need to do:

1. Copy paste your Zend folder (library) into Library of CodeIgniter OR viceversa copy CodeIgniter library into zend library folder.

2. If in codeigniter, call it using $this->load->library('Zend', '{anything here}') or in Zend use autoloader

Issues you WILL face (which I faced):

  1. Authentication

Zend uses Zend Auth Namespace which uses $_SESSION . Whereas CI does not use $_SESSION but, has it's own built in system. Use Zend and (assuming your entire app is on same domain only) see what it stores for identity, check for that $_SESSION directly via CI and assign CI cookies. Here is what happened with me and check the solution.

  1. Security and Forms

Both CI and Zend have different libraries for Forms, do not use Form of CI in the class which loads Zend Library (under CI), just remember this as a thumb-rule. So, you need to strategize how you will implement it, Zend on CI or CI on Zend. Do not use validators of Zend in CI forms (I know no one will do it but, once I did, so anyone can do it! DONT DO IT). Use same library of security which library you will use for forms

Personally, my project did great (ofc after lot of research), it was : CI on Zend, where I HAD to use Zend Auth.

Questions? :)

这篇关于如何组合zend框架和Codeigniter?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆