Jump to content

Recommended Posts

Posted (edited)

Bonjour,

J'ai essayé le 1 clic upgrade que le backoffice me proposait mais maintenant je n'ai plus du tout accès à ce même backoffice et j'ai une erreur 500 à la place.

Le backoffice ne semble rien charger ! qu'est ce que je peux faire ???

Edited by Jérôme (see edit history)

Share this post


Link to post
Share on other sites

j'ai essayé de supprimer et reinstaller en ftp le module autoupgrade mais ça n'a rien changé

 

image.png.e80554d84dca69768bfff3f7e43eb105.png

Share this post


Link to post
Share on other sites

Je ne peux pas mettre le mode de débogage : je ne peux pas acceder au backoffice... Est ce qu'il y a un autre moyen ?

j'ai dû stopper toutes mes publicités 😛  je suis pas mal embêté !

Share this post


Link to post
Share on other sites

folder list of ps > config > defines.inch.php
you will see define('_PS_MODE_DEV_', false);

change false to true and save file

 

liste des dossiers de ps> config> define.inch.php
vous verrez définir ('_ PS_MODE_DEV_', false);

changer faux en vrai et enregistrer le fichier

Share this post


Link to post
Share on other sites

je suis en mode débug : quellles sont les informations que vous voulez ? j'ai réussi à rentrer dans le backoffice

Share this post


Link to post
Share on other sites

J'en suis là j'ai mis le site en mode maintenance

image.thumb.png.23af8b4744b04d4ddfed74c6ef53fc36.png

Share this post


Link to post
Share on other sites

Essayez de donner la permission complète de mettre en cache le dossier: var / cache puis partagez le résultat.

Share this post


Link to post
Share on other sites

j'ai mis en 777 tous ces dossiers :

image.png.15f97bfc635ea2b5799958e8fe6c693c.png

 

Mais rien n'y fait :

 

image.thumb.png.3eb3df9ceb5bb657564dd646faec3c9f.png

Share this post


Link to post
Share on other sites

j'ai mis tous ces dossiers en 777 mais pas de changement /home/bijouriuiz/www/var/cache/dev/smarty/compile/a9/d4/96/

Share this post


Link to post
Share on other sites

Compris. D'accord, essayons de vider le cache.
Vous pouvez essayer de supprimer class_index.php dans le dossier \ app \ cache \ dev (avec le mode dev) ou \ app \ cache \ prod
Renommez également le nom du dossier "cache" actuel dans "var" puis créez. nouveau dossier "cache".
Faites toutes les étapes et faites-le nous savoir.

Share this post


Link to post
Share on other sites

désolé mais je ne vois pas le répertoire ni le fichier dont vous parlez

image.png

Share this post


Link to post
Share on other sites

pas de souci, merci de votre patience :

j'ai ça maintnenatn
image.thumb.png.f2bfc4424872d1c80171ae80fb48e8ee.png
 

Share this post


Link to post
Share on other sites

ah attendez le fichier n'est pas créé

Share this post


Link to post
Share on other sites

Oui

<?php
/**
 * 2007-2019 PrestaShop and Contributors
 *
 * 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:
 * https://opensource.org/licenses/OSL-3.0
 * 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 license@prestashop.com 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 https://www.prestashop.com for more information.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2019 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 */

/**
 * Class PrestaShopAutoload.
 *
 * @since 1.5
 */
class PrestaShopAutoload
{
    /**
     * @var PrestaShopAutoload
     */
    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();

    public $_include_override_path = true;

    protected static $class_aliases = array(
        'Collection' => 'PrestaShopCollection',
        'Autoload' => 'PrestaShopAutoload',
        'Backup' => 'PrestaShopBackup',
        'Logger' => 'PrestaShopLogger',
    );

    protected function __construct()
    {
        $this->root_dir = _PS_CORE_DIR_ . '/';
        $file = static::getCacheFileIndex();
        $stubFile = static::getStubFileIndex();
        if (@filemtime($file) && is_readable($file) && @filemtime($stubFile) && is_readable($stubFile)) {
            $this->index = include $file;
        } else {
            $this->generateIndex();
        }
    }

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

        return static::$instance;
    }

    /**
     * Get Class index cache file.
     *
     * @return string
     */
    public static function getCacheFileIndex()
    {
        return _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . (_PS_MODE_DEV_ ? 'dev' : 'prod') . DIRECTORY_SEPARATOR . 'class_index.php';
    }

    /**
     * Get Namespaced class stub file.
     *
     * @return string
     */
    public static function getNamespacedStubFileIndex()
    {
        return _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . (_PS_MODE_DEV_ ? 'dev' : 'prod') . DIRECTORY_SEPARATOR . 'namespaced_class_stub.php';
    }

    /**
     * Get Class stub file.
     *
     * @return string
     */
    public static function getStubFileIndex()
    {
        return _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . (_PS_MODE_DEV_ ? 'dev' : 'prod') . DIRECTORY_SEPARATOR . 'class_stub.php';
    }

    /**
     * Retrieve informations about a class in classes index and load it.
     *
     * @param string $className
     */
    public function load($className)
    {
        // Retrocompatibility
        if (isset(static::$class_aliases[$className]) && !interface_exists($className, false) && !class_exists($className, false)) {
            return eval('class ' . $className . ' extends ' . static::$class_aliases[$className] . ' {}');
        }

        // regenerate the class index if the requested file doesn't exists
        if ((isset($this->index[$className]) && $this->index[$className]['path'] && !is_file($this->root_dir . $this->index[$className]['path']))
            || (isset($this->index[$className . 'Core']) && $this->index[$className . 'Core']['path'] && !is_file($this->root_dir . $this->index[$className . 'Core']['path']))
            || !file_exists(static::getNamespacedStubFileIndex())) {
            $this->generateIndex();
        }

        // If $classname has not core suffix (E.g. Shop, Product)
        if (substr($className, -4) != 'Core' && !class_exists($className, false)) {
            $classDir = (isset($this->index[$className]['override'])
                && $this->index[$className]['override'] === true) ? $this->normalizeDirectory(_PS_ROOT_DIR_) : $this->root_dir;

            // If requested class does not exist, load associated core class
            if (isset($this->index[$className]) && !$this->index[$className]['path']) {
                require_once $classDir . $this->index[$className . 'Core']['path'];

                if ($this->index[$className . 'Core']['type'] != 'interface') {
                    eval($this->index[$className . 'Core']['type'] . ' ' . $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']['path'];
                }

                if (isset($this->index[$className])) {
                    require_once $classDir . $this->index[$className]['path'];
                }
            }
        } elseif (isset($this->index[$className]['path']) && $this->index[$className]['path']) {
            // Call directly ProductCore, ShopCore class
            require_once $this->root_dir . $this->index[$className]['path'];
        }
        if (strpos($className, 'PrestaShop\PrestaShop\Adapter\Entity') !== false) {
            require_once static::getNamespacedStubFileIndex();
        }
    }

    /**
     * Generate classes index.
     */
    public function generateIndex()
    {
        if (class_exists('Configuration') && defined('_PS_CREATION_DATE_')) {
            $creationDate = _PS_CREATION_DATE_;
            if (!empty($creationDate) && Configuration::get('PS_DISABLE_OVERRIDES')) {
                $this->_include_override_path = false;
            } else {
                $this->_include_override_path = true;
            }
        }

        $coreClasses = $this->getClassesFromDir('classes/');

        $classes = array_merge(
            $coreClasses,
            $this->getClassesFromDir('controllers/')
        );

        $contentNamespacedStub = '<?php ' . "\n" . 'namespace PrestaShop\\PrestaShop\\Adapter\\Entity;' . "\n\n";

        foreach ($coreClasses as $coreClassName => $coreClass) {
            if (substr($coreClassName, -4) == 'Core') {
                $coreClassName = substr($coreClassName, 0, -4);
                if ($coreClass['type'] != 'interface') {
                    $contentNamespacedStub .= $coreClass['type'] . ' ' . $coreClassName . ' extends \\' . $coreClassName . ' {};' . "\n";
                }
            }
        }

        if ($this->_include_override_path) {
            $coreOverrideClasses = $this->getClassesFromDir('override/classes/', defined('_PS_HOST_MODE_'));
            $coreClassesWOOverrides = array_diff_key($coreClasses, $coreOverrideClasses);

            $classes = array_merge(
                $classes,
                $coreOverrideClasses,
                $this->getClassesFromDir('override/controllers/', defined('_PS_HOST_MODE_'))
            );
        } else {
            $coreClassesWOOverrides = $coreClasses;
        }

        $contentStub = '<?php' . "\n\n";

        foreach ($coreClassesWOOverrides as $coreClassName => $coreClass) {
            if (substr($coreClassName, -4) == 'Core') {
                $coreClassNameNoCore = substr($coreClassName, 0, -4);
                if ($coreClass['type'] != 'interface') {
                    $contentStub .= $coreClass['type'] . ' ' . $coreClassNameNoCore . ' extends ' . $coreClassName . ' {};' . "\n";
                }
            }
        }

        ksort($classes);
        $content = '<?php return ' . var_export($classes, true) . '; ?>';

        // Write classes index on disc to cache it
        $filename = static::getCacheFileIndex();
        @mkdir(_PS_CACHE_DIR_, 0777, true);

        if (!$this->dumpFile($filename, $content)) {
            Tools::error_log('Cannot write temporary file ' . $filename);
        }

        $stubFilename = static::getStubFileIndex();
        if (!$this->dumpFile($stubFilename, $contentStub)) {
            Tools::error_log('Cannot write temporary file ' . $stubFilename);
        }

        $namespacedStubFilename = static::getNamespacedStubFileIndex();
        if (!$this->dumpFile($namespacedStubFilename, $contentNamespacedStub)) {
            Tools::error_log('Cannot write temporary file ' . $namespacedStubFilename);
        }

        $this->index = $classes;
    }

    /**
     * @param string $filename
     * @param string $content
     *
     * @return bool
     *
     * @see http://api.symfony.com/3.0/Symfony/Component/Filesystem/Filesystem.html#method_dumpFile
     */
    public function dumpFile($filename, $content)
    {
        $dir = dirname($filename);

        // Will create a temp file with 0600 access rights
        // when the filesystem supports chmod.
        $tmpFile = tempnam($dir, basename($filename));
        if (false === @file_put_contents($tmpFile, $content)) {
            return false;
        }
        // Ignore for filesystems that do not support umask
        @chmod($tmpFile, file_exists($filename) ? fileperms($filename) : 0666 & ~umask());
        rename($tmpFile, $filename);

        return true;
    }

    /**
     * Retrieve recursively all classes in a directory and its subdirectories.
     *
     * @param string $path Relative path from root to the directory
     * @param bool $hostMode Since 1.7, deprecated.
     *
     * @return array
     */
    protected function getClassesFromDir($path, $hostMode = false)
    {
        $classes = array();
        $rootDir = $hostMode ? $this->normalizeDirectory(_PS_ROOT_DIR_) : $this->root_dir;

        foreach (scandir($rootDir . $path, SCANDIR_SORT_NONE) as $file) {
            if ($file[0] != '.') {
                if (is_dir($rootDir . $path . $file)) {
                    $classes = array_merge($classes, $this->getClassesFromDir($path . $file . '/', $hostMode));
                } elseif (substr($file, -4) == '.php') {
                    $content = file_get_contents($rootDir . $path . $file);

                    $namespacePattern = '[\\a-z0-9_]*[\\]';
                    $pattern = '#\W((abstract\s+)?class|interface)\s+(?P<classname>' . basename($file, '.php') . '(?:Core)?)'
                                . '(?:\s+extends\s+' . $namespacePattern . '[a-z][a-z0-9_]*)?(?:\s+implements\s+' . $namespacePattern . '[a-z][\\a-z0-9_]*(?:\s*,\s*' . $namespacePattern . '[a-z][\\a-z0-9_]*)*)?\s*\{#i';

                    //DONT LOAD CLASS WITH NAMESPACE - PSR4 autoloaded from composer
                    $usesNamespace = false;
                    foreach (token_get_all($content) as $token) {
                        if ($token[0] === T_NAMESPACE) {
                            $usesNamespace = true;

                            break;
                        }
                    }

                    if (!$usesNamespace && preg_match($pattern, $content, $m)) {
                        $classes[$m['classname']] = array(
                            'path' => $path . $file,
                            'type' => trim($m[1]),
                            'override' => $hostMode,
                        );

                        if (substr($m['classname'], -4) == 'Core') {
                            $classes[substr($m['classname'], 0, -4)] = array(
                                'path' => '',
                                'type' => $classes[$m['classname']]['type'],
                                'override' => $hostMode,
                            );
                        }
                    }
                }
            }
        }

        return $classes;
    }

    /**
     * Get Class path.
     *
     * @param string $classname
     */
    public function getClassPath($classname)
    {
        return (isset($this->index[$classname]['path'])) ? $this->index[$classname]['path'] : null;
    }

    /**
     * Normalize directory.
     *
     * @param string $directory
     *
     * @return string
     */
    private function normalizeDirectory($directory)
    {
        return rtrim($directory, '/\\') . DIRECTORY_SEPARATOR;
    }
}

spl_autoload_register(array(PrestaShopAutoload::getInstance(), 'load'));

 

Share this post


Link to post
Share on other sites

Si "PrestaShopAutoload.php" n'existe pas dans le dossier "classes", créez-le et patez le code de ce fichier.

Share this post


Link to post
Share on other sites

où doit se trouver ce fichier ? dans quel repertoire ?

Share this post


Link to post
Share on other sites

OK visiblement c'est ce fichier "cache" qui posait problème, j'en ai re-créé un comme vous me l'indiquiez et ça refonctionne correctement, merci beaucoup pour votre patience et votre aide !

 

Share this post


Link to post
Share on other sites

Par contre, la mise a jour n'est pas faite : je suis toujours sur 1.7.5.1 !

Share this post


Link to post
Share on other sites

Je vous ai compris et si vous avez besoin d'aide concernant la mise à niveau, nous pouvons gérer votre processus de migration à partir de zéro.

Share this post


Link to post
Share on other sites

avec plaisir ! Dites moi ce que je dois faire

image.thumb.png.21384322842c1b077217ab060a01ea58.png

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More