当前位置: 首页>>代码示例>>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;未经允许,请勿转载。