// Try to register the extension
//* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().":ext_update=".$ext_update.",taskId=".$task."<br />\n";
$test = REGISTER_EXTENSION($ext_update, $task, $dry_run, false);
+
+ // Reset extension name
+ EXT_SET_CURR_NAME($ext_name);
//* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'; var_dump($test);
} // END - if
} elseif ($ext_ver != EXT_GET_VERSION()) {
// Register extension
//* DEBUG: */ print __FUNCTION__."[".__LINE__."]:insert=".EXT_GET_CURR_NAME().'/'.EXT_GET_VERSION()." - INSERT!<br />\n";
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_extensions` (ext_name, ext_active, ext_version) VALUES ('%s','%s','%s')",
- array(EXT_GET_CURR_NAME(), EXT_GET_ALWAYS_ACTIVE(), EXT_GET_VERSION()), __FUNCTION__, __LINE__);
+ array(EXT_GET_CURR_NAME(), EXT_GET_ALWAYS_ACTIVE(), EXT_GET_VERSION()), __FUNCTION__, __LINE__);
// Remove cache file(s) if extension is active
runFilterChain('post_extension_installed', array('ext_name' => EXT_GET_CURR_NAME(), 'task_id' => $task_id));
// And load SQL queries in order of version history
for ($idx = ($start + 1); $idx < count($history); $idx++) {
+ // Set current extension name
+ //* DEBUG: */ print __FUNCTION__.'['.__LINE__.':] ext_name='.$ext_name.'<br />';
+ EXT_SET_CURR_NAME($ext_name);
+
// Set extension version
$GLOBALS['cache_array']['update_ver'][EXT_GET_CURR_NAME()] = $history[$idx];
// Load again...
LOAD_EXTENSION(EXT_GET_CURR_NAME(), 'update', $GLOBALS['cache_array']['update_ver'][EXT_GET_CURR_NAME()], $dry_run);
- if (EXT_GET_UPDATE_DEPENDS() != '') {
- // Is the extension there?
- if (GET_EXT_VERSION(EXT_GET_UPDATE_DEPENDS()) != '') {
- // Update another extension first!
- $test = EXTENSION_UPDATE(EXT_GET_UPDATE_DEPENDS(), GET_EXT_VERSION(EXT_GET_UPDATE_DEPENDS()), $dry_run);
- } else {
- // Register new extension
- $test = REGISTER_EXTENSION(EXT_GET_UPDATE_DEPENDS(), 0, $dry_run, false);
- }
+ // Get all depencies
+ $depencies = EXT_GET_UPDATE_DEPENDS();
+
+ // Nothing to apply?
+ if (count($depencies) > 0) {
+ // Apply all extension depencies
+ foreach ($depencies as $ext_depend) {
+ // Set it as current
+ EXT_SET_CURR_NAME($ext_depend);
+
+ // Is the extension there?
+ if (GET_EXT_VERSION($ext_depend) != '') {
+ // Update another extension first!
+ $test = EXTENSION_UPDATE($ext_depend, GET_EXT_VERSION($ext_depend), $dry_run);
+ } else {
+ // Register new extension
+ $test = REGISTER_EXTENSION($ext_depend, 0, $dry_run, false);
+ }
+ } // END - foreach
+
+ // Set name back
+ EXT_SET_CURR_NAME($ext_name);
} // END - if
// Add notes
break;
case '0.7.2': // SQL queries for v0.7.2
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP login_failtures");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP last_failture");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` ADD login_failures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` ADD last_failure TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'");
+ ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP `login_failtures`");
+ ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP `last_failture`");
+ ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` ADD `login_failures` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` ADD `last_failure` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'");
// Update notes (these will be set as task text!)
EXT_SET_UPDATE_NOTES("Schreibweise korregiert.");