src/Zend/Loader/Autoloader/Resource.php
public function load($resource, $type = null)
    {
        if (null === $type) {
            $type = $this->getDefaultResourceType();
            if (empty($type)) {

                throw new Zend_Loader_Exception('No resource type specified');
            }
        }
        if (!$this->hasResourceType($type)) {

            throw new Zend_Loader_Exception('Invalid resource type specified');
        }
        $namespace = $this->_resourceTypes[$type]['namespace'];
        $class     = $namespace . '_' . ucfirst($resource);
        if (!isset($this->_resources[$class])) {
            $this->_resources[$class] = new $class;
        }
        return $this->_resources[$class];
    }
public function load($resource, $type = null)
    {
        if (null === $type) {
            $type = $this->getDefaultResourceType();
            if (empty($type)) {

                throw new Zend_Loader_Exception('No resource type specified');
            }
        }
        if (!$this->hasResourceType($type)) {

            throw new Zend_Loader_Exception('Invalid resource type specified');
        }
        $namespace = $this->_resourceTypes[$type]['namespace'];
        $class     = $namespace . '_' . ucfirst($resource);
        if (!isset($this->_resources[$class])) {
            $this->_resources[$class] = new $class;
        }
        return $this->_resources[$class];
    }
public function load ( $ resource , $ type = null ) { if ( null === $ type ) { $ type = $ this -> getDefaultResourceType ( ) ; if ( empty ( $ type ) ) { throw new Zend_Loader_Exception ( 'No resource type specified' ) ; } } if ( ! $ this -> hasResourceType ( $ type ) ) { throw new Zend_Loader_Exception ( 'Invalid resource type specified' ) ; } $ namespace = $ this -> _resourceTypes [ $ type ] [ 'namespace' ] ; $ class = $ namespace . '_' . ucfirst ( $ resource ) ; if ( ! isset ( $ this -> _resources [ $ class ] ) ) { $ this -> _resources [ $ class ] = new $ class ; } return $ this -> _resources [ $ class ] ; }
Object registry and factory

Loads the requested resource of type $type (or uses the default resource
type if none provided). If the resource has been loaded previously,
returns the previous instance; otherwise, instantiates it.

@param  string $resource
@param  string $type
@return object
@throws Zend_Loader_Exception if resource type not specified or invalid
Object registry and factory