diff --git a/lib/actions/actionregistry.inc.php b/lib/actions/actionregistry.inc.php index e8dee35..93eaf36 100644 --- a/lib/actions/actionregistry.inc.php +++ b/lib/actions/actionregistry.inc.php @@ -33,12 +33,11 @@ class KTActionRegistry { var $actions = array(); static function &getSingleton () { - static $singleton=null; - if (is_null($singleton)) + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTActionRegistry')) { - $singleton = new KTActionRegistry(); + $GLOBALS['_KT_PLUGIN']['oKTActionRegistry'] = new KTActionRegistry; } - return $singleton; + return $GLOBALS['_KT_PLUGIN']['oKTActionRegistry']; } function registerAction($slot, $name, $nsname, $path = '', $sPlugin = null) { diff --git a/lib/authentication/authenticationproviderregistry.inc.php b/lib/authentication/authenticationproviderregistry.inc.php index 4034926..25cf381 100644 --- a/lib/authentication/authenticationproviderregistry.inc.php +++ b/lib/authentication/authenticationproviderregistry.inc.php @@ -55,12 +55,10 @@ class KTAuthenticationProviderRegistry { var $_aAuthenticationProviders = array(); static function &getSingleton () { - static $singleton=null; - if (is_null($singleton)) - { - $singleton = new KTAuthenticationProviderRegistry(); - } - return $singleton; + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTAuthenticationProviderRegistry')) { + $GLOBALS['_KT_PLUGIN']['oKTAuthenticationProviderRegistry'] = new KTAuthenticationProviderRegistry; + } + return $GLOBALS['_KT_PLUGIN']['oKTAuthenticationProviderRegistry']; } diff --git a/lib/authentication/interceptorregistry.inc.php b/lib/authentication/interceptorregistry.inc.php index 3b5d19a..746ffaa 100644 --- a/lib/authentication/interceptorregistry.inc.php +++ b/lib/authentication/interceptorregistry.inc.php @@ -44,12 +44,10 @@ class KTInterceptorRegistry { var $_aInterceptorsInfo = array(); static function &getSingleton () { - static $singleton=null; - if (is_null($singleton)) - { - $singleton = new KTInterceptorRegistry(); + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTInterceptorRegistry')) { + $GLOBALS['_KT_PLUGIN']['oKTInterceptorRegistry'] = new KTInterceptorRegistry; } - return $singleton; + return $GLOBALS['_KT_PLUGIN']['oKTInterceptorRegistry']; } function registerInterceptor($class, $nsname, $path = '', $sPlugin = null) { diff --git a/lib/browse/columnregistry.inc.php b/lib/browse/columnregistry.inc.php index 074b2df..5dc8766 100644 --- a/lib/browse/columnregistry.inc.php +++ b/lib/browse/columnregistry.inc.php @@ -37,12 +37,10 @@ class KTColumnRegistry { var $views = array(); // should be in here // {{{ getSingleton static function &getSingleton () { - static $singleton = null; - if (is_null($singleton)) - { - $singleton = new KTColumnRegistry; - } - return $singleton; + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTColumnRegistry')) { + $GLOBALS['_KT_PLUGIN']['oKTColumnRegistry'] =& new KTColumnRegistry; + } + return $GLOBALS['_KT_PLUGIN']['oKTColumnRegistry']; } // }}} diff --git a/lib/browse/criteriaregistry.php b/lib/browse/criteriaregistry.php index 8f53b44..03380ce 100644 --- a/lib/browse/criteriaregistry.php +++ b/lib/browse/criteriaregistry.php @@ -34,12 +34,10 @@ class KTCriteriaRegistry { var $_bGenericRegistered = false; static function &getSingleton () { - static $singleton=null; - if (is_null($singleton)) - { - $singleton = new KTCriteriaRegistry(); - } - return $singleton; + if (!KTUtil::arrayGet($GLOBALS['_KT_CRITERIA'], 'oKTCriteriaRegistry')) { + $GLOBALS['_KT_CRITERIA']['oKTCriteriaRegistry'] = new KTCriteriaRegistry; + } + return $GLOBALS['_KT_CRITERIA']['oKTCriteriaRegistry']; } diff --git a/lib/dashboard/NotificationRegistry.inc.php b/lib/dashboard/NotificationRegistry.inc.php index d3bd7a2..bfe923f 100644 --- a/lib/dashboard/NotificationRegistry.inc.php +++ b/lib/dashboard/NotificationRegistry.inc.php @@ -35,12 +35,10 @@ class KTNotificationRegistry { var $notification_instances = array(); static function &getSingleton () { - static $singleton=null; - if (is_null($singleton)) - { - $singleton = new KTNotificationRegistry(); + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTNotificationRegistry')) { + $GLOBALS['_KT_PLUGIN']['oKTNotificationRegistry'] = new KTNotificationRegistry; } - return $singleton; + return $GLOBALS['_KT_PLUGIN']['oKTNotificationRegistry']; } diff --git a/lib/dashboard/dashletregistry.inc.php b/lib/dashboard/dashletregistry.inc.php index 0fb6c84..8ab2b43 100644 --- a/lib/dashboard/dashletregistry.inc.php +++ b/lib/dashboard/dashletregistry.inc.php @@ -35,12 +35,10 @@ class KTDashletRegistry { var $nsnames = array(); static function &getSingleton () { - static $singleton=null; - if (is_null($singleton)) - { - $singleton = new KTDashletRegistry(); + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTDashboardRegistry')) { + $GLOBALS['_KT_PLUGIN']['oKTDashboardRegistry'] = new KTDashletRegistry; } - return $singleton; + return $GLOBALS['_KT_PLUGIN']['oKTDashboardRegistry']; } diff --git a/lib/i18n/i18nregistry.inc.php b/lib/i18n/i18nregistry.inc.php index 19e688d..572e83f 100644 --- a/lib/i18n/i18nregistry.inc.php +++ b/lib/i18n/i18nregistry.inc.php @@ -38,12 +38,10 @@ class KTi18nRegistry { var $_aLanguages = array(); static function &getSingleton() { - static $singleton = null; - if (is_null($singleton)) - { - $singleton = new KTi18nRegistry; - } - return $singleton; + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTi18nRegistry')) { + $GLOBALS['_KT_PLUGIN']['oKTi18nRegistry'] =& new KTi18nRegistry; + } + return $GLOBALS['_KT_PLUGIN']['oKTi18nRegistry']; } function registeri18n($sDomain, $sDirectory) { diff --git a/lib/plugins/KTAdminNavigation.php b/lib/plugins/KTAdminNavigation.php index d8da842..f1adac8 100644 --- a/lib/plugins/KTAdminNavigation.php +++ b/lib/plugins/KTAdminNavigation.php @@ -38,12 +38,10 @@ class KTAdminNavigationRegistry { static function &getSingleton () { - static $singleton=null; - if (is_null($singleton)) - { - $singleton = new KTAdminNavigationRegistry(); + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTAdminNavigationRegistry')) { + $GLOBALS['_KT_PLUGIN']['oKTAdminNavigationRegistry'] = new KTAdminNavigationRegistry; } - return $singleton; + return $GLOBALS['_KT_PLUGIN']['oKTAdminNavigationRegistry']; } // name is the suburl below admin diff --git a/lib/plugins/pageregistry.inc.php b/lib/plugins/pageregistry.inc.php index 2aa223a..c988982 100644 --- a/lib/plugins/pageregistry.inc.php +++ b/lib/plugins/pageregistry.inc.php @@ -33,12 +33,10 @@ class KTPageRegistry { var $aResources = array(); static function &getSingleton () { - static $singleton=null; - if (is_null($singleton)) - { - $singleton = new KTPageRegistry(); - } - return $singleton; + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTPageRegistry')) { + $GLOBALS['_KT_PLUGIN']['oKTPageRegistry'] = new KTPageRegistry; + } + return $GLOBALS['_KT_PLUGIN']['oKTPageRegistry']; } function registerPage($sPath, $sClassName, $sFilename = null) { diff --git a/lib/plugins/pluginregistry.inc.php b/lib/plugins/pluginregistry.inc.php index 293c4fd..62d928c 100644 --- a/lib/plugins/pluginregistry.inc.php +++ b/lib/plugins/pluginregistry.inc.php @@ -34,12 +34,10 @@ class KTPluginRegistry { var $_aPlugins = array(); static function &getSingleton() { - static $singleton = null; - if (is_null($singleton)) - { - $singleton = new KTPluginRegistry; - } - return $singleton; + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTPluginRegistry')) { + $GLOBALS['_KT_PLUGIN']['oKTPluginRegistry'] = new KTPluginRegistry; + } + return $GLOBALS['_KT_PLUGIN']['oKTPluginRegistry']; } function registerPlugin($sClassName, $sNamespace, $sFilename = null) { diff --git a/lib/templating/templating.inc.php b/lib/templating/templating.inc.php index 1c41bd8..7d9e5e2 100644 --- a/lib/templating/templating.inc.php +++ b/lib/templating/templating.inc.php @@ -122,13 +122,10 @@ class KTTemplating { // {{{ getSingleton static function &getSingleton () { - static $singleton = null; - - if (is_null($singleton)) - { - $singleton = new KTTemplating(); - } - return $singleton; + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTTemplating')) { + $GLOBALS['_KT_PLUGIN']['oKTTemplating'] = new KTTemplating; + } + return $GLOBALS['_KT_PLUGIN']['oKTTemplating']; } // }}} diff --git a/lib/triggers/triggerregistry.inc.php b/lib/triggers/triggerregistry.inc.php index 0cc1a75..0654518 100644 --- a/lib/triggers/triggerregistry.inc.php +++ b/lib/triggers/triggerregistry.inc.php @@ -33,12 +33,10 @@ class KTTriggerRegistry { var $triggers = array(); // {{{ getSingleton static function &getSingleton () { - static $singleton=null; - if (is_null($singleton)) - { - $singleton = new KTTriggerRegistry(); - } - return $singleton; + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTTriggerRegistry')) { + $GLOBALS['_KT_PLUGIN']['oKTTriggerRegistry'] = new KTTriggerRegistry; + } + return $GLOBALS['_KT_PLUGIN']['oKTTriggerRegistry']; } // }}} diff --git a/lib/widgets/widgetfactory.inc.php b/lib/widgets/widgetfactory.inc.php index 36081f6..eacf3bf 100644 --- a/lib/widgets/widgetfactory.inc.php +++ b/lib/widgets/widgetfactory.inc.php @@ -39,12 +39,10 @@ class KTWidgetFactory { var $widgets = array(); static function &getSingleton () { - static $singleton=null; - if (is_null($singleton)) - { - $singleton = new KTWidgetFactory(); - } - return $singleton; + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTWidgetFactory')) { + $GLOBALS['_KT_PLUGIN']['oKTWidgetFactory'] = new KTWidgetFactory; + } + return $GLOBALS['_KT_PLUGIN']['oKTWidgetFactory']; } function registerWidget($sClassname, $sNamespace, $sFilename = null) { diff --git a/lib/workflow/workflowutil.inc.php b/lib/workflow/workflowutil.inc.php index 8784fc7..88e188a 100644 --- a/lib/workflow/workflowutil.inc.php +++ b/lib/workflow/workflowutil.inc.php @@ -843,12 +843,10 @@ class KTWorkflowTriggerRegistry { } static function &getSingleton () { - static $singleton=null; - if (is_null($singleton)) - { - $singleton = new KTWorkflowTriggerRegistry(); - } - return $singleton; + if (!KTUtil::arrayGet($GLOBALS['_KT_PLUGIN'], 'oKTWorkflowTriggerRegistry')) { + $GLOBALS['_KT_PLUGIN']['oKTWorkflowTriggerRegistry'] = new KTWorkflowTriggerRegistry; + } + return $GLOBALS['_KT_PLUGIN']['oKTWorkflowTriggerRegistry']; } function registerWorkflowTrigger($sNamespace, $sClassname, $sPath) {