function isMobile() {
return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]);
}
App\Controller\AppController::isMobile() /home/dh_muaviy/football-ranking.com/src/Controller/AppController.php, line 168 App\Controller\AppController::initialize() /home/dh_muaviy/football-ranking.com/src/Controller/AppController.php, line 69 App\Controller\RanksController::initialize() /home/dh_muaviy/football-ranking.com/src/Controller/RanksController.php, line 24 Cake\Controller\Controller::__construct() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Controller/Controller.php, line 229 ReflectionClass::newInstance() [internal], line ?? Cake\Controller\ControllerFactory::create() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 87 Cake\Http\BaseApplication::handle() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/BaseApplication.php, line 318 Cake\Http\Runner::handle() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Runner.php, line 86 Cake\Http\Middleware\CsrfProtectionMiddleware::process() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php, line 164 Cake\Http\Runner::handle() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Middleware\BodyParserMiddleware::process() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php, line 157 Cake\Http\Runner::handle() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Routing\Middleware\RoutingMiddleware::process() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 186 Cake\Http\Runner::handle() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Routing\Middleware\AssetMiddleware::process() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 68 Cake\Http\Runner::handle() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Error\Middleware\ErrorHandlerMiddleware::process() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 131 Cake\Http\Runner::handle() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner::run() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Runner.php, line 67 Cake\Http\Server::run() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Server.php, line 90 [main] /home/dh_muaviy/football-ranking.com/webroot/index.php, line 40
$message = "Unable to emit headers. Headers sent in file=$file line=$line";
trigger_error($message, E_USER_WARNING);
}
Cake\Http\ResponseEmitter::emit() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 71 Cake\Http\Server::emit() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Server.php, line 128 [main] /home/dh_muaviy/football-ranking.com/webroot/index.php, line 40
$reasonPhrase = $response->getReasonPhrase();
header(sprintf(
'HTTP/%s %d%s',
header [internal], line ?? Cake\Http\ResponseEmitter::emitStatusLine() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 164 Cake\Http\ResponseEmitter::emit() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 74 Cake\Http\Server::emit() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Server.php, line 128 [main] /home/dh_muaviy/football-ranking.com/webroot/index.php, line 40
foreach ($values as $value) {
header(sprintf(
'%s: %s',
header [internal], line ?? Cake\Http\ResponseEmitter::emitHeaders() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter::emit() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\Server::emit() /home/dh_muaviy/football-ranking.com/vendor/cakephp/cakephp/src/Http/Server.php, line 128 [main] /home/dh_muaviy/football-ranking.com/webroot/index.php, line 40
*/ |
|
//$this->loadComponent('FormProtection'); |
|
} |
|
function isMobile() { |
|
return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]); |
|
} |
|
} |
|
|
$this->set('user_pref_langs', isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])?substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2):'en'); |
|
|
|
$isMobile = $this->request->getCookie('isMobile'); |
|
if(is_null($isMobile) || empty($isMobile)){ |
|
$isMobile = $this->isMobile(); |
|
setcookie("isMobile", strval($isMobile)); |
|
} |
|
|
|
$this->set('is_Mobile', $isMobile); |
]
|
|
];
|
|
public function initialize(): void
|
|
{
|
|
parent::initialize();
|
|
$connection = ConnectionManager::get('default');
|
|
|
|
$query = $connection->execute('SELECT p.id FROM period p where p.status = 1 LIMIT 1') ->fetch();
|
|
|
if ($components !== null) { |
|
$this->components($components); |
|
} |
|
|
|
$this->initialize(); |
|
|
|
if (isset($this->components)) { |
|
triggerWarning( |
|
'Support for loading components using $components property is removed. ' . |
// The request is in the container by default. |
|
if ($this->container->has($className)) { |
|
$controller = $this->container->get($className); |
|
} else { |
|
$controller = $reflection->newInstance($request); |
|
} |
|
|
|
return $controller; |
|
} |
if (Router::getRequest() !== $request) { |
|
Router::setRequest($request); |
|
} |
|
|
|
$controller = $this->controllerFactory->create($request); |
|
|
|
return $this->controllerFactory->invoke($controller); |
|
} |
|
} |
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
|
} |
|
|
|
return new Response([ |
|
'body' => 'Middleware queue was exhausted without returning a response ' |
if ($method === 'GET' && $cookieData === null) { |
|
$token = $this->createToken(); |
|
$request = $request->withAttribute('csrfToken', $this->saltToken($token)); |
|
/** @var mixed $response */ |
|
$response = $handler->handle($request); |
|
|
|
return $this->_addTokenCookie($token, $request, $response); |
|
} |
|
|
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
*/ |
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
{ |
|
if (!in_array($request->getMethod(), $this->methods, true)) { |
|
return $handler->handle($request); |
|
} |
|
[$type] = explode(';', $request->getHeaderLine('Content-Type')); |
|
$type = strtolower($type); |
|
if (!isset($this->parsers[$type])) { |
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
); |
|
} |
|
$matching = Router::getRouteCollection()->getMiddleware($middleware); |
|
if (!$matching) { |
|
return $handler->handle($request); |
|
} |
|
|
|
$middleware = new MiddlewareQueue($matching); |
|
$runner = new Runner(); |
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
{ |
|
$url = $request->getUri()->getPath(); |
|
if (strpos($url, '..') !== false || strpos($url, '.') === false) { |
|
return $handler->handle($request); |
|
} |
|
|
|
if (strpos($url, '/.') !== false) { |
|
return $handler->handle($request); |
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
*/ |
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
{ |
|
try { |
|
return $handler->handle($request); |
|
} catch (RedirectException $exception) { |
|
return $this->handleRedirect($exception); |
|
} catch (Throwable $exception) { |
|
return $this->handleException($exception, $request); |
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
) { |
|
Router::setRequest($request); |
|
} |
|
|
|
return $this->handle($request); |
|
} |
|
|
|
/** |
|
* Handle incoming server request and return a response. |
} |
|
|
|
$this->dispatchEvent('Server.buildMiddleware', ['middleware' => $middleware]); |
|
|
|
$response = $this->runner->run($middleware, $request, $this->app); |
|
|
|
if ($request instanceof ServerRequest) { |
|
$request->getSession()->close(); |
|
} |
// Bind your application to the server. |
|
$server = new Server(new Application(dirname(__DIR__) . '/config')); |
|
|
|
// Run the request/response through the application and emit the response. |
|
$server->emit($server->run()); |
|
|
If you want to customize this error message, create templates/Error/error500.php