getPID() public method

(PECL mongo >= 1.0.11) Gets the process ID
public getPID ( ) : integer
return integer Returns the PID of the MongoId.
コード例 #1
0
 public function testCreateWithString()
 {
     $original = '54203e08d51d4a1f868b456e';
     $id = new \MongoId($original);
     $this->assertSame($original, (string) $id);
     $this->assertSame(9127278, $id->getInc());
     $this->assertSame(1411399176, $id->getTimestamp());
     $this->assertSame(34335, $id->getPID());
 }
コード例 #2
0
ファイル: AssertMongoId.php プロジェクト: renatomefidf/sammui
 /**
  * @param $mongoId
  */
 public function assertMongoId($mongoId)
 {
     if (is_string($mongoId)) {
         $mongoId = new \MongoId($mongoId);
     }
     $this->assertTrue($mongoId instanceof \MongoId);
     $this->assertNotNull($mongoId->getPID());
     $this->assertNotNull($mongoId->getTimestamp());
     $this->assertNotNull($mongoId->getInc());
     $this->assertNotNull($mongoId->getHostname());
     $this->assertEquals(24, strlen($mongoId->{'$id'}));
 }
コード例 #3
0
 public function testGetPID()
 {
     $id = new MongoId();
     $pid1 = $id->getPID();
     $id = new MongoId();
     $pid2 = $id->getPID();
     $this->assertEquals($pid1, $pid2);
 }
コード例 #4
0
ファイル: mongo-type.php プロジェクト: isS/NoSQL
<?php

MongoId::getHostname();
MongoId::__toString();
MongoId::getTimestamp();
MongoId::isValid();
MongoId::__set_state();
MongoId::getInc();
MongoId::getPID();
$collection->save(array("ts" => new MongoDate()));
$start = new MongoDate(strtotime("2010-01-15 00:00:00"));
$end = new MongoDate(strtotime("2010-01-30 00:00:00"));
$collection->find(array("ts" => array('$gt' => $start, '$lte' => $end)));
$search = "V";
$where = array('name' => array('
	$regex' => new MongoRegex("/^{$search}/")));
$cursor = $collection->find($where);
$where = array('name' => array('$regex' => new MongoRegex("/^{$search}/i")));
$profile = array("username" => 'foobity', "pic" => new MongoBinData(file_get_contents("gravatar.jpg"), MongoBinData::GENERIC));
$connection->save($profile);
$people = $db->people;
$addresses = $db->addresses;
$myAddress = array("line 1" => '12 main sreet', 'line 2' => null, 'city' => 'beijing', 'state' => "vermont", 'country' => 'china');
$addresses->insert($myAddress);
$me = array('name' => 'fred', 'address' => $myAddress['_id']);
$people->insert($me);