05-01-2019, 01:25 AM
Can we get rid of some 'ENVIRONMENT ' things in the core ? 24 +4 debugger
Production means PRODUCTION so no more checking ENVIRONMENT inside core
quote [b]ciadmin [/b] 'Spark is long dead. Check the date of the tutorials that mention it.'
https://forum.codeigniter.com/thread-651...#pid331775
no Spark check in production
no benckmark in Production
is_cli() is needed by my website ? NO but 17 is_cli() switch is performed
checks
So production = bool(false) ;
Production means PRODUCTION so no more checking ENVIRONMENT inside core
PHP Code:
if (ENVIRONMENT !== 'testing')
{
if (ob_get_level() > 0)
{
ob_end_flush();
}
}
else
{
// When testing, one is for phpunit, another is for test case.
if (ob_get_level() > 2)
{
ob_end_flush();
}
}
quote [b]ciadmin [/b] 'Spark is long dead. Check the date of the tutorials that mention it.'
https://forum.codeigniter.com/thread-651...#pid331775
no Spark check in production
PHP Code:
// Never run filters when running through Spark cli
if (! defined('SPARKED'))
{
$possibleRedirect = $filters->run($uri, 'before');
if ($possibleRedirect instanceof RedirectResponse)
{
return $possibleRedirect->send();
}
// If a Response instance is returned, the Response will be sent back to the client and script execution will stop
if ($possibleRedirect instanceof ResponseInterface)
{
return $possibleRedirect->send();
}
}
// Never run filters when running through Spark cli
if (! defined('SPARKED'))
{
$filters->setResponse($this->response);
// Run "after" filters
$response = $filters->run($uri, 'after');
}
else
{
$response = $this->response;
}
PHP Code:
// $this->benchmark->stop('controller_constructor');
// $this->benchmark->stop('controller');
is_cli() is needed by my website ? NO but 17 is_cli() switch is performed
checks
PHP Code:
if (is_cli() && ! (ENVIRONMENT === 'testing'))
{
return md5($this->request->getPath());
}