コード例 #1
0
ファイル: api.php プロジェクト: ventsiwad/presta_addons
* http://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to interfaces@shopgate.com so we can send you a copy immediately.
*
* @author Shopgate GmbH, Schloßstraße 10, 35510 Butzbach <*****@*****.**>
* @copyright  Shopgate GmbH
* @license   http://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL"), in the version 3.0
*/
require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/shopgate.php';
require_once dirname(__FILE__) . '/override/classes/Cart.php';
if (version_compare(_PS_VERSION_, '1.4.0.2', '>=')) {
    $controller = new FrontController();
    $controller->init();
    $modules = ModuleCore::getModulesInstalled();
} else {
    // in versions before 1.4.0.2 FrontController doesn't exist
    require_once dirname(__FILE__) . '/../../init.php';
    $modules = Module::getModulesInstalled();
}
$moduleIsActive = 0;
foreach ($modules as $key => $module) {
    if ($module['name'] == 'shopgate' && !empty($module['active'])) {
        $moduleIsActive = 1;
    }
}
if ($moduleIsActive == 0) {
    throw new ShopgateLibraryException(ShopgateLibraryException::UNKNOWN_ERROR_CODE, 'shopgate module is not installed!');
    exit;
}