Postado Novembro 16, 2021 3 anos Boa noite, Estou utilizando uma versão do Gesior e estou enfrentando um erro que para mim é totalmente desconhecido... Já tentei consertar isso de todas as formas e até agora, não consegui... Segue o erro: Citar Parse error: syntax error, unexpected '{', expecting ';' in /var/www/html/classes/configlua.php(56) : eval()'d code on line 1 Segue o código do meu configlua.php Mostrar conteúdo oculto <?php if(!defined('INITIALIZED')) exit; class ConfigLUA extends Errors // NOT SAFE CLASS, LUA CONFIG CAN BE EXECUTED AS PHP CODE { private $config; public function __construct($path = false) { if($path) $this->loadFromFile($path); } public function loadFromFile($path) { if(Website::fileExists($path)) { $content = Website::getFileContents($path); $this->loadFromString($content); } else { new Error_Critic('#C-2', 'ERROR: <b>#C-2</b> : Class::ConfigLUA - LUA config file doesn\'t exist. Path: <b>' . $path . '</b>'); } } public function fileExists($path) { return Website::fileExists($path); } public function loadFromString($string) { $lines = explode("\n", $string); if(count($lines) > 0) foreach($lines as $ln => $line) { $tmp_exp = explode('=', $line, 2); if(count($tmp_exp) >= 2) { $key = trim($tmp_exp[0]); if(substr($key, 0, 2) != '--') { $value = trim($tmp_exp[1]); if(is_numeric($value)) $this->config[ $key ] = (float) $value; elseif(in_array(substr($value, 0 , 1), array("'", '"')) && in_array(substr($value, -1 , 1), array("'", '"'))) $this->config[ $key ] = (string) substr(substr($value, 1), 0, -1); elseif(in_array($value, array('true', 'false'))) $this->config[ $key ] = ($value == 'true') ? true : false; else { foreach($this->config as $tmp_key => $tmp_value) // load values definied by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull $value = str_replace($tmp_key, $tmp_value, $value); $ret = @eval("return $value;"); if((string) $ret == '') // = parser error { new Error_Critic('', 'ERROR: <b>#C-1</b> : Class::ConfigLUA - Line <b>' . ($ln + 1) . '</b> of LUA config file is not valid [key: <b>' . $key . '</b>]'); } $this->config[ $key ] = $ret; } } } } } public function getValue($key) { if(isset($this->config[ $key ])) return $this->config[ $key ]; else new Error_Critic('#C-3', 'ERROR: <b>#C-3</b> : Class::ConfigLUA - Key <b>' . $key . '</b> doesn\'t exist.'); } public function isSetKey($key) { return isset($this->config[ $key ]); } public function getConfig() { return $this->config; } } Espero que alguém consiga me ajudar. Fico no aguardo.
Postado Novembro 17, 2021 3 anos troca o configlua.php por esse, no meu caso mostrou o erro. Mostrar conteúdo oculto <?php if(!defined('INITIALIZED')) exit; class ConfigLUA extends Errors // NOT SAFE CLASS, LUA CONFIG CAN BE EXECUTED AS PHP CODE { private $config; public function __construct($path = false) { if($path) $this->loadFromFile($path); } public function loadFromFile($path) { if(Website::fileExists($path)) { $content = Website::getFileContents($path); $this->loadFromString($content); } else { new Error_Critic('#C-2', 'ERROR: <b>#C-2</b> : Class::ConfigLUA - LUA config file doesn\'t exist. Path: <b>' . $path . '</b>'); } } public function fileExists($path) { return Website::fileExists($path); } public function loadFromString($string) { $lines = explode("\n", $string); if(count($lines) > 0) foreach($lines as $ln => $line) { $tmp_exp = explode('=', $line, 2); if(count($tmp_exp) >= 2) { $key = trim($tmp_exp[0]); if(substr($key, 0, 2) != '--') { $value = trim($tmp_exp[1]); if(is_numeric($value)) $this->config[ $key ] = (float) $value; elseif(in_array(substr($value, 0 , 1), array("'", '"')) && in_array(substr($value, -1 , 1), array("'", '"'))) $this->config[ $key ] = (string) substr(substr($value, 1), 0, -1); elseif(in_array($value, array('true', 'false'))) $this->config[ $key ] = ($value == 'true') ? true : false; else { foreach($this->config as $tmp_key => $tmp_value) // load values definied by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull $value = str_replace($tmp_key, $tmp_value, $value); $ret = ${'return '. $value}; if((string) $ret == '') // = parser error { new Error_Critic('', 'ERROR: <b>#C-1</b> : Class::ConfigLUA - Line <b>' . ($ln + 1) . '</b> of LUA config file is not valid [key: <b>' . $key . '</b>]'); } $this->config[ $key ] = $ret; } } } } } public function getValue($key) { if(isset($this->config[ $key ])) return $this->config[ $key ]; else new Error_Critic('#C-3', 'ERROR: <b>#C-3</b> : Class::ConfigLUA - Key <b>' . $key . '</b> doesn\'t exist.'); } public function isSetKey($key) { return isset($this->config[ $key ]); } public function getConfig() { return $this->config; } } creditos: @Celulose
Postado Novembro 18, 2021 3 anos testa ai <?php if(!defined('INITIALIZED')){ exit; } class ConfigLUA extends Errors{ private $config; public function __construct($path = false) { if($path) $this->loadFromFile($path); } public function loadFromFile($path) { if(Website::fileExists($path)) { $content = Website::getFileContents($path); $this->loadFromString($content); } else { new Error_Critic('#C-2', 'ERROR: <b>#C-2</b> : Class::ConfigLUA - LUA config file doesn\'t exist. Path: <b>' . $path . '</b>'); } } public function fileExists($path) { return Website::fileExists($path); } public function loadFromString($string) { $lines = explode("\n", $string); if(count($lines) > 0) foreach($lines as $ln => $line) { $tmp_exp = explode('=', $line, 2); if(count($tmp_exp) >= 2) { $key = trim($tmp_exp[0]); if(substr($key, 0, 2) != '--') { $value = trim($tmp_exp[1]); if(is_numeric($value)) $this->config[ $key ] = (float) $value; elseif(in_array(substr($value, 0 , 1), array("'", '"')) && in_array(substr($value, -1 , 1), array("'", '"'))) $this->config[ $key ] = (string) substr(substr($value, 1), 0, -1); elseif(in_array($value, array('true', 'false'))) $this->config[ $key ] = ($value == 'true') ? true : false; else { foreach($this->config as $tmp_key => $tmp_value) // load values definied by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull $value = str_replace($tmp_key, $tmp_value, $value); $ret = @eval("return $value;"); if((string) $ret == '') // = parser error { new Error_Critic('', 'ERROR: <b>#C-1</b> : Class::ConfigLUA - Line <b>' . ($ln + 1) . '</b> of LUA config file is not valid [key: <b>' . $key . '</b>]'); } $this->config[ $key ] = $ret; } } } } } public function getValue($key) { if(isset($this->config[ $key ])) return $this->config[ $key ]; else new Error_Critic('#C-3', 'ERROR: <b>#C-3</b> : Class::ConfigLUA - Key <b>' . $key . '</b> doesn\'t exist.'); } public function isSetKey($key) { return isset($this->config[ $key ]); } public function getConfig() { return $this->config; } } Projeto Nto Myth " Eu to disposto a lutar e que se foda todo mundo que duvida que eu vou tocar o terror na porra toda! "
Postado Novembro 18, 2021 3 anos Autor Em 17/11/2021 em 17:13, Apache disse: troca o configlua.php por esse, no meu caso mostrou o erro. Mostrar conteúdo oculto Mostrar conteúdo oculto <?php if(!defined('INITIALIZED')) exit; class ConfigLUA extends Errors // NOT SAFE CLASS, LUA CONFIG CAN BE EXECUTED AS PHP CODE { private $config; public function __construct($path = false) { if($path) $this->loadFromFile($path); } public function loadFromFile($path) { if(Website::fileExists($path)) { $content = Website::getFileContents($path); $this->loadFromString($content); } else { new Error_Critic('#C-2', 'ERROR: <b>#C-2</b> : Class::ConfigLUA - LUA config file doesn\'t exist. Path: <b>' . $path . '</b>'); } } public function fileExists($path) { return Website::fileExists($path); } public function loadFromString($string) { $lines = explode("\n", $string); if(count($lines) > 0) foreach($lines as $ln => $line) { $tmp_exp = explode('=', $line, 2); if(count($tmp_exp) >= 2) { $key = trim($tmp_exp[0]); if(substr($key, 0, 2) != '--') { $value = trim($tmp_exp[1]); if(is_numeric($value)) $this->config[ $key ] = (float) $value; elseif(in_array(substr($value, 0 , 1), array("'", '"')) && in_array(substr($value, -1 , 1), array("'", '"'))) $this->config[ $key ] = (string) substr(substr($value, 1), 0, -1); elseif(in_array($value, array('true', 'false'))) $this->config[ $key ] = ($value == 'true') ? true : false; else { foreach($this->config as $tmp_key => $tmp_value) // load values definied by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull $value = str_replace($tmp_key, $tmp_value, $value); $ret = ${'return '. $value}; if((string) $ret == '') // = parser error { new Error_Critic('', 'ERROR: <b>#C-1</b> : Class::ConfigLUA - Line <b>' . ($ln + 1) . '</b> of LUA config file is not valid [key: <b>' . $key . '</b>]'); } $this->config[ $key ] = $ret; } } } } } public function getValue($key) { if(isset($this->config[ $key ])) return $this->config[ $key ]; else new Error_Critic('#C-3', 'ERROR: <b>#C-3</b> : Class::ConfigLUA - Key <b>' . $key . '</b> doesn\'t exist.'); } public function isSetKey($key) { return isset($this->config[ $key ]); } public function getConfig() { return $this->config; } } creditos: @Celulose Bom dia amigão, Infelizmente agora está retornando este erro: Citar Fatal error: Uncaught Error: Class 'ConfigPHP' not found in /var/www/html/classes/website.php:47 Stack trace: #0 /var/www/html/classes/website.php(55): Website::loadWebsiteConfig() #1 /var/www/html/system/load.init.php(22): Website::getWebsiteConfig() #2 /var/www/html/index.php(21): include_once('/var/www/html/s...') #3 {main} thrown in /var/www/html/classes/website.php on line 47 Em 18/11/2021 em 12:03, Hokograma disse: testa ai <?php if(!defined('INITIALIZED')){ exit; } class ConfigLUA extends Errors{ private $config; public function __construct($path = false) { if($path) $this->loadFromFile($path); } public function loadFromFile($path) { if(Website::fileExists($path)) { $content = Website::getFileContents($path); $this->loadFromString($content); } else { new Error_Critic('#C-2', 'ERROR: <b>#C-2</b> : Class::ConfigLUA - LUA config file doesn\'t exist. Path: <b>' . $path . '</b>'); } } public function fileExists($path) { return Website::fileExists($path); } public function loadFromString($string) { $lines = explode("\n", $string); if(count($lines) > 0) foreach($lines as $ln => $line) { $tmp_exp = explode('=', $line, 2); if(count($tmp_exp) >= 2) { $key = trim($tmp_exp[0]); if(substr($key, 0, 2) != '--') { $value = trim($tmp_exp[1]); if(is_numeric($value)) $this->config[ $key ] = (float) $value; elseif(in_array(substr($value, 0 , 1), array("'", '"')) && in_array(substr($value, -1 , 1), array("'", '"'))) $this->config[ $key ] = (string) substr(substr($value, 1), 0, -1); elseif(in_array($value, array('true', 'false'))) $this->config[ $key ] = ($value == 'true') ? true : false; else { foreach($this->config as $tmp_key => $tmp_value) // load values definied by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull $value = str_replace($tmp_key, $tmp_value, $value); $ret = @eval("return $value;"); if((string) $ret == '') // = parser error { new Error_Critic('', 'ERROR: <b>#C-1</b> : Class::ConfigLUA - Line <b>' . ($ln + 1) . '</b> of LUA config file is not valid [key: <b>' . $key . '</b>]'); } $this->config[ $key ] = $ret; } } } } } public function getValue($key) { if(isset($this->config[ $key ])) return $this->config[ $key ]; else new Error_Critic('#C-3', 'ERROR: <b>#C-3</b> : Class::ConfigLUA - Key <b>' . $key . '</b> doesn\'t exist.'); } public function isSetKey($key) { return isset($this->config[ $key ]); } public function getConfig() { return $this->config; } } Infelizmente o mesmo erro acima ocorreu usando o seu
Postado Novembro 25, 2021 3 anos Em 18/11/2021 em 13:26, jaksFischer disse: Bom dia amigão, Infelizmente agora está retornando este erro: Infelizmente o mesmo erro acima ocorreu usando o seu infelizmente n sei proceder, comigo mostrou o erro que era e arrumei, você pode tentar vendo as logs tbm, se for linux é var/log
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.