Use Zend Framework components without a real structure?

I was wondering if anyone knows how to use some of the components of the Zend Framework without actually using the framework. For example, I would like to use their Zend_Validate , but I do not want the overhead of the framework, as this is a small one-page script.

Is this easy to do, and if so, are there any manuals / tutorials on how to do this?

+7
php validation zend-framework
source share
3 answers

Zend components are intentionally designed to be free pairs from the structure itself.

The component structure of the Zend Frame is somewhat unique; Each component is designed with several dependencies on other components. This loosely coupled architecture allows developers to use components individually. We often call this "use as desired." [ from here ]

Here's a tool for pulling certain components and their dependencies for use in your application.

+11
source share

I just grabbed the whole Zend package and used it. It seems to me that in the end I use the most over time, so I keep it up to date, even if I do not use some MVC materials in one project. Holding onto all of this, you don't have to worry about dependencies (and how they can change along the way).

+2
source share

The components of the Zend frame, being free in pairs, are still connected. If you want to use the Zend_Mail component, for example, this will also require:

  • Zend_mime
  • Zend_exception
  • Zend_validation

Zend_Validation will only load due to an email domain check.

So, the best option would be to include the entire Zend library. By pulling only a few components, you will soon find yourself in hellish hell, especially if you change the API (although this does not happen too often).

In addition, starting with version 2.0, you should use some autoloader to load Zend components, since all calls require removal from PHP classes.

+1
source share

All Articles