}
// Registeres an extension and possible update depencies
-function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = true) {
+function registerExtension ($ext_name, $taskId, $dry_run = false, $logout = true) {
// Set current extension name
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',task_id=' . $task_id . ',dry_run=' . intval($dry_run) . ',logout=' . intval($logout) . ' - ENTERED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',task_id=' . $taskId . ',dry_run=' . intval($dry_run) . ',logout=' . intval($logout) . ' - ENTERED!');
setCurrentExtensionName($ext_name);
// Enable dry-run
} // END - if
// Is the task id zero? Then we need to auto-fix it here
- if ($task_id == '0') {
+ if ($taskId == '0') {
// Try to find the task
- $task_id = determineExtensionTaskId(getCurrentExtensionName());
+ $taskId = determineExtensionTaskId(getCurrentExtensionName());
// Still zero and not in dry-run?
- if (($task_id == '0') && (!isExtensionDryRun())) {
+ if (($taskId == '0') && (!isExtensionDryRun())) {
// Now try to create a new task
- $task_id = createNewExtensionTask(getCurrentExtensionName());
+ $taskId = createNewExtensionTask(getCurrentExtensionName());
// Is it still zero?
if ($taskId == '0') {
runFilterChain('post_extension_installed', array(
'pool' => 'extension',
'ext_name' => getCurrentExtensionName(),
- 'task_id' => $task_id
+ 'task_id' => $taskId
));
// Re-init queries and notes
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currentExtension=' . getCurrentExtensionName());
$ret = false;
}
- } elseif (($task_id > 0) && (getCurrentExtensionName() != '')) {
+ } elseif (($taskId > 0) && (getCurrentExtensionName() != '')) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
// Remove task from system when id and extension's name is valid
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s AND `status`='NEW' LIMIT 1",
- array(bigintval($task_id)), __FUNCTION__, __LINE__);
+ array(bigintval($taskId)), __FUNCTION__, __LINE__);
}
// Is this the sql_patches?
// Do we have queries?
if ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y')) {
- // Init switch color
- $SW = 2;
-
// Get all SQLs
foreach (getExtensionSqls() as $sqls) {
// New array format is recursive
if (!empty($sql)) {
// Prepare output for template
$content = array(
- 'sw' => $SW,
'i' => ($idx+1),
'sql' => $sql
);
// Load row template
$OUT .= loadTemplate('admin_ext_sql_row', true, $content);
-
- // Switch color
- $SW = 3 - $SW;
} // END - if
} // END - foreach
} // END - foreach
// Notify the admin
sendAdminNotification(
- getMessage('ADMIN_SUBJECT_EXTENSION_DEACTIVATED'),
+ '{--ADMIN_EXTENSION_DEACTIVATED_SUBJECT--}',
'admin_ext_deactivated',
array('ext_name' => $ext_name)
);
// Creates a new task for updated extension
function createExtensionUpdateTask ($adminId, $ext_name, $ext_ver, $notes) {
// Create subject line
- $subject = '[UPDATE-' . $ext_name . '-' . $ext_ver . ':] {--ADMIN_UPDATE_EXTENSION_SUBJ--}';
+ $subject = '[UPDATE-' . $ext_name . '-' . $ext_ver . ':] {--ADMIN_UPDATE_EXTENSION_SUBJECT--}';
// Get task id
$taskId = determineTaskIdBySubject($subject);
// Creates a task for automatically deactivated (deprecated) extension
function createExtensionDeactivationTask ($ext_name) {
// Create subject line
- $subject = sprintf("[%s:] %s", $ext_name, '{--TASK_SUBJ_EXTENSION_DEACTIVATED--}');
+ $subject = sprintf("[%s:] %s", $ext_name, '{--ADMIN_TASK_EXTENSION_DEACTIVATED_SUBJECT--}');
// Get task id
$taskId = determineTaskIdBySubject($subject);