Commit cdc49432 authored by Jonathan.Wage's avatar Jonathan.Wage

Comments.

parent c5e1a15f
...@@ -75,6 +75,7 @@ class Doctrine_Cli ...@@ -75,6 +75,7 @@ class Doctrine_Cli
{ {
$args = array_values($args); $args = array_values($args);
// First lets load populate an array with all the possible arguments. required and optional
$prepared = array(); $prepared = array();
$requiredArguments = $taskInstance->getRequiredArguments(); $requiredArguments = $taskInstance->getRequiredArguments();
...@@ -87,6 +88,7 @@ class Doctrine_Cli ...@@ -87,6 +88,7 @@ class Doctrine_Cli
$prepared[$arg] = null; $prepared[$arg] = null;
} }
// If we have a config array then lets try and fill some of the arguments with the config values
if (is_array($this->config) && !empty($this->config)) { if (is_array($this->config) && !empty($this->config)) {
foreach ($this->config as $key => $value) { foreach ($this->config as $key => $value) {
if (array_key_exists($key, $prepared)) { if (array_key_exists($key, $prepared)) {
...@@ -95,6 +97,7 @@ class Doctrine_Cli ...@@ -95,6 +97,7 @@ class Doctrine_Cli
} }
} }
// Now lets fill in the entered arguments to the prepared array
$copy = $args; $copy = $args;
foreach ($prepared as $key => $value) { foreach ($prepared as $key => $value) {
if (!$value && !empty($copy)) { if (!$value && !empty($copy)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment