Esempio n. 1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $dbSocket = $this->option('db-socket');
     $dbHost = $this->option('db-host');
     $dbName = $this->option('db-name');
     if (!is_null($dbName) && (is_null($dbSocket) && is_null($dbHost))) {
         $this->error("Option '--db-name' requires at least one of: '--db-socket' OR '--db-host' to be defined.");
         return;
     }
     $configurator = new Configurator($this);
     $configurator->configure($this->argument('app-id'), $this->option('config'), $this->option('cache-config'), $this->option('bucket'), $this->option('db-socket'), $this->option('db-name'), $this->option('db-host'));
 }
Esempio n. 2
0
 /**
  * Initializes the 'testee' object and prepares,
  * the 'playground', fake configuration files.
  */
 protected function setUp()
 {
     require_once __DIR__ . '/FakeHelpers.php';
     // Prepare the playground.
     $zip = new ZipArchive();
     $zip->open(__DIR__ . '/resources.zip');
     $zip->extractTo(__DIR__ . '/playground');
     // Call the configure() function on the 'testee'
     // to generate/modify the files.
     $configurator = new Configurator(new FakeCommand());
     $appId = 'laravel-app-gae-id';
     $generateConfig = true;
     $cacheConfig = false;
     $bucketId = null;
     $dbSocket = '/cloudsql/test-app:test-cloud-sql';
     $dbName = 'gae_test_db';
     $dbHost = 'XXX.XXX.XXX.XXX';
     $configurator->configure($appId, $generateConfig, $cacheConfig, $bucketId, $dbSocket, $dbName, $dbHost);
 }