public function safeLoadService($configId)
    {
        /**
         * Inline autoloader that will construct a new class based on ConfigurableService
         * @param string $class_name
         */
        $missingClasses = array();
        
        $fallbackAutoload = function($class_name) use (&$missingClasses) {
            $missingClasses[] = $class_name;
            $split = strrpos($class_name, '\\');
            if ($split == false) {
                $result = eval('class '.$class_name.' extends oat\\oatbox\\service\\ConfigurableService {}');
            } else {
                $namespace = substr($class_name, 0, $split);
                $class = substr($class_name, $split+1);
                eval('namespace '.$namespace.'; '.'class '.$class.' extends \\oat\\oatbox\\service\\ConfigurableService {}');
            }
        };
        $serviceManager = $this->getServiceManager();
        spl_autoload_register($fallbackAutoload);
        $service = $serviceManager->get($configId);
        spl_autoload_unregister($fallbackAutoload);
        
        return $service;
    }
public function safeLoadService($configId)
    {
        /**
         * Inline autoloader that will construct a new class based on ConfigurableService
         * @param string $class_name
         */
        $missingClasses = array();
        
        $fallbackAutoload = function($class_name) use (&$missingClasses) {
            $missingClasses[] = $class_name;
            $split = strrpos($class_name, '\\');
            if ($split == false) {
                $result = eval('class '.$class_name.' extends oat\\oatbox\\service\\ConfigurableService {}');
            } else {
                $namespace = substr($class_name, 0, $split);
                $class = substr($class_name, $split+1);
                eval('namespace '.$namespace.'; '.'class '.$class.' extends \\oat\\oatbox\\service\\ConfigurableService {}');
            }
        };
        $serviceManager = $this->getServiceManager();
        spl_autoload_register($fallbackAutoload);
        $service = $serviceManager->get($configId);
        spl_autoload_unregister($fallbackAutoload);
        
        return $service;
    }
public function safeLoadService ( $ configId ) { /**
         * Inline autoloader that will construct a new class based on ConfigurableService
         * @param string $class_name
         */ $ missingClasses = array ( ) ; $ fallbackAutoload = function ( $ class_name ) use ( & $ missingClasses ) { $ missingClasses [ ] = $ class_name ; $ split = strrpos ( $ class_name , '\\' ) ; if ( $ split == false ) { $ result = eval ( 'class ' . $ class_name . ' extends oat\\oatbox\\service\\ConfigurableService {}' ) ; } else { $ namespace = substr ( $ class_name , 0 , $ split ) ; $ class = substr ( $ class_name , $ split + 1 ) ; eval ( 'namespace ' . $ namespace . '; ' . 'class ' . $ class . ' extends \\oat\\oatbox\\service\\ConfigurableService {}' ) ; } } ; $ serviceManager = $ this -> getServiceManager ( ) ; spl_autoload_register ( $ fallbackAutoload ) ; $ service = $ serviceManager -> get ( $ configId ) ; spl_autoload_unregister ( $ fallbackAutoload ) ; return $ service ; }
Loads a service in a "safe" way, trying to convert
unknown classes to abstract services

@param string $configId
@return
Loads a service in a safe way trying to convert unknown classes to abstract services