Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 720 Vote(s) - 3.52 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ZendFramework integration with other frameworks

#1
I want to make this question a guide for those interested in [ZendFramework][1] integration with other libraries/frameworks. Searching over StackOverflow doesn't give a broad view on the subject.

The question is: which libraries/frameworks do you use in your current ZF-based project? what are the best practices for ZF-based project architecture?

I don't mean any components that are *already* a part of ZF. Please give a description of **aditional** frameworks you have integrated (like [RuckUsing][2], [Smarty][3], or [Doctrine][4]). It also applies to any GUI frameworks (perhaps you use a CSS framework), as well as JS frameworks (not just [jQuery][5] or [prototype][6], but rather some advanced structures).

The main requirement: it has to be a ZendFramework project.

Additional bonus will be given to answers that describe performance optimization.

__UPDATE__

Every answer as informative as @BryanM's will be considered for additional bounty award.

[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

[4]:

[To see links please register here]

[5]:

[To see links please register here]

[6]:

[To see links please register here]

Reply

#2
I use Doctrine 2 in my Zend Framework projects. It's easy to use and fits in seamlessly. The basic steps to integrate it are:

- Write a resource plugin that will initialize a Doctrine 2 EntityManager using configurations options in `application.ini`. An example of one can be found in Benjamin Eberlei's [DoctrineExtensions](

[To see links please register here]

).
- Rather than rely on a global registry (`Zend_Registry`) to store the EntityManager reference, I rely on a simple depedency injection solution as [described here](

[To see links please register here]

) to provde the instance to my controllers.
- I rely on Doctrine's Event system to create re-usable 'behavior' classes to do things like update timestamps or validate data.
- I keep all my Entities and business objects in my application's 'models' folder (under it's own namespace), and everything else in in my `library` folder. I heavily use PHP 5.3 namespaces to keep things organized.
- I use Doctrine's new-ish Migrations library to handle updates to the database via the command line.
- I also highly recommend creating a detailed build process in [Phing](

[To see links please register here]

) in order to handle library dependencies, automated unit testing and running migrations that can be integrated into source control or a CI Server. Also good for compiling Javascript or CSS if you're using one of those frameworks.

These practices aren't just good for Doctrine, they'll be handy anytime you're trying to built a site's architecture. I think that Zend's biggest assets in extensibility are Resource plugins and ActionHelpers / Controller Plugins.
Reply

#3
Also remember [HtmlPurifier](

[To see links please register here]

) for HTML sanitization, typically parsing user-provided markup, based upon a whitelist of allowable tags, and producing standards-compliant output markup.

It can be used as a first line of defense against XSS attacks. Note that `Zend_Filter_StripTags` is [_not_ sufficient](

[To see links please register here]

) for this purpose.
Reply

#4
- ZendX_JQuery (a tutorial is available on [zendcast.com][1]).


- Although, it's a ruby application, we use [webistrano][2] to deploy php projects.


- If your web application has to do full-text search on a large scale, i would use sphinx in combination with zend ([sorgalla.com][3]).
- If you want to use those new NoSQL-Databases like MongoDB, you could use [morph][4] as high level php-library. I just copied the files to 'library' and told the autoloader to load the files: autoloaderNamespaces[] = "Morph_".

- [ZF_Debug][5] is a nice debugging toolbar for development.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

[4]:

[To see links please register here]

[5]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through