当前位置: 首页>>代码示例>>PHP>>正文


PHP Adapter::setProfiler方法代码示例

本文整理汇总了PHP中Zend\Db\Adapter\Adapter::setProfiler方法的典型用法代码示例。如果您正苦于以下问题:PHP Adapter::setProfiler方法的具体用法?PHP Adapter::setProfiler怎么用?PHP Adapter::setProfiler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\Db\Adapter\Adapter的用法示例。


在下文中一共展示了Adapter::setProfiler方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetProfiler

 /**
  * @testdox unit test: Test getProfiler() will store profiler
  * @covers Zend\Db\Adapter\Adapter::getProfiler
  */
 public function testGetProfiler()
 {
     $this->adapter->setProfiler($profiler = new Profiler\Profiler());
     $this->assertSame($profiler, $this->adapter->getProfiler());
     $adapter = new Adapter(array('driver' => $this->mockDriver, 'profiler' => true), $this->mockPlatform);
     $this->assertInstanceOf('Zend\\Db\\Adapter\\Profiler\\Profiler', $adapter->getProfiler());
 }
开发者ID:rajanlamic,项目名称:IntTest,代码行数:11,代码来源:AdapterTest.php

示例2: createService

 /**
  * Create db adapter service
  *
  * @param ServiceLocatorInterface $serviceLocator
  * @return Adapter
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $config = $serviceLocator->get('Config');
     $result = new Adapter($config['db']);
     if (defined('SCPPER_DEBUG')) {
         $profiler = new \Zend\Db\Adapter\Profiler\Profiler();
         $result->setProfiler($profiler);
         if ($result->getPlatform()->getName() === 'MySQL') {
             $result->query('SET SESSION query_cache_type=0;', Adapter::QUERY_MODE_EXECUTE);
         }
     }
     return $result;
 }
开发者ID:FiftyNine,项目名称:ScpperDB,代码行数:19,代码来源:DbAdapterFactory.php

示例3: createService

 /**
  * Create db adapter service
  *
  * @param ServiceLocatorInterface $serviceLocator
  * @return Adapter
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $config = $serviceLocator->get('Config');
     $adapter = new Adapter($config['db']);
     $authStorage = $serviceLocator->get('Sundew\\AuthStorage');
     $user = array();
     if (!$authStorage->isEmpty()) {
         $user = $authStorage->read();
     }
     $fileName = 'Query' . date('Ymd') . '.log';
     $logger = new SundewLogger($fileName, $user);
     $adapter->setProfiler($logger);
     return $adapter;
 }
开发者ID:khinmyatkyi,项目名称:Office_Management,代码行数:20,代码来源:SundewAdapterFactory.php

示例4: __invoke

 public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
 {
     $config = $container->get('config');
     $lachesisConfig = isset($config['lachesis']) ? $config['lachesis'] : ['enabled' => false];
     if (!isset($lachesisConfig['log_dir'])) {
         $lachesisConfig['log_dir'] = 'data/kharon/lachesis';
     }
     $enabled = isset($config['lachesis']['enabled']) ? (bool) $config['lachesis']['enabled'] : false;
     $adapter = new Adapter($config['db'] ?? []);
     if ($enabled == false) {
         return $adapter;
     }
     $data = [];
     if ($container->has('Request')) {
         $data = $this->prepareData($container->get('Request'));
     }
     $adapter->setProfiler(new Lachesis($lachesisConfig, $data));
     return $adapter;
 }
开发者ID:mt-olympus,项目名称:lachesis-zend,代码行数:19,代码来源:Factory.php

示例5: setProfiler

 public function setProfiler($profiler)
 {
     $this->adapter->setProfiler($profiler);
 }
开发者ID:emoveo,项目名称:sfm,代码行数:4,代码来源:DatabaseProvider.php

示例6: createOfficeBNCAdapter

 private function createOfficeBNCAdapter()
 {
     $officeAdapter = new \Zend\Db\Adapter\Adapter(array('driver' => 'Pdo_Mysql', 'driver_options' => array(\PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'"), 'dsn' => 'mysql:dbname=officebnc;host=192.168.1.200:3306', 'username' => 'sql_officevg', 'password' => '34w6ygwetgsdft_436ygbsvseB12433'));
     $officeAdapter->setProfiler(new \Zend\Db\Adapter\Profiler\Profiler());
     $officeSql = new \Zend\Db\Sql\Sql($officeAdapter);
     return array($officeAdapter, $officeSql);
 }
开发者ID:NguyenQuiDuong,项目名称:Funixtest,代码行数:7,代码来源:ToolController.php


注:本文中的Zend\Db\Adapter\Adapter::setProfiler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。