2013-11-03 153 views
1

你好,我是這個框架的新手,並且在接下來的教程中遇到了這個錯誤。好奇的Zend框架2

致命錯誤:未能捕獲異常'Zend \ ModuleManager \ Exception \ RuntimeException',消息'Module(Album)'無法初始化。在C:\網站\ Zend的\供應商\ ZF2 \圖書館\的Zend \ ModuleManager會\ ModuleManager.php上線175

這裏是我相信這是一個錯誤

<?php 
return array(
    // This should be an array of module namespaces used in the application. 
    'modules' => array(
     'Application', 
     'Album', // <-- Add this line to make new module available    
    ), 

    // These are various options for the listeners attached to the ModuleManager 
    'module_listener_options' => array(
     // 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' => array(
      './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' => array(
      'config/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' => $booleanValue, 

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

     // 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' => $booleanValue, 

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

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

     // 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' => array(
    //  array(
    //   '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' => array(), 
); 
+1

您好!歡迎來到stackoverflow!你的application.config.php似乎沒問題,但它不足以理解爲什麼modulemanager無法加載專輯模塊。你可以添加「Module.php」和「module.config.php」內容嗎? – edigu

+0

聽起來像你沒有完全按照教程。您是否實際安裝了「Album」模塊以及所有關聯的文件? – Diemuzi

回答

-1

像@foozy說代碼,如果你可以發佈更多的代碼,這將是一個很大的幫助。這可能是一些事情,比如你在module.config.php中指定的名稱與Module目錄或命名空間或各種東西不同。