I have a script with cURL to initiate other script that import products and categories in prestashop.
This is the script which start with cURL:
define('_PS_ADMIN_DIR_', getcwd());
include_once(_PS_ADMIN_DIR_.'/../config/config.inc.php');
include_once(_PS_ADMIN_DIR_.'/../config/defines.inc.php');
include_once(_PS_ADMIN_DIR_.'/functions.php');
include_once dirname(__FILE__).'/../controllers/admin/AdminImportController.php';
if (!isset($_GET['entity'])) die();
$import = New AdminImportController();
switch ($_GET['entity']) {
case 0:
loadCategoriesPost();
$import->categoryImport();
break;
case 1:
loadProductsPost();
$import->productImport();
break;
}
My problem is that the seconds script generate an error from "include_once dirname(FILE).'/../controllers/admin/AdminImportController.php';":
PHP Fatal error: Cannot redeclare class AdminImportControllerCore in...
I have tried to use include_once, DIR, also I looked for in that included files a line with "new AdminImportController();" but I don't found nothing.
Thanks!