Jump to content

plus d'accès au BO!


Recommended Posts

Bonsoir,

 

J'ai ajouter un fichier PHP "cartcontroller.php" sur mon serveur car il n'y était plus suite à la suppression du module panier. Suite à cette manip, j'ai ce message lorsque j'essaye de me connecter à mon BO :

 

Warning: require(/htdocs) [function.require]: failed to open stream: Cannot allocate memory in /htdocs/classes/Autoload.php on line 113

Warning: require(/htdocs) [function.require]: failed to open stream: Permission denied in /htdocs/classes/Autoload.php on line 113

Fatal error: require() [function.require]: Failed opening required '/htdocs/' (include_path='.:/usr/share/php:/usr/share/pear') in /htdocs/classes/Autoload.php on line 113

 

au secours, pourriez-vous m'aider, je ne peux plus accéder à mon BO!

 

Merci de votre aide,

 

Nadège :(

Link to comment
Share on other sites

Bonsoir,

 

Merci pour votre réponse, j'ai essayé d'enlever le fichier "Autoload.php" et j'ai toujours un message d'erreur. Donc, je l'ai réinstaller, j'ai un nouveau message d'erreur : Parse error: syntax error, unexpected $end in /htdocs/classes/Autoload.php on line 202

Voici le contenu du fichier Autoload.php :

 

<?php
/*
* 2007-2012 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2012 PrestaShop SA
*  @version  Release: $Revision: 17889 $
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/

/**
 * @since 1.5
 */
class Autoload
{
  /**
   * File where classes index is stored
   */
  const INDEX_FILE = 'cache/class_index.php';

  /**
   * @var Autoload
   */
  protected static $instance;

  /**
   * @var string Root directory
   */
  protected $root_dir;

  /**
   *  @var array array('classname' => 'path/to/override', 'classnamecore' => 'path/to/class/core')
   */
  public $index = array();

  protected function __construct()
  {
    $this->root_dir = dirname(dirname(__FILE__)).'/';
    if (file_exists($this->root_dir.Autoload::INDEX_FILE))
      $this->index = include($this->root_dir.Autoload::INDEX_FILE);
  }

  /**
   * Get instance of autoload (singleton)
   *
   * @return Autoload
   */
  public static function getInstance()
  {
    if (!Autoload::$instance)
      Autoload::$instance = new Autoload();

    return Autoload::$instance;
  }

  /**
   * Retrieve informations about a class in classes index and load it
   *
   * @param string $classname
   */
  public function load($classname)
  {
    // Smarty uses its own autoloader, so we exclude all Smarty classes
    if (strpos(strtolower($classname), 'smarty_') === 0)
      return;

    // regenerate the class index if the requested class is not found in the index or if the requested file doesn't exists
    if (!isset($this->index[$classname])
      || ($this->index[$classname] && !is_file($this->root_dir.$this->index[$classname]))
      || (isset($this->index[$classname.'Core']) && $this->index[$classname.'Core'] && !is_file($this->root_dir.$this->index[$classname.'Core'])))
      $this->generateIndex();

    // If $classname has not core suffix (E.g. Shop, Product)
    if (substr($classname, -4) != 'Core')
    {
      // If requested class does not exist, load associated core class
      if (isset($this->index[$classname]) && !$this->index[$classname])
      {
        require($this->root_dir.$this->index[$classname.'Core']);

        // Since the classname does not exists (we only have a classCore class), we have to emulate the declaration of this class
        $class_infos = new ReflectionClass($classname.'Core');
        eval(($class_infos->isAbstract() ? 'abstract ' : '').'class '.$classname.' extends '.$classname.'Core {}');
      }
      else
      {
        // request a non Core Class load the associated Core class if exists
        if (isset($this->index[$classname.'Core']))
          require_once($this->root_dir.$this->index[$classname.'Core']);
        if (isset($this->index[$classname]))
          require_once($this->root_dir.$this->index[$classname]);
      }
    }
    // Call directly ProductCore, ShopCore class
    else
      require($this->root_dir.$this->index[$classname]);
  }

  /**
   * Generate classes index
   */
  public function generateIndex()
  {
    $classes = array_merge(
      $this->getClassesFromDir('classes/'),
      $this->getClassesFromDir('override/classes/'),
      $this->getClassesFromDir('controllers/'),
      $this->getClassesFromDir('override/controllers/')
    );
    ksort($classes);
    $content = '<?php return '.var_export($classes, true).'; ?>';

    // Write classes index on disc to cache it
    $filename = $this->root_dir.Autoload::INDEX_FILE;
    if ((file_exists($filename) && !is_writable($filename)) || !is_writable(dirname($filename)))
      throw new PrestaShopException($filename.' is not writable, please give write permissions (chmod 666) on this file.');
    else
    {
      // Let's write index content in cache file
      // In order to be sure that this file is correctly written, a check is done on the file content
      $loop_protection = 0;
      do
      {
        $integrity_is_ok = false;
        file_put_contents($filename, $content);
        if ($loop_protection++ > 10)
          break;

        // If the file content end with PHP tag, integrity of the file is ok
        if (preg_match('#\?>\s*$#', file_get_contents($filename)))
          $integrity_is_ok = true;
      }
      while (!$integrity_is_ok);

      if (!$integrity_is_ok)
      {
        file_put_contents($filename, '<?php return array(); ?>');
        throw new PrestaShopException('Your file '.$filename.' is corrupted. Please remove this file, a new one will be regenerated automatically');
      }
    }

    $this->index = $classes;
  }

  /**
   * Retrieve recursively all classes in a directory and its subdirectories
   *
   * @param string $path Relativ path from root to the directory
   * @return array
   */
  protected function getClassesFromDir($path)
  {
    $classes = array();

    foreach (scandir($this->root_dir.$path) as $file)
    {
      if ($file[0] != '.')
      {
        if (is_dir($this->root_dir.$path.$file))
          $classes = array_merge($classes, $this->getClassesFromDir($path.$file.'/'));
        else if (substr($file, -4) == '.php')
        {
          $content = file_get_contents($this->root_dir.$path.$file);
           $pattern = '#\W((abstract\s+)?class|interface)\s+(?P<classname>'.basename($file, '.php').'(Core)?)'
                 .'(\s+extends\s+[a-z][a-z0-9_]*)?(\s+implements\s+[a-z][a-z0-9_]*(\s*,\s*[a-z][a-z0-9_]*)*)?\s*\{#i';
           if (preg_match($pattern, $content, $m))
           {
             $classes[$m['classname']] = $path.$file;
            if (substr($m['classname'], -4) == 'Core')
              $classes[substr($m['classname'], 0, -4)] = '';
           }
        }
      }
    }

    return $classes;
  }

  public function getClassPath($classname)
  {
    return isset($this->index[$classname]) ? $this->index[$classname] : null;
  }
}


Autoload.php

.

 

 

Si vous pouvez me dire quelle ligne modifiée et ce que je dois remplacer.Sinon, si vous êtes d'accord je vous envoi mes codes d'accès en MP afin que vous puissez prendre la main.

 

Merci,

 

Cordialement,

 

Nadège

Edited by Gregory Roussac (see edit history)
Link to comment
Share on other sites

Bonsoir,

 

Merci pour votre réponse, j'ai essayé d'enlever le fichier "Autoload.php" et j'ai toujours un message d'erreur. Donc, je l'ai réinstaller, j'ai un nouveau message d'erreur : Parse error: syntax error, unexpected $end in /htdocs/classes/Autoload.php on line 202

Voici le contenu du fichier Autoload.php :

 

<?php
/*
* 2007-2012 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2012 PrestaShop SA
*  @version  Release: $Revision: 17889 $
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/

/**
 * @since 1.5
 */
class Autoload
{
  /**
   * File where classes index is stored
   */
  const INDEX_FILE = 'cache/class_index.php';

  /**
   * @var Autoload
   */
  protected static $instance;

  /**
   * @var string Root directory
   */
  protected $root_dir;

  /**
   *  @var array array('classname' => 'path/to/override', 'classnamecore' => 'path/to/class/core')
   */
  public $index = array();

  protected function __construct()
  {
    $this->root_dir = dirname(dirname(__FILE__)).'/';
    if (file_exists($this->root_dir.Autoload::INDEX_FILE))
      $this->index = include($this->root_dir.Autoload::INDEX_FILE);
  }

  /**
   * Get instance of autoload (singleton)
   *
   * @return Autoload
   */
  public static function getInstance()
  {
    if (!Autoload::$instance)
      Autoload::$instance = new Autoload();

    return Autoload::$instance;
  }

  /**
   * Retrieve informations about a class in classes index and load it
   *
   * @param string $classname
   */
  public function load($classname)
  {
    // Smarty uses its own autoloader, so we exclude all Smarty classes
    if (strpos(strtolower($classname), 'smarty_') === 0)
      return;

    // regenerate the class index if the requested class is not found in the index or if the requested file doesn't exists
    if (!isset($this->index[$classname])
      || ($this->index[$classname] && !is_file($this->root_dir.$this->index[$classname]))
      || (isset($this->index[$classname.'Core']) && $this->index[$classname.'Core'] && !is_file($this->root_dir.$this->index[$classname.'Core'])))
      $this->generateIndex();

    // If $classname has not core suffix (E.g. Shop, Product)
    if (substr($classname, -4) != 'Core')
    {
      // If requested class does not exist, load associated core class
      if (isset($this->index[$classname]) && !$this->index[$classname])
      {
        require($this->root_dir.$this->index[$classname.'Core']);

        // Since the classname does not exists (we only have a classCore class), we have to emulate the declaration of this class
        $class_infos = new ReflectionClass($classname.'Core');
        eval(($class_infos->isAbstract() ? 'abstract ' : '').'class '.$classname.' extends '.$classname.'Core {}');
      }
      else
      {
        // request a non Core Class load the associated Core class if exists
        if (isset($this->index[$classname.'Core']))
          require_once($this->root_dir.$this->index[$classname.'Core']);
        if (isset($this->index[$classname]))
          require_once($this->root_dir.$this->index[$classname]);
      }
    }
    // Call directly ProductCore, ShopCore class
    else
      require($this->root_dir.$this->index[$classname]);
  }

  /**
   * Generate classes index
   */
  public function generateIndex()
  {
    $classes = array_merge(
      $this->getClassesFromDir('classes/'),
      $this->getClassesFromDir('override/classes/'),
      $this->getClassesFromDir('controllers/'),
      $this->getClassesFromDir('override/controllers/')
    );
    ksort($classes);
    $content = '<?php return '.var_export($classes, true).'; ?>';

    // Write classes index on disc to cache it
    $filename = $this->root_dir.Autoload::INDEX_FILE;
    if ((file_exists($filename) && !is_writable($filename)) || !is_writable(dirname($filename)))
      throw new PrestaShopException($filename.' is not writable, please give write permissions (chmod 666) on this file.');
    else
    {
      // Let's write index content in cache file
      // In order to be sure that this file is correctly written, a check is done on the file content
      $loop_protection = 0;
      do
      {
        $integrity_is_ok = false;
        file_put_contents($filename, $content);
        if ($loop_protection++ > 10)
          break;

        // If the file content end with PHP tag, integrity of the file is ok
        if (preg_match('#\?>\s*$#', file_get_contents($filename)))
          $integrity_is_ok = true;
      }
      while (!$integrity_is_ok);

      if (!$integrity_is_ok)
      {
        file_put_contents($filename, '<?php return array(); ?>');
        throw new PrestaShopException('Your file '.$filename.' is corrupted. Please remove this file, a new one will be regenerated automatically');
      }
    }

    $this->index = $classes;
  }

  /**
   * Retrieve recursively all classes in a directory and its subdirectories
   *
   * @param string $path Relativ path from root to the directory
   * @return array
   */
  protected function getClassesFromDir($path)
  {
    $classes = array();

    foreach (scandir($this->root_dir.$path) as $file)
    {
      if ($file[0] != '.')
      {
        if (is_dir($this->root_dir.$path.$file))
          $classes = array_merge($classes, $this->getClassesFromDir($path.$file.'/'));
        else if (substr($file, -4) == '.php')
        {
          $content = file_get_contents($this->root_dir.$path.$file);
           $pattern = '#\W((abstract\s+)?class|interface)\s+(?P<classname>'.basename($file, '.php').'(Core)?)'
                 .'(\s+extends\s+[a-z][a-z0-9_]*)?(\s+implements\s+[a-z][a-z0-9_]*(\s*,\s*[a-z][a-z0-9_]*)*)?\s*\{#i';
           if (preg_match($pattern, $content, $m))
           {
             $classes[$m['classname']] = $path.$file;
            if (substr($m['classname'], -4) == 'Core')
              $classes[substr($m['classname'], 0, -4)] = '';
           }
        }
      }
    }

    return $classes;
  }

  public function getClassPath($classname)
  {
    return isset($this->index[$classname]) ? $this->index[$classname] : null;
  }
}


Autoload.php

.

 

 

Si vous pouvez me dire quelle ligne modifiée et ce que je dois remplacer.Sinon, si vous êtes d'accord je vous envoi mes codes d'accès en MP afin que vous puissez prendre la main.

 

Merci,

 

Cordialement,

 

Nadège

bonjour

avez vous contrôler via votre ftp les permission des dossier et fichier?

 

cordialement.

Link to comment
Share on other sites

Bonsoir,

 

Pour répondre d'abord à Grégory, j'ai réinstaller le fichier cartcontroller :


Cela ne fonctionne toujours pas, j'en ai marre...Il faut savoir que le problème est apparu quand j'ai installé un module acheté "blockpopcart". suite au chargement de ce module, je ne pouvois plus ouvrir mon panier, il faut dire que je fait l'erreur de supprimer le module natif "panier".Je suis nulle...

Pourrier-vous m'aider à résoudre mes bêtises, si je vous laisse mes codes d'accès par MP parce que là je n'y arrive plus...plus de BO et FO. La totale!

 

Merci par avance,

 

Je vous souhaite en tout cas un TRES BON REVEILLON ET UNE BONNE ANNE 2014!

 

Cordialement,

 

Nadège :)

Link to comment
Share on other sites

Bonjour,

 

J'ai oublié de mettre correctement le fichier cartcontroller:


Rien n'y fait, j'ai toujours le message d'erreur.Si une bone âme pouvois prendre la main sur mon serveur en MP je le paierais en conséquence car je n'ai absolument plus ni de BO ni de FO.

 

Dans l'attente que quelqu'un veuille bien m'aider,

 

Nadège

Bonne anné 2014 ;)

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...