通知Zend框架有关新模块的准确配置是什么?

So if you follow the Zend framework documentation to build a skeleton application, when you get to the part where you have to inform Zend of about the new module, the documentation provides this example:

return array(
     'modules' => array(
         'Application',
         'Album',                  // <-- Add this line
     ),
     'module_listener_options' => array(
         'config_glob_paths'    => array(
             'config/autoload/{{,*.}global,{,*.}local}.php',
         ),
         'module_paths' => array(
             './module',
             './vendor',
         ),
     ),
 );

If you look at the actual file it looks like this:

<?php
/**
 * If you need an environment-specific system or application configuration,
 * there is an example in the documentation
 * @see https://docs.zendframework.com/tutorials/advanced-config/#environment-specific-system-configuration
 * @see https://docs.zendframework.com/tutorials/advanced-config/#environment-specific-application-configuration
 */
return [
    // Retrieve list of modules used in this application.
    'modules' => require __DIR__ . '/modules.config.php',

    // These are various options for the listeners attached to the ModuleManager
    'module_listener_options' => [
        // This should be an array of paths in which modules reside.
        // If a string key is provided, the listener will consider that a module
        // namespace, the value of that key the specific path to that module's
        // Module class.
        'module_paths' => [
            './module',
            './vendor',
        ],

        // An array of paths from which to glob configuration files after
        // modules are loaded. These effectively override configuration
        // provided by modules themselves. Paths may use GLOB_BRACE notation.
        'config_glob_paths' => [
            realpath(__DIR__) . '/autoload/{{,*.}global,{,*.}local}.php',
        ],

        // Whether or not to enable a configuration cache.
        // If enabled, the merged configuration will be cached and used in
        // subsequent requests.
        'config_cache_enabled' => true,

        // The key used to create the configuration cache file name.
        'config_cache_key' => 'application.config.cache',

        // Whether or not to enable a module class map cache.
        // If enabled, creates a module class map cache which will be used
        // by in future requests, to reduce the autoloading process.
        'module_map_cache_enabled' => true,

        // The key used to create the class map cache file name.
        'module_map_cache_key' => 'application.module.cache',

        // The path in which to cache merged configuration.
        'cache_dir' => 'data/cache/',

        // Whether or not to enable modules dependency checking.
        // Enabled by default, prevents usage of modules that depend on other modules
        // that weren't loaded.
        // 'check_dependencies' => true,
    ],

    // Used to create an own service manager. May contain one or more child arrays.
    // 'service_listener_options' => [
    //     [
    //         'service_manager' => $stringServiceManagerName,
    //         'config_key'      => $stringConfigKey,
    //         'interface'       => $stringOptionalInterface,
    //         'method'          => $stringRequiredMethodName,
    //     ],
    // ],

    // Initial configuration with which to seed the ServiceManager.
    // Should be compatible with Zend\ServiceManager\Config.
    // 'service_manager' => [],
];

This is my guess:

return [
    // Retrieve list of modules used in this application.
    'modules' => require __DIR__ . '/modules.config.php',

    'modules' => [
        'Application',
        'Article',
    ],

    // These are various options for the listeners attached to the ModuleManager
    'module_listener_options' => [
        // This should be an array of paths in which modules reside.
        // If a string key is provided, the listener will consider that a module
        // namespace, the value of that key the specific path to that module's
        // Module class.
        'module_paths' => [
            './module',
            './vendor',
        ],

I ask because I am getting this error:

Fatal error: Uncaught exception 'Zend\ModuleManager\Listener\Exception\RuntimeException' with message 'Could not find a valid ServiceManager for RoutePluginManager' in /Users/ldco2016/Projects/kbase/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php on line 202
( ! ) Zend\ModuleManager\Listener\Exception\RuntimeException: Could not find a valid ServiceManager for RoutePluginManager in /Users/ldco2016/Projects/kbase/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php on line 202

So I am wondering if the configuration for informing Zend about the new module is incorrect and that's why it can't find a valid ServiceManager or if, despite the fact that I added a classmap file in module/Article of:

return array();

do I still have to add a getAutoloaderConfig() { } and add it to composer.json file? So I did add a getAutoloaderConfig() {} and now I get this error:

Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (Application) could not be initialized.' in /Users/ldco2016/Projects/kbase/vendor/zendframework/zend-modulemanager/src/ModuleManager.php on line 203
( ! ) Zend\ModuleManager\Exception\RuntimeException: Module (Application) could not be initialized. in /Users/ldco2016/Projects/kbase/vendor/zendframework/zend-modulemanager/src/ModuleManager.php on line 203

I have pored over documentation and cannot find a straight answer here.

I am confused about what version of ZF and what version of the skeleton you are using...

In the current version (ZF3), the module config has been moved to a different file that is then included in the main one: modules.config.php. That is where you stick your new module name.

As of ZF3, you do not need the getAutoloaderConfig method. Zend Autoload has been completely removed anyway, in favour of the Composer autoloader (PSR-0/PSR-4): Composer autoload config. You need to add your own module in there, and then use the composer dump-autoload command to enable the autoloader.