$var); } } } function retiraCaracteresInseguros($parametro){ /* " (aspas duplas) ' (aspas simples) (espaços) ; (ponto e vírgula) = (sinal de igual) < (sinal de menor que) > (sinal de maior que) ! (ponto de exclamação) -- (dois hifens, indica início de comentário em alguns bancos) # (sustenido ou jogo-da-velha, indica início de comentário em alguns bancos) // (duas barras, indica início de comentário em alguns bancos) */ $caracter[] = "--"; $caracter[] = "#"; $caracter[] = "//"; $caracter[] = "'"; $substituir[] = ""; $substituir[] = ""; $substituir[] = ""; $substituir[] = "`"; /* $substituir[] = '"'; $substituir[] = "'"; //$substituir[] = " "; $substituir[] = ";"; $substituir[] = "="; $substituir[] = "<"; $substituir[] = ">"; $substituir[] = "!"; $substituir[] = "--"; $substituir[] = "#"; $substituir[] = ""; $substituir[] = "//";*/ $param = str_replace($caracter, $substituir, $parametro); return ($param); } if (is_array($_REQUEST)){ retiraCaracteresInsegurosRecursivo($_REQUEST); retiraCaracteresInsegurosRecursivo($_GET); retiraCaracteresInsegurosRecursivo($_POST); } ?> 'aless3.mysql.dbaas.com.br', 'db' => 'aless3', 'username' => 'aless3', 'password' => 'aless32020', );*/ $db = array( 'host' => 'localhost', 'db' => 'colegio21', 'username' => 'root', 'password' => '1mperatr1z', ); ?> _routes; } public function setRoutes($routes){ $this->_routes = $routes; } public function getCurrentRoute(){ $request_array = explode('?',$_SERVER['REQUEST_URI']); return str_replace($this->getBaseUrl().'/', '',$request_array[0]); } public function getScriptUrl(){ if($this->_scriptUrl===null) { $scriptName=basename($_SERVER['SCRIPT_FILENAME']); if(basename($_SERVER['SCRIPT_NAME'])===$scriptName) $this->_scriptUrl=$_SERVER['SCRIPT_NAME']; elseif(basename($_SERVER['PHP_SELF'])===$scriptName) $this->_scriptUrl=$_SERVER['PHP_SELF']; elseif(isset($_SERVER['ORIG_SCRIPT_NAME']) && basename($_SERVER['ORIG_SCRIPT_NAME'])===$scriptName) $this->_scriptUrl=$_SERVER['ORIG_SCRIPT_NAME']; elseif(($pos=strpos($_SERVER['PHP_SELF'],'/'.$scriptName))!==false) $this->_scriptUrl=substr($_SERVER['SCRIPT_NAME'],0,$pos).'/'.$scriptName; elseif(isset($_SERVER['DOCUMENT_ROOT']) && strpos($_SERVER['SCRIPT_FILENAME'],$_SERVER['DOCUMENT_ROOT'])===0) $this->_scriptUrl=str_replace('\\','/',str_replace($_SERVER['DOCUMENT_ROOT'],'',$_SERVER['SCRIPT_FILENAME'])); else throw new CException(Yii::t('yii','CHttpRequest is unable to determine the entry script URL.')); } return $this->_scriptUrl; } public function getBaseUrl($absolute = false){ if($absolute){ $url .= $this->getHostInfo(); } $url .= rtrim(dirname($this->getScriptUrl()),'\\/'); return $url; } public function getUri(){ $dir = explode("/",$_SERVER['PHP_SELF']); array_pop($dir); return str_replace(implode("/",$dir),"",current(explode("?",$_SERVER['REQUEST_URI']))); } public function getHostInfo($schema=''){ if($this->_hostInfo===null) { if($secure=$this->getIsSecureConnection()) $http='https'; else $http='http'; if(isset($_SERVER['HTTP_HOST'])) $this->_hostInfo=$http.'://'.$_SERVER['HTTP_HOST']; else { $this->_hostInfo=$http.'://'.$_SERVER['SERVER_NAME']; $port=$secure ? $this->getSecurePort() : $this->getPort(); if(($port!==80 && !$secure) || ($port!==443 && $secure)) $this->_hostInfo.=':'.$port; } } if($schema!=='') { $secure=$this->getIsSecureConnection(); if($secure && $schema==='https' || !$secure && $schema==='http') return $this->_hostInfo; $port=$schema==='https' ? $this->getSecurePort() : $this->getPort(); if($port!==80 && $schema==='http' || $port!==443 && $schema==='https') $port=':'.$port; else $port=''; $pos=strpos($this->_hostInfo,':'); return $schema.substr($this->_hostInfo,$pos,strcspn($this->_hostInfo,':',$pos+1)+1).$port; } else return $this->_hostInfo; } public function getIsSecureConnection(){ return !empty($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'],'off'); } public function defineRoute(){ define('URI',str_replace('/novo', '', $this->getUri())); $rotas = $this->getRoutes(); $get = json_decode( json_encode($_GET), true); foreach($rotas as $pcre=>$app){ if(preg_match("@^{$pcre}$@",URI,$get)){ unset($get[0]); $_GET = array_merge($get,$_GET); if(file_exists($app)){ return array( 'status' => true, 'file' => $app, ); } else $error = 'arquivo inexistente'; } else{ $error = 'rota inexistente'; } } return array( 'status' => false, 'error' => $error, ); } public function run($routes){ $this->setRoutes($routes); $return = $this->defineRoute(); $require_file = "404.php"; if($return['status'] && is_file($return['file'])){ $require_file = $return['file']; } if(is_array($this->globals)){ foreach($this->globals as $name => $global){ $$name = $global; } } if(!empty($_GET['ajax_nocache'])){ ob_start(); require_once($require_file); $html = ob_get_clean(); Utf8::encode($html); echo $html; exit; } require_once($require_file); exit; } } ?> _routes; } public function setRoutes($routes){ $this->_routes = $routes; } public function getCurrentRoute(){ $request_array = explode('?',$_SERVER['REQUEST_URI']); return str_replace($this->getBaseUrl().'/', '',$request_array[0]); } public function getScriptUrl(){ if($this->_scriptUrl===null) { $scriptName=basename($_SERVER['SCRIPT_FILENAME']); if(basename($_SERVER['SCRIPT_NAME'])===$scriptName) $this->_scriptUrl=$_SERVER['SCRIPT_NAME']; elseif(basename($_SERVER['PHP_SELF'])===$scriptName) $this->_scriptUrl=$_SERVER['PHP_SELF']; elseif(isset($_SERVER['ORIG_SCRIPT_NAME']) && basename($_SERVER['ORIG_SCRIPT_NAME'])===$scriptName) $this->_scriptUrl=$_SERVER['ORIG_SCRIPT_NAME']; elseif(($pos=strpos($_SERVER['PHP_SELF'],'/'.$scriptName))!==false) $this->_scriptUrl=substr($_SERVER['SCRIPT_NAME'],0,$pos).'/'.$scriptName; elseif(isset($_SERVER['DOCUMENT_ROOT']) && strpos($_SERVER['SCRIPT_FILENAME'],$_SERVER['DOCUMENT_ROOT'])===0) $this->_scriptUrl=str_replace('\\','/',str_replace($_SERVER['DOCUMENT_ROOT'],'',$_SERVER['SCRIPT_FILENAME'])); else throw new CException(Yii::t('yii','CHttpRequest is unable to determine the entry script URL.')); } return $this->_scriptUrl; } public function getBaseUrl($absolute = false){ if($absolute){ $url .= $this->getHostInfo(); } $url .= rtrim(dirname($this->getScriptUrl()),'\\/'); return $url; } public function getUri(){ $dir = explode("/",$_SERVER['PHP_SELF']); array_pop($dir); return str_replace(implode("/",$dir),"",current(explode("?",$_SERVER['REQUEST_URI']))); } public function getHostInfo($schema=''){ if($this->_hostInfo===null) { if($secure=$this->getIsSecureConnection()) $http='https'; else $http='http'; if(isset($_SERVER['HTTP_HOST'])) $this->_hostInfo=$http.'://'.$_SERVER['HTTP_HOST']; else { $this->_hostInfo=$http.'://'.$_SERVER['SERVER_NAME']; $port=$secure ? $this->getSecurePort() : $this->getPort(); if(($port!==80 && !$secure) || ($port!==443 && $secure)) $this->_hostInfo.=':'.$port; } } if($schema!=='') { $secure=$this->getIsSecureConnection(); if($secure && $schema==='https' || !$secure && $schema==='http') return $this->_hostInfo; $port=$schema==='https' ? $this->getSecurePort() : $this->getPort(); if($port!==80 && $schema==='http' || $port!==443 && $schema==='https') $port=':'.$port; else $port=''; $pos=strpos($this->_hostInfo,':'); return $schema.substr($this->_hostInfo,$pos,strcspn($this->_hostInfo,':',$pos+1)+1).$port; } else return $this->_hostInfo; } public function getIsSecureConnection(){ return !empty($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'],'off'); } public function defineRoute(){ define('URI',str_replace('/novo', '', $this->getUri())); $rotas = $this->getRoutes(); $get = json_decode( json_encode($_GET), true); foreach($rotas as $pcre=>$app){ if(preg_match("@^{$pcre}$@",URI,$get)){ unset($get[0]); $_GET = array_merge($get,$_GET); if(file_exists($app)){ return array( 'status' => true, 'file' => $app, ); } else $error = 'arquivo inexistente'; } else{ $error = 'rota inexistente'; } } return array( 'status' => false, 'error' => $error, ); } public function run($routes){ $this->setRoutes($routes); $return = $this->defineRoute(); $require_file = "404.php"; if($return['status'] && is_file($return['file'])){ $require_file = $return['file']; } if(is_array($this->globals)){ foreach($this->globals as $name => $global){ $$name = $global; } } if(!empty($_GET['ajax_nocache'])){ ob_start(); require_once($require_file); $html = ob_get_clean(); Utf8::encode($html); echo $html; exit; } require_once($require_file); exit; } } ?> Error

Error

Class 'RequestManager' not found

/srv/www/htdocs/www.colegioimperatriz.net.br/index.php(65)

53 
54     '/noticias'=>'noticias.php',
55     '/noticias/(?P<pagina>\d+)'=>'noticias.php',
56     '/noticia/(?P<idnoticia>\d+)/(?P<tit>\S+)'=>'noticia-exibe.php',
57     '/galerias'=>'galerias.php',
58     '/galerias/(?P<pagina>\d+)'=>'galerias.php',
59     '/galeria/(?P<idgaleria>\d+)/(?P<tit>\S+)'=>'galeria-exibe.php',
60     '/contato'=>'form_contato.php',
61     '/contato/(?P<sucesso>\S+)'=>'form_contato.php',
62 );
63 
64 include_once("RequestManager.php");
65 $request_manager = new RequestManager();
66 $request_manager->run($rotas);

Stack Trace

2021-03-08 21:11:25 Apache Yii Framework/1.1.13