From 61d8a143eaf7478b15edf554f2ccaada75c8bd9d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 19 Mar 2009 02:35:51 +0000 Subject: Rejigger the way we do reinstalls while Kohana is running. core_installer::install() now takes an $initial_install param that allows us to enforce that we're doing a clean install. Use this in both the scaffolding and the unit test code. Greatly simplify the scaffolding uninstall/reinstall code. --- core/helpers/core_installer.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'core/helpers') diff --git a/core/helpers/core_installer.php b/core/helpers/core_installer.php index cd318ebd..4755e39a 100644 --- a/core/helpers/core_installer.php +++ b/core/helpers/core_installer.php @@ -18,9 +18,9 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class core_installer { - static function install() { + static function install($initial_install=false) { $db = Database::instance(); - if (TEST_MODE) { + if ($initial_install) { $version = 0; } else { $version = module::get_version("core"); @@ -280,8 +280,9 @@ class core_installer { $db->query("DROP TABLE IF EXISTS {sessions}"); $db->query("DROP TABLE IF EXISTS {tasks}"); $db->query("DROP TABLE IF EXISTS {vars}"); - foreach (array("albums", "resizes", "thumbs", "uploads", "modules") as $dir) { - system("/bin/rm -rf " . VARPATH . $dir); + foreach (array("albums", "resizes", "thumbs", "uploads", + "modules", "logs", "database.php") as $entry) { + system("/bin/rm -rf " . VARPATH . $entry); } } } -- cgit v1.2.3