diff --git a/VERSION.txt b/VERSION.txt index 97c47ad86..7ac265ab3 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -6,4 +6,4 @@ // +---------------------------------------------------------------------------------------------------+ // /////////////////////////////////////////////////////////////////////////////////////////////////////////// -1.0.0.2530 \ No newline at end of file +1.0.0.2560 \ No newline at end of file diff --git a/cake/scripts/bake.php b/cake/scripts/bake.php index 4c7be8949..f58324d91 100644 --- a/cake/scripts/bake.php +++ b/cake/scripts/bake.php @@ -31,12 +31,34 @@ ini_set('display_errors', '1'); ini_set('error_reporting', '7'); +$app = 'app'; +$core = null; +$root = dirname(dirname(dirname(__FILE__))); +$here = $argv[0]; + +for ($i = 1; $i < count($argv); $i += 2) +{ + // Process command-line modifiers here + switch ($argv[$i]) + { + case '-app': + $app = $argv[$i + 1]; + break; + case '-core': + $core = $argv[$i + 1]; + break; + case '-root': + $root = $argv[$i + 1]; + break; + } +} + define ('DS', DIRECTORY_SEPARATOR); -define ('ROOT', dirname(dirname(dirname(__FILE__))).DS); -define ('APP_DIR', 'app'); -define ('APP_PATH', 'app'.DS); +define ('ROOT', $root.DS); +define ('APP_DIR', $app); +define ('APP_PATH', $app.DS); define ('DEBUG', 1); -define ('CORE_PATH', null); +define ('CORE_PATH', $core); require_once (ROOT.'cake'.DS.'basics.php'); require_once (ROOT.'cake'.DS.'config'.DS.'paths.php'); @@ -527,6 +549,11 @@ class Bake { $modelTableName = null; } $this->bakeModel($modelClassName, $dbConnection, $modelTableName, $validate, $modelAssociations); + + if ($this->doUnitTest()) + { + $this->bakeUnitTest('model', $modelClassName); + } } else { @@ -612,7 +639,7 @@ class Bake { $indexView .= "\tActions\n"; $indexView .= "\n"; - $indexView .= "\n"; + $indexView .= "\n"; $indexView .= "\n"; @@ -726,7 +753,7 @@ class Bake { $viewView .= "\t\t
\n"; $viewView .= "\t\n"; $viewView .= "\t\n"; - $viewView .= "\n"; + $viewView .= "\n"; $viewView .= "\n"; } @@ -749,7 +776,7 @@ class Bake { $viewView .= " \$value): ?>\n"; $viewView .= "\n"; - $viewView .= "\n"; + $viewView .= "\n"; $viewView .= "Actions\n"; $viewView .= "\n"; @@ -760,27 +787,27 @@ class Bake { $viewView .= "\t \$value):?>\n"; $viewView .= "\t\t\n"; - $viewView .= "\t\n"; + $viewView .= "\t\n"; - $viewView .= "controller->{$modelName}->{$association})):?>\n"; + $viewView .= "controller->{$modelName}->{$association})):?>\n"; $viewView .= "\n"; $viewView .= "\tlink('View', '/" . $inflect->underscore($controller) . "/view/' . \$row[\$this->controller->{$modelName}->{$association}->primaryKey])?>\n"; $viewView .= "\tlink('Edit', '/" . $inflect->underscore($controller) . "/edit/' . \$row[\$this->controller->{$modelName}->{$association}->primaryKey])?>\n"; $viewView .= "\tlink('Delete', '/" . $inflect->underscore($controller) . "/delete/' . \$row[\$this->controller->{$modelName}->{$association}->primaryKey])?>\n"; $viewView .= "\n"; - $viewView .= "\n"; + $viewView .= "\n"; $viewView .= "\n"; $viewView .= "\tlink('View', '/" . $inflect->underscore($controller) . "/view/' . \$row[\$this->controller->{$modelName}->primaryKey])?>\n"; $viewView .= "\tlink('Edit', '/" . $inflect->underscore($controller) . "/edit/' . \$row[\$this->controller->{$modelName}->primaryKey])?>\n"; $viewView .= "\tlink('Delete', '/" . $inflect->underscore($controller) . "/delete/' . \$row[\$this->controller->{$modelName}->primaryKey])?>\n"; $viewView .= "\n"; - $viewView .= "\n"; + $viewView .= "\n"; $viewView .= "\n"; - $viewView .= "\n"; + $viewView .= "\n"; $viewView .= "\n"; - $viewView .= "\n\n"; + $viewView .= "\n\n"; $viewView .= "