當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。