久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      • <bdo id='wPsP9'></bdo><ul id='wPsP9'></ul>
      <legend id='wPsP9'><style id='wPsP9'><dir id='wPsP9'><q id='wPsP9'></q></dir></style></legend>
      <tfoot id='wPsP9'></tfoot>
      <i id='wPsP9'><tr id='wPsP9'><dt id='wPsP9'><q id='wPsP9'><span id='wPsP9'><b id='wPsP9'><form id='wPsP9'><ins id='wPsP9'></ins><ul id='wPsP9'></ul><sub id='wPsP9'></sub></form><legend id='wPsP9'></legend><bdo id='wPsP9'><pre id='wPsP9'><center id='wPsP9'></center></pre></bdo></b><th id='wPsP9'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='wPsP9'><tfoot id='wPsP9'></tfoot><dl id='wPsP9'><fieldset id='wPsP9'></fieldset></dl></div>

    1. <small id='wPsP9'></small><noframes id='wPsP9'>

        Zend Framework 2 和 Doctrine 2 - 多個數據庫的配置

        Zend Framework 2 and Doctrine 2 - Configuration for multiple databases(Zend Framework 2 和 Doctrine 2 - 多個數據庫的配置)
        <tfoot id='E4VrQ'></tfoot>
      1. <i id='E4VrQ'><tr id='E4VrQ'><dt id='E4VrQ'><q id='E4VrQ'><span id='E4VrQ'><b id='E4VrQ'><form id='E4VrQ'><ins id='E4VrQ'></ins><ul id='E4VrQ'></ul><sub id='E4VrQ'></sub></form><legend id='E4VrQ'></legend><bdo id='E4VrQ'><pre id='E4VrQ'><center id='E4VrQ'></center></pre></bdo></b><th id='E4VrQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='E4VrQ'><tfoot id='E4VrQ'></tfoot><dl id='E4VrQ'><fieldset id='E4VrQ'></fieldset></dl></div>

        <legend id='E4VrQ'><style id='E4VrQ'><dir id='E4VrQ'><q id='E4VrQ'></q></dir></style></legend>

        • <bdo id='E4VrQ'></bdo><ul id='E4VrQ'></ul>
                  <tbody id='E4VrQ'></tbody>

                  <small id='E4VrQ'></small><noframes id='E4VrQ'>

                  本文介紹了Zend Framework 2 和 Doctrine 2 - 多個數據庫的配置的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我將配置文件中的代碼粘貼到

                  I pasted the code from the configuration.md file to

                  module.config.php

                  module.config.php

                  'doctrine' => array(
                          'connection' => array(
                              'orm_crawler' => array(
                                  'driverClass' => 'DoctrineDBALDriverPDOMySqlDriver',
                                  'params' => array(
                                      'host'     => 'localhost',
                                      'port'     => '3306',
                                      'user'     => 'root',
                                      'password' => 'root',
                                      'dbname'   => 'crawler',
                                      'driverOptions' => array(
                                          1002 => 'SET NAMES utf8'
                                      ),
                                  )
                              )
                          ),
                  
                          'configuration' => array(
                              'orm_crawler' => array(
                                  'metadata_cache'    => 'array',
                                  'query_cache'       => 'array',
                                  'result_cache'      => 'array',
                                  'driver'            => 'orm_crawler',
                                  'generate_proxies'  => true,
                                  'proxy_dir'         => 'data/DoctrineORMModule/Proxy',
                                  'proxy_namespace'   => 'DoctrineORMModuleProxy',
                                  'filters'           => array()
                              )
                          ),
                  
                          'driver' => array(
                              'Crawler_Driver' => array(
                                  'class' => 'DoctrineORMMappingDriverAnnotationDriver',
                                  'cache' => 'array',
                                  'paths' => array(
                                      __DIR__ . '/../src/Crawler/Entity'
                                  )
                              ),
                              'orm_crawler' => array(
                                  'class'   => 'DoctrineORMMappingDriverDriverChain',
                                  'drivers' => array(
                                      'CrawlerEntity' =>  'Crawler_Driver'
                                  )
                              ),
                          ),
                  
                          'entitymanager' => array(            
                              'orm_crawler' => array(
                                  'connection'    => 'orm_crawler',
                                  'configuration' => 'orm_crawler'
                              )
                          ),
                  
                          'eventmanager' => array(
                              'orm_crawler' => array()
                          ),
                  
                          'sql_logger_collector' => array(
                              'orm_crawler' => array(),
                          ),
                  
                          'entity_resolver' => array(
                              'orm_crawler' => array()
                          ),
                  
                      ),
                  

                  ```

                  模塊.php

                  public function getServiceConfig()
                  {
                      return array(
                          'factories' => array(
                  'doctrine.authenticationadapter.orm_crawler'  => new DoctrineModuleServiceAuthenticationAdapterFactory('orm_crawler'),
                                  'doctrine.authenticationstorage.orm_crawler'  => new DoctrineModuleServiceAuthenticationStorageFactory('orm_crawler'),
                                  'doctrine.authenticationservice.orm_crawler'  => new DoctrineModuleServiceAuthenticationAuthenticationServiceFactory('orm_crawler'),
                  
                                  'doctrine.connection.orm_crawler'             => new DoctrineORMModuleServiceDBALConnectionFactory('orm_crawler'),
                                  'doctrine.configuration.orm_crawler'          => new DoctrineORMModuleServiceConfigurationFactory('orm_crawler'),
                                  'doctrine.entitymanager.orm_crawler'          => new DoctrineORMModuleServiceEntityManagerFactory('orm_crawler'),
                  
                                  'doctrine.driver.orm_crawler'                 => new DoctrineModuleServiceDriverFactory('orm_crawler'),
                                  'doctrine.eventmanager.orm_crawler'           => new DoctrineModuleServiceEventManagerFactory('orm_crawler'),
                                  'doctrine.entity_resolver.orm_crawler'        => new DoctrineORMModuleServiceEntityResolverFactory('orm_crawler'),
                                  'doctrine.sql_logger_collector.orm_crawler'   => new DoctrineORMModuleServiceSQLLoggerCollectorFactory('orm_crawler'),
                                  'doctrine.mapping_collector.orm_crawler'      => function (endServiceManagerServiceLocatorInterface $sl) {
                                      $em = $sl->get('doctrine.entitymanager.orm_crawler');
                  
                                      return new DoctrineORMModuleCollectorMappingCollector($em->getMetadataFactory(), 'orm_crawler_mappings');
                                  },
                                  'DoctrineORMModuleFormAnnotationAnnotationBuilder' => function(endServiceManagerServiceLocatorInterface $sl) {
                                      return new DoctrineORMModuleFormAnnotationAnnotationBuilder($sl->get('doctrine.entitymanager.orm_crawler'));
                                  },
                          ),
                      );
                  }
                  

                  我收到以下錯誤:

                  C:xamppvhostszf2-tradevendorzendframeworkzendframeworklibraryendServiceManagerServiceManager.php:529
                  

                  留言:

                  ZendMvcControllerPluginManager::get was unable to fetch or create an instance for getServiceManager
                  

                  我做錯了什么?請幫忙.

                  What am I doing wrong? Please help.

                  問候馬修

                  推薦答案

                  Mac,歡迎使用 stackoverflow!您不需要為每個連接分別定義自定義工廠.DoctrineORMModule 已經為我們處理了這項工作.

                  Mac, welcome to stackoverflow! You don't need to define custom factories for each connection respectively. DoctrineORMModule already handles this job for us.

                  當您需要實體管理器時,通過在別名中使用它們的名稱從服務定位器實例中獲取它,如下所示:

                  When you need the entity managers, get it from service locator instance by using their names in the alias like this:

                  $this->getServiceLocator()->get('doctrine.entitymanager.orm_default');
                  

                  $this->getServiceLocator()->get('doctrine.entitymanager.orm_alternative');
                  

                  我正在分享我當前應用程序的數據庫配置之一,該配置當前同時使用 PostgreSQL 和 MySQL 連接.

                  I'm sharing one of my current application's database configuration which currently uses both PostgreSQL and MySQL connections.

                  <?php
                  return array(
                      'doctrine' => array(
                          'connection' => array(
                              // Default DB connection
                              'orm_default' => array(
                                  'driverClass' => 'DoctrineDBALDriverPDOPgSqlDriver',
                                  'params' => array(
                                      'host' => '1.2.3.4',
                                      'user' => 'pdbuser',
                                      'port' => '5432',
                                      'password' => '****',
                                      'dbname' => 'mydb',
                                      'driver' => 'pdo_pgsql',
                                  ),
                              ),
                  
                              // Alternative DB connection
                              'orm_alternative' => array(
                                  'driverClass' => 'DoctrineDBALDriverPDOMySqlDriver',
                                  'params' => array(
                                      'host' => '4.5.6.7',
                                      'user' => 'dbuser',
                                      'port' => '3306',
                                      'password' => '****',
                                      'dbname' => 'mydb',
                                      'driver' => 'pdo_mysql',
                                  ),
                              ),
                          ),
                  
                          // Entity Manager instantiation settings
                          'entitymanager' => array(
                              'orm_default' => array(
                                  'connection'    => 'orm_default',
                                  'configuration' => 'orm_default',
                              ),
                              'orm_alternative' => array(
                                  'connection'    => 'orm_alternative',
                                  'configuration' => 'orm_alternative',
                              ),
                          ),
                  
                          // Use array cache locally, also auto generate proxies on development environment.
                          'configuration' => array(
                              'orm_default' => array(
                                  'metadata_cache' => 'array',
                                  'query_cache' => 'array',
                                  'result_cache' => 'array',
                                  'hydration_cache' => 'array',
                                  'generate_proxies' => true,
                              ),
                              'orm_alternative' => array(
                                  'metadata_cache' => 'array',
                                  'query_cache' => 'array',
                                  'result_cache' => 'array',
                                  'hydration_cache' => 'array',
                                  'generate_proxies' => true,
                              ),
                          ),
                      ),
                  );
                  

                  您可以輕松地將此配置與您的配置合并.

                  You can easily merge this configuration with yours.

                  希望有幫助.

                  這篇關于Zend Framework 2 和 Doctrine 2 - 多個數據庫的配置的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                1. <i id='CnY0d'><tr id='CnY0d'><dt id='CnY0d'><q id='CnY0d'><span id='CnY0d'><b id='CnY0d'><form id='CnY0d'><ins id='CnY0d'></ins><ul id='CnY0d'></ul><sub id='CnY0d'></sub></form><legend id='CnY0d'></legend><bdo id='CnY0d'><pre id='CnY0d'><center id='CnY0d'></center></pre></bdo></b><th id='CnY0d'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CnY0d'><tfoot id='CnY0d'></tfoot><dl id='CnY0d'><fieldset id='CnY0d'></fieldset></dl></div>

                  <small id='CnY0d'></small><noframes id='CnY0d'>

                      <bdo id='CnY0d'></bdo><ul id='CnY0d'></ul>
                          <tfoot id='CnY0d'></tfoot>
                              <tbody id='CnY0d'></tbody>
                          • <legend id='CnY0d'><style id='CnY0d'><dir id='CnY0d'><q id='CnY0d'></q></dir></style></legend>

                            主站蜘蛛池模板: 国产日韩一区二区 | av无遮挡 | 特级做a爰片毛片免费看108 | 黄网站免费在线观看 | 综合网中文字幕 | av官网在线 | 久久久婷| 欧美日韩国产精品一区 | 新91视频网 | 黄色片免费 | 91精品国产一区二区三区动漫 | 日本成人三级电影 | 91免费在线看 | 欧美久久精品 | 黄色三级在线播放 | 国产精品久久久久久妇女 | 亚洲黄色一区二区三区 | 欧美成年网站 | 久久久久久国产 | 欧美精品 在线观看 | 在线国产一区 | 日韩在线观看视频一区 | 国产日韩一区二区三区 | 在线免费看91 | 精品日韩欧美一区二区 | www.天天操.com | www.狠狠操| 国产精品久久毛片av大全日韩 | 精品日韩一区 | 欧美一二三 | 国产精品久久久久久久久免费高清 | 精品久久久久久亚洲综合网 | 国产一区二区三区四区在线观看 | 超碰免费在 | 久久专区| 九九热久久免费视频 | 国产精品一区二区在线 | 精品国产乱码久久久久久88av | 欧美不卡一区二区 | 国产精品3区 | 羞羞视频在线免费 |