Welcome Guest, Not a member yet? Register   Sign In
Never ending testing ENVIRONMENT
#1

Can we get rid  of some 'ENVIRONMENT ' things  in the core ? 24  +4 debugger
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;
        } 
no benckmark in Production
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());
        } 
So production = bool(false) ;
Reply


Messages In This Thread
Never ending testing ENVIRONMENT - by tony.a - 05-01-2019, 01:25 AM
RE: Never ending testing ENVIRONMENT - by tony.a - 05-01-2019, 06:42 AM
RE: Never ending testing ENVIRONMENT - by tony.a - 05-01-2019, 10:38 AM
RE: Never ending testing ENVIRONMENT - by tony.a - 05-07-2019, 02:07 PM
RE: Never ending testing ENVIRONMENT - by tony.a - 05-07-2019, 02:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB