Jump to content

product CVS import of multiple files.


mbartoletti

Recommended Posts

Hello,

 

i'm tring to develop an automatic script for a friend of mine. I need to perform the import, via CVS, of multiple files i would like to create an external script that upon the existence of the csv files trigger the import. I do not like to access directly the dB so i'm tring to use the Prestashop (1.5) available function. my problem is that every thing i do i have the error message AdminController class not found. Here below the head of my script:

 

/* configuration start */
error_reporting(E_ALL);
ini_set('display_errors', '1');

define('_MY_BIN_DIR_', getcwd());
define ('_PRESTA_ROOT_DIR_', _MY_BIN_DIR_.'/../prestashop');
/* configuration end */
error_log(" ### Before require.", 0);
//require(_PRESTA_ROOT_DIR_.'/config/config.inc.php');
//require_once(_PRESTA_ROOT_DIR_.'/config/defines.inc.php');
require_once(_PRESTA_ROOT_DIR_.'/cache/class_index.php');
require_once(_PRESTA_ROOT_DIR_.'/admin0/functions.php');
require_once(_PRESTA_ROOT_DIR_.'/classes/controller/Controller.php');
require_once(_PRESTA_ROOT_DIR_.'/tools/profiling/Controller.php');
require_once(_PRESTA_ROOT_DIR_.'/classes/ControllerFactory.php');
require_once(_PRESTA_ROOT_DIR_.'/classes/controller/AdminController.php');
require_once(_PRESTA_ROOT_DIR_.'/classes/controller/ModuleAdminController.php');
require_once(_PRESTA_ROOT_DIR_.'/controllers/admin/AdminHomeController.php');
require_once(_PRESTA_ROOT_DIR_.'/controllers/admin/AdminImportController.php');
error_log(" ### After require.", 0);
$import = New AdminImportController();

 

As soons as the php read the require line with the AdminImportController.php the error is show ?

 

have someone an idea on how to solve it ?

 

thanks a lot

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...