Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
Code tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Anahkiasen committed Jun 5, 2014
1 parent 2f6fcc7 commit f944a22
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
9 changes: 8 additions & 1 deletion src/Rocketeer/Commands/AbstractDeployCommand.php
Expand Up @@ -174,7 +174,14 @@ protected function storeServerCredentials($connections, $connectionName)
{
// Check for server credentials
$connection = array_get($connections, $connectionName, array());
$credentials = array('host' => true, 'username' => true, 'password' => false, 'keyphrase' => null, 'key' => false, 'agent' => false);
$credentials = array(
'host' => true,
'username' => true,
'password' => false,
'keyphrase' => null,
'key' => false,
'agent' => false
);

// Gather credentials
foreach ($credentials as $credential => $required) {
Expand Down
7 changes: 7 additions & 0 deletions src/Rocketeer/LogsHandler.php
Expand Up @@ -23,6 +23,13 @@ class LogsHandler
*/
protected $loggers = array();

/**
* The Container
*
* @var Container
*/
protected $app;

/**
* Build a new LogsHandler instance
*
Expand Down
4 changes: 4 additions & 0 deletions src/Rocketeer/Rocketeer.php
Expand Up @@ -108,6 +108,10 @@ protected function getContextualOption($option, $type, $original = null)
case 'connections':
$contextual = sprintf('rocketeer::on.connections.%s.%s', $this->getConnection(), $option);
break;

default:
$contextual = sprintf('rocketeer::%s', $option);
break;
}

// Merge with defaults
Expand Down
2 changes: 1 addition & 1 deletion src/Rocketeer/Server.php
Expand Up @@ -45,7 +45,7 @@ class Server
*
* @param Container $app
* @param string $filename
* @param stirng $storage
* @param string $storage
*/
public function __construct(Container $app, $filename = 'deployments', $storage = null)
{
Expand Down
16 changes: 6 additions & 10 deletions src/Rocketeer/Traits/BashModules/Binaries.php
Expand Up @@ -68,6 +68,12 @@ public function runArtisan($command = null, $flags = array())
{
$command = $this->artisan($command, $flags);

// Check if the seeds/migration need to be forced
$forced = array('migrate', 'db:seed');
if (in_array($command, $forced) && $this->versionCheck('4.2.0')) {
$flags['force'] = '';
}

return $this->runForCurrentRelease($command);
}

Expand All @@ -83,11 +89,6 @@ public function runMigrations($seed = false)
$this->command->comment('Running outstanding migrations');
$flags = $seed ? array('seed' => '') : array();

// Check if the migrations need to be forced
if ($this->versionCheck('4.2.0')) {
$flags['force'] = '';
}

return $this->runArtisan('migrate', $flags);
}

Expand All @@ -103,11 +104,6 @@ public function runSeed($class = null)
$this->command->comment('Seeding database');
$flags = $class ? array('class' => $class) : array();

// Check if the seeds need to be forced
if ($this->versionCheck('4.2.0')) {
$flags['force'] = '';
}

return $this->runArtisan('db:seed', $flags);
}

Expand Down

0 comments on commit f944a22

Please sign in to comment.