- 
      
- 
        Save julienbourdeau/3c870f8a515a2f1edfe1e64470541122 to your computer and use it in GitHub Desktop. 
    Regenerate images in Prestashop from command line
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| define('_PS_ROOT_DIR_', '/path/to/prestashop/root'); | |
| define('_PS_ADMIN_DIR_', _PS_ROOT_DIR_.'admin_folder'); | |
| require(_PS_ADMIN_DIR_.'/../config/config.inc.php'); | |
| require(_PS_ADMIN_DIR_.'/functions.php'); | |
| class Employee2 extends EmployeeCore | |
| { | |
| public function isSuperAdmin() | |
| { | |
| return true; | |
| } | |
| public function isLoggedBack() | |
| { | |
| return true; | |
| } | |
| } | |
| class AdminImagesController extends AdminImagesControllerCore | |
| { | |
| function regenerate() | |
| { | |
| $this->_regenerateThumbnails('all', true); | |
| } | |
| } | |
| $context = Context::getContext(); | |
| $context->employee = new Employee2(1); | |
| //print_r($context); | |
| $aic = new AdminImagesController(); | |
| echo "Starting regeneration\n"; | |
| $aic->regenerate(); | |
| echo "Done regenerating\n"; | |
| ?> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Great job!
Could you update the script for prestop 1.7.6.x?