Minor separations...

This commit is contained in:
stronk7 2006-08-30 20:13:46 +00:00
parent e79a09a259
commit 7c006e345a

View file

@ -43,12 +43,12 @@ function upgrade_plugins($type, $dir, $return) {
$oldupgrade = false; $oldupgrade = false;
$newupgrade = false; $newupgrade = false;
if (is_readable($fullplug .'/db/'. $CFG->dbtype .'.php')) { if (is_readable($fullplug . '/db/'. $CFG->dbtype . '.php')) {
include_once($fullplug .'/db/'. $CFG->dbtype .'.php'); // defines old upgrading function include_once($fullplug . '/db/'. $CFG->dbtype . '.php'); // defines old upgrading function
$oldupgrade = true; $oldupgrade = true;
} }
if (is_readable($fullplug .'/db/upgrade.php') && $CFG->xmldb_enabled) { if (is_readable($fullplug . '/db/upgrade.php') && $CFG->xmldb_enabled) {
include_once($fullplug .'/db/upgrade.php'); // defines new upgrading function include_once($fullplug . '/db/upgrade.php'); // defines new upgrading function
$newupgrade = true; $newupgrade = true;
} }
@ -109,9 +109,8 @@ function upgrade_plugins($type, $dir, $return) {
$status = install_from_xmldb_file($fullplug . '/db/installl.xml'); //New method $status = install_from_xmldb_file($fullplug . '/db/installl.xml'); //New method
} else if (file_exists($fullplug .'/db/'. $CFG->dbtype .'.sql')) { } else if (file_exists($fullplug .'/db/'. $CFG->dbtype .'.sql')) {
$status = modify_database($fullplug .'/db/'. $CFG->dbtype .'.sql'); //Old method $status = modify_database($fullplug .'/db/'. $CFG->dbtype .'.sql'); //Old method
} else { // We'll assume no tables are necessary } else {
set_config($pluginversion, $plugin->version); $status = true;
notify(get_string('modulesuccess', '', $plugin->name), 'notifysuccess');
} }
$db->debug = false; $db->debug = false;
@ -217,12 +216,12 @@ function upgrade_activity_modules($return) {
$oldupgrade = false; $oldupgrade = false;
$newupgrade = false; $newupgrade = false;
if ( is_readable($fullmod .'/db/'. $CFG->dbtype .'.php')) { if ( is_readable($fullmod .'/db/' . $CFG->dbtype . '.php')) {
include_once($fullmod .'/db/'. $CFG->dbtype .'.php'); // defines old upgrading function include_once($fullmod .'/db/' . $CFG->dbtype . '.php'); // defines old upgrading function
$oldupgrade = true; $oldupgrade = true;
} }
if ( is_readable($fullmod .'/db/upgrade.php') && $CFG->xmldb_enabled) { if ( is_readable($fullmod . '/db/upgrade.php') && $CFG->xmldb_enabled) {
include_once($fullmod .'/db/upgrade.php'); // defines new upgrading function include_once($fullmod . '/db/upgrade.php'); // defines new upgrading function
$newupgrade = true; $newupgrade = true;
} }