first commit
This commit is contained in:
49
modules/x13import/x13import.ion.php
Normal file
49
modules/x13import/x13import.ion.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
$baseDir = _PS_MODULE_DIR_ . 'x13import/';
|
||||
|
||||
// PrestaShop 1.5 backward compatibility
|
||||
if (!defined('_PS_CORE_DIR_')) {
|
||||
define('_PS_CORE_DIR_', _PS_ROOT_DIR_);
|
||||
}
|
||||
|
||||
if (!defined('X13_IMPORT_DIR')) {
|
||||
define('X13_IMPORT_DIR', $baseDir);
|
||||
define('X13_IMPORT_CACHE_DIR', X13_IMPORT_DIR . 'cache/');
|
||||
define('X13_IMPORT_WHOLESALERS_DIR', X13_IMPORT_DIR . 'wholesalers/');
|
||||
define('X13_IMPORT_LOG_DIR', X13_IMPORT_DIR . 'log/');
|
||||
define('X13_IMPORT_TOOLS_DIR', X13_IMPORT_DIR . 'tools/');
|
||||
}
|
||||
|
||||
if (!defined('X13_ION_IMPORT')) {
|
||||
if (PHP_VERSION_ID >= 70100) {
|
||||
$x13IonVer = 'php71';
|
||||
} else if (PHP_VERSION_ID >= 70000) {
|
||||
$x13IonVer = 'php70';
|
||||
} else {
|
||||
$x13IonVer = 'php5';
|
||||
}
|
||||
|
||||
$phpVersions = 'php5;php70;php71';
|
||||
|
||||
if (file_exists(X13_IMPORT_DIR . 'dev')) {
|
||||
$x13IonVer = 'php5';
|
||||
$phpVersions = 'php5';
|
||||
}
|
||||
|
||||
define('X13_ION_IMPORT_VERSIONS', $phpVersions);
|
||||
define('X13_ION_IMPORT', $x13IonVer);
|
||||
}
|
||||
|
||||
// Autoload classes
|
||||
if (!class_exists('Psr4Autoloader')) {
|
||||
require_once(X13_IMPORT_TOOLS_DIR . 'Psr/Autoloader/Psr4Autoloader.php');
|
||||
}
|
||||
$loader = new Psr4Autoloader();
|
||||
$loader->register();
|
||||
$loader->addNamespace('x13import', $baseDir . 'classes/' . X13_ION_IMPORT . '/');
|
||||
$loader->addNamespace('Box\Spout', $baseDir . 'tools/Spout/');
|
||||
|
||||
// Autoload legacy classes
|
||||
require_once($baseDir . 'classes/' . X13_ION_IMPORT . '/XImportAutoLoader.php');
|
||||
XImportAutoLoader::getInstance()->autoload();
|
||||
Reference in New Issue
Block a user