From 18acc65fe1fd22b42b999559234abead4c1bd691 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 19 Aug 2011 12:35:59 -0400 Subject: [PATCH] Adding Cache disabling to bake tasks and parent bakeshell. Fixes #1889 --- cake/console/libs/bake.php | 2 ++ cake/console/libs/tasks/bake.php | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index 47005bfb9..e326bc54a 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -69,6 +69,8 @@ class BakeShell extends Shell { * @access public */ function main() { + Configure::write('Cache.disable', 1); + if (!is_dir($this->DbConfig->path)) { if ($this->Project->execute()) { $this->DbConfig->path = $this->params['working'] . DS . 'config' . DS; diff --git a/cake/console/libs/tasks/bake.php b/cake/console/libs/tasks/bake.php index 424e84cf0..c47deb4fb 100644 --- a/cake/console/libs/tasks/bake.php +++ b/cake/console/libs/tasks/bake.php @@ -42,6 +42,17 @@ class BakeTask extends Shell { */ var $interactive = false; +/** + * Disable caching for baking. + * This forces the most current database schema to be used. + * + * @return void + */ + function startup() { + Configure::write('Cache.disable', 1); + parent::startup(); + } + /** * Gets the path for output. Checks the plugin property * and returns the correct path.