summaryrefslogtreecommitdiff
path: root/core/helpers/core_installer.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-03-19 02:35:51 +0000
committerBharat Mediratta <bharat@menalto.com>2009-03-19 02:35:51 +0000
commit61d8a143eaf7478b15edf554f2ccaada75c8bd9d (patch)
tree182a026565370e42d22db9ae15cc9fcbed8828c9 /core/helpers/core_installer.php
parent0b721258f42c0775d1fb90966a82fe3a81763e00 (diff)
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.
Diffstat (limited to 'core/helpers/core_installer.php')
-rw-r--r--core/helpers/core_installer.php9
1 files changed, 5 insertions, 4 deletions
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);
}
}
}