Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>And remember, to use various Zend Framework components in another project, you just need to have the <code>Zend</code> library somewhere on your <code>include_path</code>. Copying the whole thing may seem overkill to use one component, but it's only disk space. Having those files there doesn't affect performance unless they are called upon. And this way, you don't have to sweat the dependencies, like <code>Zend_Exception</code> and its various component-specific subclasses.</p> <p>So, for example, if you have a folder <code>myapp/lib</code> to contain your external libraries, you simply make sure that your include path contains that <code>lib</code> folder and copy the <code>Zend</code> folder into it as <code>myapp/lib/Zend</code>.</p> <p>Then to use a component like <code>Zend_Translate</code>, all you have to do is something like the following:</p> <pre><code>require_once 'Zend/Translate.php'; $options = array( // your options here ); $translate = new Zend_Translate($options); </code></pre> <p>With some kind of autloading mechanism in place, you can avoid even the <code>require_once</code> call. Setting up autoloading is as easy as putting the following in some kind of common/bootstrap file:</p> <pre><code>require_once 'Zend/Loader/Autoloader.php'; Zend_Loader_Autoloader::getInstance(); </code></pre> <p>Then any classes that follow the <a href="http://pear.php.net/manual/en/standards.naming.php" rel="nofollow">PEAR 1-class-1-file naming convention</a> can be loaded without explicitly adding any require/include statements.</p> <p>If disk-space really is a concern and you really don't want the whole <code>Zend</code> library, then you could investigate a packageizer, like <a href="http://github.com/jhartikainen/packageizer" rel="nofollow">Jani Hartikainen's Packageizer</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload