Can I use zend translate, date and cache as a standalone class in my project?

I am going to use the Zend framework, but just a Zend tool such as translation, date and cache. Can I use it as a separate class? My project has its own structure, and I do not want to use the whole Zend fw. If so, which files should be included in my project? Are there any documents for using each Zend fw tool as standalone?

+2
source share
2 answers

And remember that to use the various Zend Framework components in another project, you just need to have a library Zendsomewhere on yours include_path. Copying all this may seem redundant to use a single component, but it is only disk space. The presence of these files does not affect performance unless they are called. And so you don’t need to sweat the dependencies, for example Zend_Exceptionits various subclasses related to specific components.

So, for example, if you have a folder myapp/libto host your external libraries, you just make sure that your include path contains this folder liband copy the folder Zendlike myapp/lib/Zend.

Then, to use a component like Zend_Translate, all you have to do is something like the following:

require_once 'Zend/Translate.php';
$options = array(
    // your options here
);
$translate = new Zend_Translate($options);

- require_once. , /bootstrap:

require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();

, PEAR 1-class-1- , require/include.

, Zend, , Jani Hartikainen Packageizer.

+8

"", .

, Zend_Translate copy Translate.php Translate folder .

. . , .;)

+2

All Articles