Whoops \ Exception \ ErrorException (E_WARNING)
count(): Parameter must be an array or an object that implements Countable Whoops\Exception\ErrorException thrown with message "count(): Parameter must be an array or an object that implements Countable" Stacktrace: #4 Whoops\Exception\ErrorException in /var/www/vhosts/divinut.com.br/httpdocs/site/controllers/ProdutosController.php:90 #3 count in /var/www/vhosts/divinut.com.br/httpdocs/site/controllers/ProdutosController.php:90 #2 Controller\ProdutosController:IndexAction in /var/www/vhosts/divinut.com.br/httpdocs/lib/Router.php:179 #1 call_user_func_array in /var/www/vhosts/divinut.com.br/httpdocs/lib/Router.php:179 #0 Lib\Router:init in /var/www/vhosts/divinut.com.br/httpdocs/index.php:158
Stack frames (5)
4
Whoops\Exception\ErrorException
/site/controllers/ProdutosController.php90
3
count
/site/controllers/ProdutosController.php90
2
Controller\ProdutosController IndexAction
/lib/Router.php179
1
call_user_func_array
/lib/Router.php179
0
Lib\Router init
/index.php158
/var/www/vhosts/divinut.com.br/httpdocs/site/controllers/ProdutosController.php
                $produtos = \Lib\Util::Busca2($produtos,$keyword);
            }    
        }
        
        $itensPagina = 12;
        $sort = $req->Get('sort', 'destaque_desc,ordenamento_desc');
        $rows = (int)$req->Get('rows', $itensPagina);
        $page = (int)$req->Get('page', 1);
        
        if ('' == $sort) {
            $sort = 'destaque_desc,ordenamento_desc';
        }
        if (1 > $rows) {
            $rows = $itensPagina;
        }
        if (1 > $page) {
            $page = 1;
        }
        
        $total = count($produtos);
        $pages = ceil($total / $rows);
        
        if ($page > $pages) {
            $page = $pages;
        }
        
        $offset = ($page - 1) * $rows;
        
        $produtos = Util::Sort($produtos,$sort);
        
        $produtos = array_slice($produtos, $offset, $rows);
        
        $extras['sort'] = $sort;
        $extras['produtos'] = $produtos;
        $extras['breadcrumbs'] = $breadcrumbs;
        
        if (isset($categoria->id)) {
            $categoria->url = $req->controller.'/'.$categoria->slug;
            $req->uri = $categoria->url;
            
/var/www/vhosts/divinut.com.br/httpdocs/site/controllers/ProdutosController.php
                $produtos = \Lib\Util::Busca2($produtos,$keyword);
            }    
        }
        
        $itensPagina = 12;
        $sort = $req->Get('sort', 'destaque_desc,ordenamento_desc');
        $rows = (int)$req->Get('rows', $itensPagina);
        $page = (int)$req->Get('page', 1);
        
        if ('' == $sort) {
            $sort = 'destaque_desc,ordenamento_desc';
        }
        if (1 > $rows) {
            $rows = $itensPagina;
        }
        if (1 > $page) {
            $page = 1;
        }
        
        $total = count($produtos);
        $pages = ceil($total / $rows);
        
        if ($page > $pages) {
            $page = $pages;
        }
        
        $offset = ($page - 1) * $rows;
        
        $produtos = Util::Sort($produtos,$sort);
        
        $produtos = array_slice($produtos, $offset, $rows);
        
        $extras['sort'] = $sort;
        $extras['produtos'] = $produtos;
        $extras['breadcrumbs'] = $breadcrumbs;
        
        if (isset($categoria->id)) {
            $categoria->url = $req->controller.'/'.$categoria->slug;
            $req->uri = $categoria->url;
            
/var/www/vhosts/divinut.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/divinut.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/divinut.com.br/httpdocs/index.php
        $regex = '#^http[s]?:\/\/(www\.)?(' . join("|", $hosts) . ')(\/' . preg_quote($request_uri) . ')?(\/)?(index\.php)?(\/)?#';
        //trigger_error($regex);
        $de = preg_replace('#^http[s]?:\/\/(www\.)?(' . join("|", $hosts) . ')(\/' . preg_quote($request_uri) . ')?(\/)?(index\.php)?(\/)?#', '', $de);
        $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();
 

Environment & details:

empty
empty
empty
Key Value
orig_referer
empty
Key Value
USER divinut
HOME /var/www/vhosts/divinut.com.br
PATH_TRANSLATED redirect:/./index.php/produtos/categorias/2/mudas/categorias/2/mudas
PATH_INFO /produtos/categorias/2/mudas
SCRIPT_NAME /index.php
REQUEST_URI /produtos/categorias/2/mudas
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.0
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /produtos/categorias/2/mudas
REMOTE_PORT 39292
SCRIPT_FILENAME /var/www/vhosts/divinut.com.br/httpdocs/index.php
SERVER_ADMIN root@localhost
CONTEXT_DOCUMENT_ROOT /var/www/vhosts/divinut.com.br/httpdocs
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT /var/www/vhosts/divinut.com.br/httpdocs
REMOTE_ADDR 54.242.75.224
SERVER_PORT 443
SERVER_ADDR 148.72.144.147
SERVER_NAME www.divinut.com.br
SERVER_SOFTWARE Apache
SERVER_SIGNATURE
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_CONNECTION close
HTTP_X_ACCEL_INTERNAL /internal-nginx-static-location
HTTP_X_REAL_IP 54.242.75.224
HTTP_HOST www.divinut.com.br
proxy-nokeepalive 1
HTTPS on
PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY 0
PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY 0
PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins
SCRIPT_URI https://www.divinut.com.br/produtos/categorias/2/mudas
SCRIPT_URL /produtos/categorias/2/mudas
UNIQUE_ID Zfj5EvZYCzrGHWEwLbqRagAAAA8
REDIRECT_STATUS 200
REDIRECT_HTTPS on
REDIRECT_PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY 0
REDIRECT_PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY 0
REDIRECT_PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_SCRIPT_URI https://www.divinut.com.br/produtos/categorias/2/mudas
REDIRECT_SCRIPT_URL /produtos/categorias/2/mudas
REDIRECT_UNIQUE_ID Zfj5EvZYCzrGHWEwLbqRagAAAA8
FCGI_ROLE RESPONDER
PHP_SELF /index.php/produtos/categorias/2/mudas
REQUEST_TIME_FLOAT 1710815506.1724
REQUEST_TIME 1710815506
empty
0. Whoops\Handler\PrettyPageHandler