/var/www/vhosts/xn--direitosdascrianas-nvb.com.br/httpdocs/site/controllers/NoticiasController.php
if (!in_array($req->method, array('index','post'))) {
$categoria_slug = $req->method;
$req->method = $categoria_slug;
}
if (preg_match('/^(?<ano>\d{4})-(?<mes>[0-1]\d)$/', $categoria_slug, $matches)) {
$mes = $matches['mes'];
$ano = $matches['ano'];
$posts = array_filter($posts, function($publicao) use ($mes, $ano) {
return $publicao->ano == $ano && $publicao->mes == $mes;
});
} else {
if ('' != $categoria_slug) {
$categoria = \Models\Blog\Categorias::getBySlug($categoria_slug);
$extras['categoria'] = $categoria;
$req->extras[] = $categoria->slug;
$posts = $categoria->getPosts();
}
}
$busca = $req->Get('buscar', '');
if ('' != $busca) {
$keywords = \Lib\Util::linkfy($busca);
$keys = explode('-', $keywords);
if (count($keys) > 1) {
$keywords = explode('-', $keywords);
$keywords = array_unique($keywords);
foreach($keywords as $keyword) {
$posts = \Lib\Util::Busca1($posts,$keyword);
}
} else {
$keyword = $keywords;
$posts = \Lib\Util::Busca2($posts,$keyword);
}
/var/www/vhosts/xn--direitosdascrianas-nvb.com.br/httpdocs/lib/Router.php
if ($cacheTime !== 0 && !isset($req->get->noCache) && in_array($req->type, array('GET'))) {
//CacheManager::setup($cache['config']);
//$cache = phpFastCache();
$cache_key = sha1($req->base_url.$req->controller.'/'.$req->method.'/'.join('/',$req->params).'?'.http_build_query((array)$req->get));
if (\Lib\Cache::exists($cache_key)) {
$cached = \Lib\Cache::get($cache_key,function() {});
}
//$cached = $cache->get($cache_key);
}
if (!$cached) {
$res->header('X-Cache','miss');
Hooks::call('before-action',array(&$req,&$res));
call_user_func_array(array($classname,$method), array($req,&$res));
Hooks::call('after-action',array(&$req,&$res));
if ($cacheTime !== 0 && !isset($req->get->noCache) && in_array($req->type, array('GET'))) {
\Lib\Cache::set($cache_key, $res->export());
/*
$res->on('background',function($cache,$cache_key,$res,$cacheTime){
$cache->set($cache_key,$res->export(),$cacheTime);
},array($cache,$cache_key,$res,$cacheTime));
*/
}
} else {
$res->import($cached);
$res->header('X-Cache','hit');
}
}
$req->end_time = microtime(true);
/var/www/vhosts/xn--direitosdascrianas-nvb.com.br/httpdocs/lib/Router.php
if ($cacheTime !== 0 && !isset($req->get->noCache) && in_array($req->type, array('GET'))) {
//CacheManager::setup($cache['config']);
//$cache = phpFastCache();
$cache_key = sha1($req->base_url.$req->controller.'/'.$req->method.'/'.join('/',$req->params).'?'.http_build_query((array)$req->get));
if (\Lib\Cache::exists($cache_key)) {
$cached = \Lib\Cache::get($cache_key,function() {});
}
//$cached = $cache->get($cache_key);
}
if (!$cached) {
$res->header('X-Cache','miss');
Hooks::call('before-action',array(&$req,&$res));
call_user_func_array(array($classname,$method), array($req,&$res));
Hooks::call('after-action',array(&$req,&$res));
if ($cacheTime !== 0 && !isset($req->get->noCache) && in_array($req->type, array('GET'))) {
\Lib\Cache::set($cache_key, $res->export());
/*
$res->on('background',function($cache,$cache_key,$res,$cacheTime){
$cache->set($cache_key,$res->export(),$cacheTime);
},array($cache,$cache_key,$res,$cacheTime));
*/
}
} else {
$res->import($cached);
$res->header('X-Cache','hit');
}
}
$req->end_time = microtime(true);
/var/www/vhosts/xn--direitosdascrianas-nvb.com.br/httpdocs/index.php
$para = preg_replace('#^http[s]?:\/\/(www\.)?(' . join("|", $hosts) . ')?(\/)?(index\.php)?(\/)?#', '', $para);
if ($request_uri == $de) {
$base_url = \Lib\Request::getBaseUrl();
$url = $base_url . $para;
//Header( “HTTP/1.1 301 Moved Permanently” );
header("Location: {$url}");
exit;
}
}
}
*/
Router::init();