當前位置: 首頁>>代碼示例>>PHP>>正文


PHP MongoDB::getProfilingLevel方法代碼示例

本文整理匯總了PHP中MongoDB::getProfilingLevel方法的典型用法代碼示例。如果您正苦於以下問題:PHP MongoDB::getProfilingLevel方法的具體用法?PHP MongoDB::getProfilingLevel怎麽用?PHP MongoDB::getProfilingLevel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MongoDB的用法示例。


在下文中一共展示了MongoDB::getProfilingLevel方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testGetSetProfilingLevel

 public function testGetSetProfilingLevel()
 {
     $created = $this->object->createCollection("system.profile", true, 5000);
     $prev = $this->object->setProfilingLevel(MongoDB::PROFILING_ON);
     $level = $this->object->getProfilingLevel();
     $this->assertEquals($level, MongoDB::PROFILING_ON);
     $prev = $this->object->setProfilingLevel(MongoDB::PROFILING_SLOW);
     $level = $this->object->getProfilingLevel();
     $this->assertEquals($level, MongoDB::PROFILING_SLOW);
     $this->assertEquals($prev, MongoDB::PROFILING_ON);
     $prev = $this->object->setProfilingLevel(MongoDB::PROFILING_OFF);
     $level = $this->object->getProfilingLevel();
     $this->assertEquals($level, MongoDB::PROFILING_OFF);
     $this->assertEquals($prev, MongoDB::PROFILING_SLOW);
     $prev = $this->object->setProfilingLevel(MongoDB::PROFILING_OFF);
     $this->assertEquals($prev, MongoDB::PROFILING_OFF);
 }
開發者ID:redmeadowman,項目名稱:mongo-php-driver,代碼行數:17,代碼來源:MongoDBTest.php

示例2: __construct

 /**
  * Constructor of DooMongoModel
  * @param string $dbName Name of the database
  * @param string $collectionName Name of the collection
  * @param DooMongo $mongo Mongo connection instance
  */
 public function __construct($dbName, $collectionName, $mongo = null)
 {
     $this->dbName = $dbName;
     $this->collectionName = $collectionName;
     if ($mongo === null) {
         $this->connection = DooMongo::getInstance();
         //Doo::conf()->mongodb;
     } else {
         $this->connection = $mongo;
     }
     $this->collection = $this->connection->selectCollection($dbName, $collectionName);
     $this->db = $this->connection->selectDB($dbName);
     //set debugging details;
     if ($this->connection->isDebugEnabled() === true) {
         if ($this->db->getProfilingLevel() < 1) {
             $this->db->setProfilingLevel($this->connection->getProfilingLevel());
         }
     }
 }
開發者ID:mindaugas-valinskis,項目名稱:doophp,代碼行數:25,代碼來源:DooMongoModel.php

示例3: getProfilingLevel

 /**
  * Wrapper method for MongoDB::getProfilingLevel().
  *
  * @see http://php.net/manual/en/mongodb.getprofilinglevel.php
  * @return integer
  */
 public function getProfilingLevel()
 {
     return $this->mongoDB->getProfilingLevel();
 }
開發者ID:alcaeus,項目名稱:mongodb,代碼行數:10,代碼來源:Database.php


注:本文中的MongoDB::getProfilingLevel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。