} // END - if
// Load the extension and maybe found language and function files.
-function loadExtension ($ext_name, $ext_mode = 'init', $ext_ver = '', $dry_run = false) {
+function loadExtension ($ext_name, $ext_mode, $ext_ver = '', $dry_run = false) {
// If this happens twice, we need the bug report from you, except for updates/tests
if ((isset($GLOBALS['loaded_extension'][$ext_name][$ext_mode])) && (!in_array($ext_mode, array('update', 'test')))) {
debug_report_bug(__FUNCTION__, __LINE__, '() is called twice: ext_name=' . $ext_name . ', ext_mode='. $ext_mode . ',ext_sqls=' . print_r(getExtensionSqls(), true) . ', ext_register_running=' . print_r($GLOBALS['ext_register_running'], true) . ', ext_running_updates=' . print_r($GLOBALS['ext_running_updates'], true));
// Download functions file
loadIncludeOnce($funcsInclude);
} // END - if
- } elseif ((!isset($GLOBALS['cache_array']['extension']['ext_func'][$ext_name])) && (isDebugModeEnabled()) && (getOutputMode() == '0') && ($ext_name != 'sql_patches') && (substr($ext_name, 0, 10) != 'admintheme') && (getExtensionMode() == 'test')) {
+ } elseif ((!isset($GLOBALS['cache_array']['extension']['ext_func'][$ext_name])) && (isDebugModeEnabled()) && (getScriptOutputMode() == '0') && ($ext_name != 'sql_patches') && (substr($ext_name, 0, 10) != 'admintheme') && (getExtensionMode() == 'test')) {
// No functions file is not so good...
logDebugMessage(__FUNCTION__, __LINE__, sprintf("NOTICE: Extension %s has no own functions file or we cannot read from it. mode=%s",
$ext_name,
// We don't like empty extension names here
if (empty($ext_name)) {
// Please fix them all
- debug_report_bug(__FUNCTION__.': ext_name is empty.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'ext_name is empty.');
} // END - if
// By default non is installed
// Check if given extension is active
function isExtensionActive ($ext_name) {
- // Extensions are all inactive during installation
- if ((isInstallationPhase()) || (empty($ext_name))) return false;
+ if (isInstallationPhase()) {
+ // Extensions are all inactive during installation
+ return false;
+ } elseif (empty($ext_name)) {
+ // Empty extension names must befixed
+ debug_report_bug(__FUNCTION__, __LINE__, 'Empty extension name provided.');
+ } elseif (!isExtensionInstalled($ext_name)) {
+ // Not installed extensions are always inactive
+ return false;
+ }
// Not active is the default
$data['ext_active'] = 'N';
// Count cache hits
incrementStatsEntry('cache_hits');
- } elseif ((!isCacheInstanceValid()) || (isset($GLOBALS['cache_array']['extension'])) || (getOutputMode() != 0)) {
+ } elseif ((!isCacheInstanceValid()) || (isset($GLOBALS['cache_array']['extension'])) || (getScriptOutputMode() != 0)) {
// Load from database
$result = SQL_QUERY_ESC("SELECT `ext_version` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
array($ext_name), __FUNCTION__, __LINE__);
$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