protected function fixCachedConfig($contents)
    {
        $app_path = app_path();
        $storage_path = storage_path();
        $base_path = base_path();
        $replaceFunction = 'str_replace';

        if ($this->isRunningOnWindows()) {
            $contents = $this->preprocessWindowsPaths($contents);
            $app_path     = str_replace('\\', '/', $app_path);
            $storage_path = str_replace('\\', '/', $storage_path);
            $base_path    = str_replace('\\', '/', $base_path);
            $replaceFunction = 'str_ireplace';
        }

        $strings = [
            "'${app_path}",
            "'${storage_path}",
            "'${base_path}"
        ];

        $replacements = [
            "app_path().'",
            "storage_path().'",
            "base_path().'"
        ];

        $modified = $replaceFunction($strings, $replacements, $contents);

        if ($contents !== $modified) {
            $this->myCommand->info('Generated "bootstrap/cache/config.php" for GAE deployment.');
            $this->myCommand->comment('* To use "bootstrap/cache/config.php" locally please regenerate it.');
        }

        return $modified;
    }
protected function fixCachedConfig($contents)
    {
        $app_path = app_path();
        $storage_path = storage_path();
        $base_path = base_path();
        $replaceFunction = 'str_replace';

        if ($this->isRunningOnWindows()) {
            $contents = $this->preprocessWindowsPaths($contents);
            $app_path     = str_replace('\\', '/', $app_path);
            $storage_path = str_replace('\\', '/', $storage_path);
            $base_path    = str_replace('\\', '/', $base_path);
            $replaceFunction = 'str_ireplace';
        }

        $strings = [
            "'${app_path}",
            "'${storage_path}",
            "'${base_path}"
        ];

        $replacements = [
            "app_path().'",
            "storage_path().'",
            "base_path().'"
        ];

        $modified = $replaceFunction($strings, $replacements, $contents);

        if ($contents !== $modified) {
            $this->myCommand->info('Generated "bootstrap/cache/config.php" for GAE deployment.');
            $this->myCommand->comment('* To use "bootstrap/cache/config.php" locally please regenerate it.');
        }

        return $modified;
    }
protected function fixCachedConfig ( $ contents ) { $ app_path = app_path ( ) ; $ storage_path = storage_path ( ) ; $ base_path = base_path ( ) ; $ replaceFunction = 'str_replace' ; if ( $ this -> isRunningOnWindows ( ) ) { $ contents = $ this -> preprocessWindowsPaths ( $ contents ) ; $ app_path = str_replace ( '\\' , '/' , $ app_path ) ; $ storage_path = str_replace ( '\\' , '/' , $ storage_path ) ; $ base_path = str_replace ( '\\' , '/' , $ base_path ) ; $ replaceFunction = 'str_ireplace' ; } $ strings = [ "'${app_path}" , "'${storage_path}" , "'${base_path}" ] ; $ replacements = [ "app_path().'" , "storage_path().'" , "base_path().'" ] ; $ modified = $ replaceFunction ( $ strings , $ replacements , $ contents ) ; if ( $ contents !== $ modified ) { $ this -> myCommand -> info ( 'Generated "bootstrap/cache/config.php" for GAE deployment.' ) ; $ this -> myCommand -> comment ( '* To use "bootstrap/cache/config.php" locally please regenerate it.' ) ; } return $ modified ; }
Fixes the paths in the cached config file.

@param string $contents the 'bootstrap/cache/config.php' file contents.
@return string the modified file contents.
Fixes the paths in the cached config file .