pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

      • <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="h5frnrb" 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 - 多個(gè)數(shù)據(jù)庫的配置

        Zend Framework 2 and Doctrine 2 - Configuration for multiple databases(Zend Framework 2 和 Doctrine 2 - 多個(gè)數(shù)據(jù)庫的配置)
        <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="tjv5dfp" 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 - 多個(gè)數(shù)據(jù)庫的配置的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

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

                  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'));
                                  },
                          ),
                      );
                  }
                  

                  我收到以下錯(cuò)誤:

                  C:xamppvhostszf2-tradevendorzendframeworkzendframeworklibraryendServiceManagerServiceManager.php:529
                  

                  留言:

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

                  我做錯(cuò)了什么?請(qǐng)幫忙.

                  What am I doing wrong? Please help.

                  問候馬修

                  推薦答案

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

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

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

                  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');
                  

                  我正在分享我當(dāng)前應(yīng)用程序的數(shù)據(jù)庫配置之一,該配置當(dāng)前同時(shí)使用 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.

                  希望有幫助.

                  這篇關(guān)于Zend Framework 2 和 Doctrine 2 - 多個(gè)數(shù)據(jù)庫的配置的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動(dòng)游標(biāo)不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個(gè)值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)
                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="zzfpdf5" 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>

                            主站蜘蛛池模板: 碳纤维复合材料制品生产定制工厂订制厂家-凯夫拉凯芙拉碳纤维手机壳套-碳纤维雪茄盒外壳套-深圳市润大世纪新材料科技有限公司 | 乙炔气体报警装置|固定式氯化氢检测仪|河南驰诚电气百科 | 注浆压力变送器-高温熔体传感器-矿用压力传感器|ZHYQ朝辉 | VI设计-LOGO设计公司-品牌设计公司-包装设计公司-导视设计-杭州易象设计 | 高压包-点火器-高压发生器-点火变压器-江苏天网 | 政府园区专业委托招商平台_助力企业选址项目快速落地_东方龙商务集团 | 对照品_中药对照品_标准品_对照药材_「格利普」高纯中药标准品厂家-成都格利普生物科技有限公司 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库 | 大立教育官网-一级建造师培训-二级建造师培训-造价工程师-安全工程师-监理工程师考试培训 | 工控机-工业平板电脑-研华工控机-研越无风扇嵌入式box工控机 | 传动滚筒,改向滚筒-淄博建凯机械科技有限公司 | 成都中天自动化控制技术有限公司 | 光伏家 - 太阳能光伏发电_分布式光伏发电_太阳能光伏网 | 煤机配件厂家_刮板机配件_链轮轴组_河南双志机械设备有限公司 | 网站建设-临朐爱采购-抖音运营-山东兆通网络科技 | 电线电缆厂家|沈阳电缆厂|电线厂|沈阳英联塑力线缆有限公司 | 定制异形重型钢格栅板/钢格板_定做踏步板/排水沟盖板_钢格栅板批发厂家-河北圣墨金属制品有限公司 | 回转炉,外热式回转窑,回转窑炉-淄博圣元窑炉工程有限公司 | hdpe土工膜-防渗膜-复合土工膜-长丝土工布价格-厂家直销「恒阳新材料」-山东恒阳新材料有限公司 ETFE膜结构_PTFE膜结构_空间钢结构_膜结构_张拉膜_浙江萬豪空间结构集团有限公司 | 二氧化碳/活性炭投加系统,次氯酸钠发生器,紫外线消毒设备|广州新奥 | pos机办理,智能/扫码/二维码/微信支付宝pos机-北京万汇通宝商贸有限公司 | 防水接头-电缆防水接头-金属-电缆密封接头-不锈钢电缆接头 | 上海刑事律师|刑事辩护律师|专业刑事犯罪辩护律师免费咨询-[尤辰荣]金牌上海刑事律师团队 | 工业机械三维动画制作 环保设备原理三维演示动画 自动化装配产线三维动画制作公司-南京燃动数字 聚合氯化铝_喷雾聚氯化铝_聚合氯化铝铁厂家_郑州亿升化工有限公司 | 铝机箱_铝外壳加工_铝外壳厂家_CNC散热器加工-惠州市铂源五金制品有限公司 | PVC地板|PVC塑胶地板|PVC地板厂家|地板胶|防静电地板-无锡腾方装饰材料有限公司-咨询热线:4008-798-128 | 风淋室生产厂家报价_传递窗|送风口|臭氧机|FFU-山东盛之源净化设备 | 杭州标识标牌|文化墙|展厅|导视|户内外广告|发光字|灯箱|铭阳制作公司 - 杭州标识标牌|文化墙|展厅|导视|户内外广告|发光字|灯箱|铭阳制作公司 | 污泥烘干机-低温干化机-工业污泥烘干设备厂家-焦作市真节能环保设备科技有限公司 | 水冷散热器_水冷电子散热器_大功率散热器_水冷板散热器厂家-河源市恒光辉散热器有限公司 | 道康宁消泡剂-瓦克-大川进口消泡剂供应商| ★济南领跃标识制作公司★济南标识制作,标牌制作,山东标识制作,济南标牌厂 | 卸料器-卸灰阀-卸料阀-瑞安市天蓝环保设备有限公司 | 江苏全风,高压风机,全风环保风机,全风环形高压风机,防爆高压风机厂家-江苏全风环保科技有限公司(官网) | 齿轮减速机_齿轮减速电机-VEMT蜗轮蜗杆减速机马达生产厂家瓦玛特传动瑞环机电 | 东莞ERP软件_广州云ERP_中山ERP_台湾工厂erp系统-广东顺景软件科技有限公司 | 通风天窗,通风气楼,屋顶通风天窗,屋顶通风天窗公司 | 亮化工程,亮化设计,城市亮化工程,亮化资质合作,长沙亮化照明,杰奥思【官网】 | Trimos测长机_测高仪_TESA_mahr,WYLER水平仪,PWB对刀仪-德瑞华测量技术(苏州)有限公司 | 国际金融网_每日财经新资讯网 | 北京租车公司_汽车/客车/班车/大巴车租赁_商务会议/展会用车/旅游大巴出租_北京桐顺创业租车公司 | 不锈钢轴流风机,不锈钢电机-许昌光维防爆电机有限公司(原许昌光维特种电机技术有限公司) |