351,16 → 351,10 |
|
// --- SQL slang plugin |
|
/** |
* @return void |
*/ |
private static function registerSqlSlangPlugin(OIDplusSqlSlangPlugin $plugin) { |
$name = $plugin::id(); |
if ($name === '') return false; |
|
if ($name === '') { |
throw new OIDplusException(_L('Plugin %1 cannot be registered because it does not return a valid ID', $plugin->getPluginDirectory())); |
} |
|
if (isset(self::$sqlSlangPlugins[$name])) { |
$plugintype_hf = _L('SQL slang'); |
throw new OIDplusException(_L('Multiple %1 plugins use the ID %2', $plugintype_hf, $name)); |
367,6 → 361,8 |
} |
|
self::$sqlSlangPlugins[$name] = $plugin; |
|
return true; |
} |
|
public static function getSqlSlangPlugins() { |
383,16 → 379,10 |
|
// --- Database plugin |
|
/** |
* @return void |
*/ |
private static function registerDatabasePlugin(OIDplusDatabasePlugin $plugin) { |
$name = $plugin::id(); |
if ($name === '') return false; |
|
if ($name === '') { |
throw new OIDplusException(_L('Plugin %1 cannot be registered because it does not return a valid ID', $plugin->getPluginDirectory())); |
} |
|
if (isset(self::$dbPlugins[$name])) { |
$plugintype_hf = _L('Database'); |
throw new OIDplusException(_L('Multiple %1 plugins use the ID %2', $plugintype_hf, $name)); |
399,6 → 389,8 |
} |
|
self::$dbPlugins[$name] = $plugin; |
|
return true; |
} |
|
public static function getDatabasePlugins() { |
438,16 → 430,10 |
|
// --- CAPTCHA plugin |
|
/** |
* @return void |
*/ |
private static function registerCaptchaPlugin(OIDplusCaptchaPlugin $plugin) { |
$name = $plugin::id(); |
if ($name === '') return false; |
|
if ($name === '') { |
throw new OIDplusException(_L('Plugin %1 cannot be registered because it does not return a valid ID', $plugin->getPluginDirectory())); |
} |
|
if (isset(self::$captchaPlugins[$name])) { |
$plugintype_hf = _L('CAPTCHA'); |
throw new OIDplusException(_L('Multiple %1 plugins use the ID %2', $plugintype_hf, $name)); |
454,6 → 440,8 |
} |
|
self::$captchaPlugins[$name] = $plugin; |
|
return true; |
} |
|
public static function getCaptchaPlugins() { |
485,11 → 473,10 |
|
// --- Page plugin |
|
/** |
* @return void |
*/ |
private static function registerPagePlugin(OIDplusPagePlugin $plugin) { |
self::$pagePlugins[] = $plugin; |
|
return true; |
} |
|
public static function getPagePlugins() { |
564,9 → 551,6 |
throw new OIDplusException(_L('Could not find a fitting auth plugin!')); |
} |
|
/** |
* @return void |
*/ |
private static function registerAuthPlugin(OIDplusAuthPlugin $plugin) { |
$reason = ''; |
if (OIDplus::baseConfig()->getValue('DEBUG') && $plugin->availableForHash($reason) && $plugin->availableForVerify($reason)) { |
593,6 → 577,7 |
} |
|
self::$authPlugins[] = $plugin; |
return true; |
} |
|
public static function getAuthPlugins() { |
601,11 → 586,9 |
|
// --- Language plugin |
|
/** |
* @return void |
*/ |
private static function registerLanguagePlugin(OIDplusLanguagePlugin $plugin) { |
self::$languagePlugins[] = $plugin; |
return true; |
} |
|
public static function getLanguagePlugins() { |
614,11 → 597,9 |
|
// --- Design plugin |
|
/** |
* @return void |
*/ |
private static function registerDesignPlugin(OIDplusDesignPlugin $plugin) { |
self::$designPlugins[] = $plugin; |
return true; |
} |
|
public static function getDesignPlugins() { |
637,11 → 618,9 |
|
// --- Logger plugin |
|
/** |
* @return void |
*/ |
private static function registerLoggerPlugin(OIDplusLoggerPlugin $plugin) { |
self::$loggerPlugins[] = $plugin; |
return true; |
} |
|
public static function getLoggerPlugins() { |
650,19 → 629,15 |
|
// --- Object type plugin |
|
/** |
* @return void |
*/ |
private static function registerObjectTypePlugin(OIDplusObjectTypePlugin $plugin) { |
self::$objectTypePlugins[] = $plugin; |
|
$ot = $plugin::getObjectTypeClassName(); |
self::registerObjectType($ot); |
|
return true; |
} |
|
/** |
* @return void |
*/ |
private static function registerObjectType($ot) { |
$ns = $ot::ns(); |
if (empty($ns)) throw new OIDplusException(_L('ObjectType plugin %1 is erroneous: Namespace must not be empty',$ot)); |
717,7 → 692,9 |
$idx_a = array_search($a::ns(), $enabled_ary); |
$idx_b = array_search($b::ns(), $enabled_ary); |
|
if ($idx_a == $idx_b) return 0; |
if ($idx_a == $idx_b) { |
return 0; |
} |
return ($idx_a > $idx_b) ? +1 : -1; |
}); |
} else { |