how to add a 3rd party library to magento?

前端 未结 2 1530
抹茶落季
抹茶落季 2020-12-28 15:57

The library doesn\'t need to integrate with magento, it\'s mostly a wrapper that communicates with an API.

I would like to be able to use this library and make these

2条回答
  •  无人及你
    2020-12-28 16:31

    Look into /lib folder in your website root directory. From Magento Base Directories:

    Magento’s library folder is where non-module based Magento code lives. This include a large amount of the system code which allows Magento to run, as well as a number of third party libraries (including the Zend Framework). The library is also the last code pool Magento will search when attempting to autoload a file.

    So, in other words, if your library supports zend file naming convention - library classes will be found and loaded by magento autoloader. Otherwise you can get path of your /lib directory with Mage::getBaseDir(‘lib’) and write something like

    require_once(Mage::getBaseDir('lib') . '/EZComponents/Base/src/base.php');
    

提交回复
热议问题