Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to use Magento's existing / included Zend Framework in another app?
    text
    copied!<p>I want to make a little Zend app that runs along side our Magento (Enterprise) install. Can I use the existing Zend code included with Magento? Or do I need to have another separate copy of Zend?</p> <p>I am afraid that Varien has probably messed with the framework code. Just looking it appears they have commented out all require() statements, which is throwing lots of errors (obviously). The Zend AutoLoader won't work, at any rate. Is there a way to use the Varien AutoLoader instead?</p> <p>I don't particularly want to import another framework (3000+ files) into our project if I can avoid it.</p> <p>Thanks!</p> <p>EDIT:</p> <p>Here is my dir structure:</p> <pre><code>/localsite/ -- root /localsite/products -- Magento install /localsite/products/lib/Zend --Zend in Mage folder /localsite/fbtest -- my Zend Framework app root /localsite/fbtest/application -- my Zend Framework app </code></pre> <p>Here is the code I am trying (/localsite/fbtest/public/index.php):</p> <pre><code>&lt;?php define('DS', DIRECTORY_SEPARATOR); defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')); set_include_path(implode(PATH_SEPARATOR, array( BASE_PATH . DS . 'products' . DS . 'lib' . DS . 'Zend', get_include_path(), ))); require_once('../../products/lib/Zend/Application.php'); $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); $application-&gt;bootstrap() -&gt;run(); </code></pre> <p>Here is the error:</p> <pre><code>Fatal error: Class 'Zend_Loader_Autoloader' not found in C:\xampp\htdocs\localsite\products\lib\Zend\Application.php on line 81 </code></pre> <p>Here is the include_path:</p> <pre><code>C:\xampp\htdocs\localsite\products\lib\Zend;.;C:\php\pear </code></pre> <p>And here is where AutoLoader should be included (in /products/lib/Zend/Application.php):</p> <pre><code>#require_once 'Zend/Loader/Autoloader.php'; $this-&gt;_autoloader = Zend_Loader_Autoloader::getInstance(); </code></pre> <p>^^^ see that '#' where the require_once is commented out? I think that's a change Varien made which breaks the Framework, no? It appears to be why it's not working form me, at least? How can I get around this and include all of the commented out includes??</p> <p>Thanks again</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