$OUT = '';
// Do we have queries?
- if ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y')) {
+ if (isVerboseSqlEnabled()) {
// Do we have entries?
if (countExtensionSqls() > 0) {
// Init counter
$content = array();
// Is do we have verbose output enabled?
- if ((!isExtensionActive('sql_patches')) || (getConfig('verbose_sql') == 'Y')) {
+ if ((!isExtensionActive('sql_patches')) || (isVerboseSqlEnabled())) {
// Update notes found?
if (isExtensionUpdateNoteSet($ext_ver)) {
// Update notes found
$title = '{--TASK_NO_TITLE--}';
// Shall I list SQL commands assigned to an extension installation or update task?
- if ((getConfig('verbose_sql') == 'Y')) {
+ if (isVerboseSqlEnabled()) {
// Extract extension name from subject
$ext_name = substr($taskData['subject'], 1, strpos($taskData['subject'], ':') - 1);
}
// Add SQLs to a table
- if ((!empty($ext_name)) && (isExtensionInstalled('sql_patches')) && (getConfig('verbose_sql') == 'Y')) {
+ if ((!empty($ext_name)) && (isVerboseSqlEnabled())) {
// Add verbose SQL table
$taskData['text'] .= addExtensionVerboseSqlTable($title, ' class="admin_table top left right"', true, '100%') . "<br />\n";
} // END - if
$taskData['text'] .= getExtensionNotes();
} else {
// This should not normally happen!
- debug_report_bug(__FILE__, __LINE__, 'ext_name(' . $ext_name . ') or ext_ver(' . $ext_ver . ') is empty! sql_patches=' . getExtensionVersion('sql_patches') . '/verbose_sql=' . getConfig('verbose_sql'));
+ debug_report_bug(__FILE__, __LINE__, 'ext_name(' . $ext_name . ') or ext_ver(' . $ext_ver . ') is empty! isVerboseSqlEnabled=' . intval(isVerboseSqlEnabled()));
}
// Prepare array for the template
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
// Get extension name
$ext_name = getExtensionName($taskId);
- if (getConfig('verbose_sql') == 'Y') {
+ if (isVerboseSqlEnabled()) {
// Load SQL commands in remove mode
if (loadExtension($ext_name, 'remove', '', true)) {
// Generate extra table with loaded SQL commands
return $GLOBALS['post_contains_selections'][$element];
}
+// Checks wether verbose_sql is Y and returns true/false if so
+function isVerboseSqlEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS['is_verbose_sql_enabled'])) {
+ // Determine it
+ $GLOBALS['is_verbose_sql_enabled'] = ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y'));
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['is_verbose_sql_enabled'];
+}
+
// [EOF]
?>