Nouveau WRInaute
Bonjour a tous,
J'ai un site de i-commerce sous prestashop depuis 7 ans et depuis quelques jours, je n'y ai plus accès
Une fois connecté, j'ai une page blanche. J'ai activé le mode debug et j'ai le texte suivant.
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/marquelffg/www/modules/autoupgrade/classes/UpgradeTools/Translator.php on line 41
Je comprends bien que j'ai un soucis dans le fichier Translator ligne 41 mais je n'ai aucune notion de programmation.. j'aurais besoin d'aide !
.
Merci d'avance. ci dessous la page Translator de mon site
namespace PrestaShop\Module\AutoUpgrade\UpgradeTools;
class Translator
{
private $caller;
public function __construct($caller)
{
$this->caller = $caller;
}
public function trans($id, array $parameters = array(), $domain = null, $locale = null)
{
if (method_exists(\Context::class, 'getTranslator')) {
return \Context::getContext()->getTranslator()->trans($id, $parameters, $domain, $locale);
}
if (method_exists(\Translate::class, 'getModuleTranslation')) {
$translated = \Translate::getModuleTranslation('autoupgrade', $id, $this->caller, null);
if (!count($parameters)) {
return $translated;
}
} else {
$translated = $id;
}
return $this->applyParameters($translated, $parameters);
}
/**
* @param string $id
* @param array $parameters
*
* @Return string Translated string with parameters applied
*
* @internal Public for tests
*/
public function applyParameters($id, array $parameters = array())
{
// Replace placeholders for non numeric keys
foreach ($parameters as $placeholder => $value) {
if (is_int($placeholder)) {
continue;
}
$id = str_replace($placeholder, $value, $id);
unset($parameters[$placeholder]);
}
return call_user_func_array('sprintf', array_merge(array($id), $parameters));
}
}
J'ai un site de i-commerce sous prestashop depuis 7 ans et depuis quelques jours, je n'y ai plus accès
Une fois connecté, j'ai une page blanche. J'ai activé le mode debug et j'ai le texte suivant.
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/marquelffg/www/modules/autoupgrade/classes/UpgradeTools/Translator.php on line 41
Je comprends bien que j'ai un soucis dans le fichier Translator ligne 41 mais je n'ai aucune notion de programmation.. j'aurais besoin d'aide !

Merci d'avance. ci dessous la page Translator de mon site
namespace PrestaShop\Module\AutoUpgrade\UpgradeTools;
class Translator
{
private $caller;
public function __construct($caller)
{
$this->caller = $caller;
}
public function trans($id, array $parameters = array(), $domain = null, $locale = null)
{
if (method_exists(\Context::class, 'getTranslator')) {
return \Context::getContext()->getTranslator()->trans($id, $parameters, $domain, $locale);
}
if (method_exists(\Translate::class, 'getModuleTranslation')) {
$translated = \Translate::getModuleTranslation('autoupgrade', $id, $this->caller, null);
if (!count($parameters)) {
return $translated;
}
} else {
$translated = $id;
}
return $this->applyParameters($translated, $parameters);
}
/**
* @param string $id
* @param array $parameters
*
* @Return string Translated string with parameters applied
*
* @internal Public for tests
*/
public function applyParameters($id, array $parameters = array())
{
// Replace placeholders for non numeric keys
foreach ($parameters as $placeholder => $value) {
if (is_int($placeholder)) {
continue;
}
$id = str_replace($placeholder, $value, $id);
unset($parameters[$placeholder]);
}
return call_user_func_array('sprintf', array_merge(array($id), $parameters));
}
}