2015-11-09 41 views
0

我已经安装了Zend框架是错误Zend框架应用程序致命错误

PHP Fatal error: Cannot redeclare class Album\Module in /home/twekr/public_html/zend/module/Album/Module.php on line 7 

这里是

<?php 
    namespace Album; 

    use Zend\ModuleManager\Feature\AutoloaderProviderInterface; 
    use Zend\ModuleManager\Feature\ConfigProviderInterface; 

class Module implements AutoloaderProviderInterface, 
ConfigProviderInterface 
    { 
public function getAutoloaderConfig() 
{ 
    return array(
     'Zend\Loader\ClassMapAutoloader' => array(
      __DIR__ . '/autoload_classmap.php', 
     ), 
     'Zend\Loader\StandardAutoloader' => array(
      'namespaces' => array(
       __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, 
      ), 
     ), 
    ); 
} 

public function getConfig() 
{ 
    return include __DIR__ . '/config/module.config.php'; 
} 
    } 

    namespace Album; 

// Add these import statements: 
    use Album\Model\Album; 
    use Album\Model\AlbumTable; 
    use Zend\Db\ResultSet\ResultSet; 
    use Zend\Db\TableGateway\TableGateway; 

    class Module 
    { 
// getAutoloaderConfig() and getConfig() methods here 

// Add this method: 
public function getServiceConfig() 
{ 
    return array(
     'factories' => array(
      'Album\Model\AlbumTable' => function($sm) { 
       $tableGateway = $sm->get('AlbumTableGateway'); 
       $table = new AlbumTable($tableGateway); 
       return $table; 
      }, 
      'AlbumTableGateway' => function ($sm) { 
       $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); 
       $resultSetPrototype = new ResultSet(); 
       $resultSetPrototype->setArrayObjectPrototype(new 
Album()); 
       return new TableGateway('album', $dbAdapter, null, 
$resultSetPrototype); 
      }, 
     ), 
    ); 
} 
} 

?> 
+1

好像你的类被声明两次宣布两次module.php代码。 – Unex

+0

@Unex哪一类? – abhishek

+0

错误消息指定:Album \ Module – Unex

回答

0

你的“模块”类在同一个文件