function loadExtension ($ext_name, $ext_mode = 'init', $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__ . '() 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));
+ 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));
} // END - if
// Make sure this situation can only happen once
// Empty extension name should be fixed!
if (empty($ext_name)) {
// Please report this bug!
- debug_report_bug(__FUNCTION__ . ': ext_name is empty which is not allowed here.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'ext_name is empty which is not allowed here.');
} // END - if
// Extensions are all inactive during installation
// Did we find some extension?
if (empty($data['ext_name'])) {
// We should fix these all!
- debug_report_bug(__FUNCTION__ . ': ext_name is empty. ext_id=' . $ext_id);
+ debug_report_bug(__FUNCTION__, __LINE__, 'ext_name is empty. ext_id=' . $ext_id);
} // END - if
// Return the extension name
/* DEBUG:
if ((isset($updateDepends, $GLOBALS['ext_running_updates'][getCurrentExtensionName()])) && (in_array($updateDepends, getExtensionUpdatesRunning()))) {
// Double-adding isn't fine, too
- debug_report_bug(__FUNCTION__ . '() called twice: updateDepends=' . $updateDepends . ',currentExtension=' . getCurrentExtensionName());
+ debug_report_bug(__FUNCTION__, __LINE__, '() called twice: updateDepends=' . $updateDepends . ',currentExtension=' . getCurrentExtensionName());
} // END - if
*/
// Init update depency map automatically if not found
if (isExtensionUpdateDependenciesInitialized()) {
// We need these bug reports as well...
- debug_report_bug(__FUNCTION__ . '() is called twice: currName=' . getCurrentExtensionName());
+ debug_report_bug(__FUNCTION__, __LINE__, '() is called twice: currName=' . getCurrentExtensionName());
} // END - if
$GLOBALS['ext_update_depends'][getCurrentExtensionName()] = array();
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Registration in progress: ext_name=' . $ext_name . ' - ENTERED!');
if (isExtensionRegistrationRunning($ext_name)) {
// This is really bad and should not be quietly ignored
- debug_report_bug(__FUNCTION__ . '() already called! ext_name=' . $ext_name);
+ debug_report_bug(__FUNCTION__, __LINE__, '() already called! ext_name=' . $ext_name);
} // END - if
// Then add it!
// Is the extension empty?
if (empty($ext_name)) {
// This should not happen
- debug_report_bug(__FUNCTION__ . ': Parameter ext is empty. This should not happen.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Parameter ext is empty. This should not happen.');
} // END - if
// Default message
// Is the extension empty?
if (empty($ext_name)) {
// This should not happen
- debug_report_bug(__FUNCTION__ . ': Parameter ext is empty. This should not happen.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Parameter ext is empty. This should not happen.');
} // END - if
// Default message
// Is one not readable?
if (!isIncludeReadable($source)) {
// Please report this bug!
- debug_report_bug(__FUNCTION__ . ': Source file ' . $source . ' is not readable.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Source file ' . $source . ' is not readable.');
} elseif (!isIncludeReadable($target)) {
// Please report this bug!
- debug_report_bug(__FUNCTION__ . ': Target file ' . $target . ' is not readable.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Target file ' . $target . ' is not readable.');
} elseif ($targetLanguage == getCurrentLanguage()) {
// Must be different
- debug_report_bug(__FUNCTION__ . ': Target language ' . $targetLanguage . ' is same as current.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Target language ' . $targetLanguage . ' is same as current.');
}
// Backup current messages/language
// Is the message id valid?
if (!isMessageIdValid($messageId)) {
// No, then abort here
- debug_report_bug(__FUNCTION__ . ': Invalid message id ' . $messageId . ' detected.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Invalid message id ' . $messageId . ' detected.');
} // END - if
// Now simply check it
// Are both an array?
if ((!is_array($array1)) && (!is_array($array2))) {
// Both are not arrays
- debug_report_bug(__FUNCTION__ . ': No arrays provided!');
+ debug_report_bug(__FUNCTION__, __LINE__, 'No arrays provided!');
} elseif (!is_array($array1)) {
// Left one is not an array
debug_report_bug(__FILE__, __LINE__, sprintf("array1 is not an array. array != %s", gettype($array1)));
// Should we abort here?
if (($strict === true) && ($isset === false)) {
// Output backtrace
- debug_report_bug(__FUNCTION__, __LINE__, 'output_mode is empty.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Output_mode is empty.');
} // END - if
// Return it
// Abort if not set
if (!isset($GLOBALS['block_mode'])) {
// Needs to be fixed
- debug_report_bug(__FUNCTION__ . ': block_mode is not set.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Block_mode is not set.');
} // END - if
// Return it