本文整理汇总了PHP中MongoDB::setProfilingLevel方法的典型用法代码示例。如果您正苦于以下问题:PHP MongoDB::setProfilingLevel方法的具体用法?PHP MongoDB::setProfilingLevel怎么用?PHP MongoDB::setProfilingLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MongoDB
的用法示例。
在下文中一共展示了MongoDB::setProfilingLevel方法的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);
}
示例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());
}
}
}
示例3: setProfilingLevel
/**
* Wrapper method for MongoDB::setProfilingLevel().
*
* @see http://php.net/manual/en/mongodb.setprofilinglevel.php
* @param integer $level
* @return integer
*/
public function setProfilingLevel($level)
{
return $this->mongoDB->setProfilingLevel($level);
}