diff --git a/sites/all/modules/unl/unl_cas.info b/sites/all/modules/unl/unl_cas.info index 5209736d1a21baf948ecda2835bff1c35fd25a57..5c307762490072bea143ddc376dc889020a1be53 100644 --- a/sites/all/modules/unl/unl_cas.info +++ b/sites/all/modules/unl/unl_cas.info @@ -3,3 +3,4 @@ name = UNL CAS description = Enables UNL CAS authentication/registration of users. core = 7.x files[] = unl_cas.module +files[] = unl_loader.php diff --git a/sites/all/modules/unl/unl_cas.module b/sites/all/modules/unl/unl_cas.module index bdd3804f5e46b37689e8da4fe34d5d7a2442a0b4..fd87285586c42c480644d649d939d4f0be8027d2 100644 --- a/sites/all/modules/unl/unl_cas.module +++ b/sites/all/modules/unl/unl_cas.module @@ -7,12 +7,8 @@ function unl_cas_enable() function unl_cas_init() { - drupal_flush_all_caches(); - - set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/../../libraries' ); - require_once 'Zend/Loader/Autoloader.php'; - $autoloader = Zend_Loader_Autoloader::getInstance(); - $autoloader->registerNamespace('Unl_'); + require_once dirname(__FILE__) . '/unl_loader.php'; + unl_load_zend_framework(); $cas = unl_cas_get_adapter(); diff --git a/sites/all/modules/unl/unl_loader.php b/sites/all/modules/unl/unl_loader.php new file mode 100644 index 0000000000000000000000000000000000000000..d4e4917b45fe4953d0f1d7337ea99123847b868b --- /dev/null +++ b/sites/all/modules/unl/unl_loader.php @@ -0,0 +1,16 @@ +<?php + +function unl_load_zend_framework() +{ + static $isLoaded = FALSE; + + if ($isLoaded) { + return; + } + + set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/../../libraries' ); + require_once 'Zend/Loader/Autoloader.php'; + $autoloader = Zend_Loader_Autoloader::getInstance(); + $autoloader->registerNamespace('Unl_'); + $isLoaded = TRUE; +}