protected function createEnvProductionFile($env_file, $env_production_file, $dbSocket, $dbName)
    {
        if (!file_exists($env_file)) {
            $this->myCommand->error('Cannot find ".env" file to import the existing options.');
            return;
        }

        if (file_exists($env_production_file)) {
            $overwrite = $this->myCommand->confirm(
                'Overwrite the existing ".env.production" file?', false
            );

            if (! $overwrite) {
                return;
            }
        }

        $env = new EnvHelper;
        $env->read($env_file);

        $env['APP_ENV']   = 'production';
        $env['APP_DEBUG'] = 'false';
        $env['APP_LOG']   = 'syslog';

        $env['CACHE_DRIVER']   = 'memcached';
        $env['SESSION_DRIVER'] = 'memcached';

        $env['MAIL_DRIVER']  = 'gae';
        $env['QUEUE_DRIVER'] = 'gae';
        $env['FILESYSTEM']   = 'gae';

        if ((! is_null($dbSocket)) && (! is_null($dbName))) {
            $env['DB_CONNECTION'] = 'cloudsql';
            $env['DB_SOCKET']     = $dbSocket;
            $env['DB_HOST']       = '';
            $env['DB_DATABASE']   = $dbName;
            $env['DB_USERNAME']   = 'root';
            $env['DB_PASSWORD']   = '';
        }

        $this->addOptimizerOptions($env);

        $env->write($env_production_file);

        $this->myCommand->info('Created the ".env.production" file.');
    }
protected function createEnvProductionFile($env_file, $env_production_file, $dbSocket, $dbName)
    {
        if (!file_exists($env_file)) {
            $this->myCommand->error('Cannot find ".env" file to import the existing options.');
            return;
        }

        if (file_exists($env_production_file)) {
            $overwrite = $this->myCommand->confirm(
                'Overwrite the existing ".env.production" file?', false
            );

            if (! $overwrite) {
                return;
            }
        }

        $env = new EnvHelper;
        $env->read($env_file);

        $env['APP_ENV']   = 'production';
        $env['APP_DEBUG'] = 'false';
        $env['APP_LOG']   = 'syslog';

        $env['CACHE_DRIVER']   = 'memcached';
        $env['SESSION_DRIVER'] = 'memcached';

        $env['MAIL_DRIVER']  = 'gae';
        $env['QUEUE_DRIVER'] = 'gae';
        $env['FILESYSTEM']   = 'gae';

        if ((! is_null($dbSocket)) && (! is_null($dbName))) {
            $env['DB_CONNECTION'] = 'cloudsql';
            $env['DB_SOCKET']     = $dbSocket;
            $env['DB_HOST']       = '';
            $env['DB_DATABASE']   = $dbName;
            $env['DB_USERNAME']   = 'root';
            $env['DB_PASSWORD']   = '';
        }

        $this->addOptimizerOptions($env);

        $env->write($env_production_file);

        $this->myCommand->info('Created the ".env.production" file.');
    }
protected function createEnvProductionFile ( $ env_file , $ env_production_file , $ dbSocket , $ dbName ) { if ( ! file_exists ( $ env_file ) ) { $ this -> myCommand -> error ( 'Cannot find ".env" file to import the existing options.' ) ; return ; } if ( file_exists ( $ env_production_file ) ) { $ overwrite = $ this -> myCommand -> confirm ( 'Overwrite the existing ".env.production" file?' , false ) ; if ( ! $ overwrite ) { return ; } } $ env = new EnvHelper ; $ env -> read ( $ env_file ) ; $ env [ 'APP_ENV' ] = 'production' ; $ env [ 'APP_DEBUG' ] = 'false' ; $ env [ 'APP_LOG' ] = 'syslog' ; $ env [ 'CACHE_DRIVER' ] = 'memcached' ; $ env [ 'SESSION_DRIVER' ] = 'memcached' ; $ env [ 'MAIL_DRIVER' ] = 'gae' ; $ env [ 'QUEUE_DRIVER' ] = 'gae' ; $ env [ 'FILESYSTEM' ] = 'gae' ; if ( ( ! is_null ( $ dbSocket ) ) && ( ! is_null ( $ dbName ) ) ) { $ env [ 'DB_CONNECTION' ] = 'cloudsql' ; $ env [ 'DB_SOCKET' ] = $ dbSocket ; $ env [ 'DB_HOST' ] = '' ; $ env [ 'DB_DATABASE' ] = $ dbName ; $ env [ 'DB_USERNAME' ] = 'root' ; $ env [ 'DB_PASSWORD' ] = '' ; } $ this -> addOptimizerOptions ( $ env ) ; $ env -> write ( $ env_production_file ) ; $ this -> myCommand -> info ( 'Created the ".env.production" file.' ) ; }
Creates a '.env.production' file based on the existing '.env' file.

@param string $env_file The '.env' file path.
@param string $env_production_file The '.env.production' file path.
@param string $dbSocket Cloud SQL socket connection string.
@param string $dbName Cloud SQL database name.
Creates a . env . production file based on the existing . env file .