summaryrefslogtreecommitdiff
path: root/core/controllers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-02-06 16:39:18 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-02-06 16:39:18 +0000
commit4e107dac41f58d3ed6064809d8ee461ea8592e2c (patch)
tree06933f36bc392a6bc9623bd304581b6e690799ab /core/controllers
parent48acd42f9b1dfee5ba011501a1c989eb7fde0373 (diff)
Implement fix for ticket #35. *** Requires reinstall of core ***
* Added new field in items table (path) which is sanitized version of name. * Added __set method on Items_module to set the path field whenever the name field is changed. * Made some changes to the scaffolding so missing the path column would not kill the scaffolding. * Changed MY_url::site so not having a 3rd parameter won't throw an error.
Diffstat (limited to 'core/controllers')
-rw-r--r--core/controllers/scaffold.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/controllers/scaffold.php b/core/controllers/scaffold.php
index 8266ba8f..395e032d 100644
--- a/core/controllers/scaffold.php
+++ b/core/controllers/scaffold.php
@@ -112,8 +112,11 @@ class Scaffold_Controller extends Template_Controller {
// Since we're in a state of flux, it's possible that other stuff went wrong with the
// uninstall, so back off and nuke it from orbit. It's the only way to be sure.
$db = Database::instance();
- foreach ($db->list_tables() as $table) {
- $db->query("DROP TABLE `$table`");
+ $tables = $db->list_tables();
+ if (!empty($tables)) {
+ foreach ($db->list_tables() as $table) {
+ $db->query("DROP TABLE `$table`");
+ }
}
set_error_handler($old_handler);
} else {
@@ -423,7 +426,9 @@ class Scaffold_Controller extends Template_Controller {
function _create_directories() {
foreach (array("logs", "uploads") as $dir) {
- @mkdir(VARPATH . "$dir");
+ if (!file_exists(VARPATH . "$dir")) {
+ @mkdir(VARPATH . "$dir");
+ }
}
}