ZF-10852: Zend_Loader_Autoloader_Resource examples omit required namespace key

Description

Manual Page: http://framework.zend.com/manual/en/… Section: Resource autoloader usage

Some of the examples on this page omit the required key 'namespace'. For example, this:


      $resourceLoader = new Zend_Loader_Autoloader_Resource(array(
          'basePath'      => 'path/to/some/directory',
          'namespace'     => 'My',
          'resourceTypes' => array(
              'acl' => array(
                  'path'      => 'acls/',
                  'namespace' => 'Acl',
              ),
              'form' => array(
                  'path'      => 'forms/',
                  'namespace' => 'Form',
              ),
              'model' => array(
                  'path'      => 'models/',
              ),
          ),
      ));

is missing the namespace key in the 'model' type, and so will throw an exception ("Initial definition of a resource type must include a namespace"). The example should actually be:


      $resourceLoader = new Zend_Loader_Autoloader_Resource(array(
          'basePath'      => 'path/to/some/directory',
          'namespace'     => 'My',
          'resourceTypes' => array(
              'acl' => array(
                  'path'      => 'acls/',
                  'namespace' => 'Acl',
              ),
              'form' => array(
                  'path'      => 'forms/',
                  'namespace' => 'Form',
              ),
              'model' => array(
                  'path'      => 'models/',
                  'namespace' => 'Model',
              ),
          ),
      ));

The last three code examples in that section all contain the same omission.

Comments

Attached is a patch which I think fixes the issue in the english documentation for this component, and removes a reference to allowing non-namespaced resources by omitting the namespace key, which is incorrect.

Attached a patch to Zend_Loader_Autoloader_ResourceTest which illustrates the issue. Test passes because Zend_Loader_Exception is thrown on missing 'namespace' key.

Committed to trunk in r23563, merged to release branch 1.11 in r23564. Thanks for the patch Adam.