ColonelMoutarde Posted February 27, 2015 Share Posted February 27, 2015 (edited) Hello,I would use to compser with prestashop 1.6.Install composer is not difficult, but where to add the call to autoload benefit namespace ? require_once "vendor/autoload.php"; How do you do? Edited February 27, 2015 by ColonelMoutarde (see edit history) Link to comment Share on other sites More sharing options...
acusti Posted April 24, 2015 Share Posted April 24, 2015 (edited) There are a number of ways you could do that. One that I think makes a lot of sense is to require Composer’s autoload file from the primary PrestaShop Controller abstract class, which is inherited by all other controllers. Here’s how to do so: Create a file named Controller.php in override/classes/controller/ Paste this code into that file: <?php /* * Override the main Controller abstract class to require Composer's autoload file * Makes Composer packages available to your entire PrestaShop install */ abstract class Controller extends ControllerCore { public function __construct() { // Load Composer vendor packages require _PS_ROOT_DIR_ . '/vendor/autoload.php'; parent::__construct(); } } Note: after saving the override, make sure to delete the class cache file, located at cache/class_index.php . Edited April 24, 2015 by acusti (see edit history) 1 Link to comment Share on other sites More sharing options...
ColonelMoutarde Posted April 27, 2015 Author Share Posted April 27, 2015 Thanx, i'test this ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now