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.
This commit is contained in:
Bharat Mediratta
2009-03-19 02:35:51 +00:00
parent 0b721258f4
commit 61d8a143ea
3 changed files with 22 additions and 50 deletions

View File

@@ -89,14 +89,16 @@ class Gallery_Unit_Test_Controller extends Controller {
@system("rm -rf test/var");
@mkdir('test/var/logs', 0777, true);
// Reset our loaded modules
// Reset our caches
module::$module_names = array();
module::$modules = array();
module::$var_cache = array();
$db->clear_cache();
// Install all modules
// Force core and user to be installed first to resolve dependencies.
module::install("core");
core_installer::install(true);
module::load_modules();
module::install("user");
$modules = array();
foreach (glob(MODPATH . "*/helpers/*_installer.php") as $file) {