updated MongoDbCommand Profiler output
This commit is contained in:
@ -97,11 +97,11 @@ class FindMongoCommand extends MongoDbCommand
|
||||
public function __toString()
|
||||
{
|
||||
if ($this->checkParams()) {
|
||||
$result = 'Collection: ' . $this->collection . PHP_EOL;
|
||||
$result = PHP_EOL . 'Collection: ' . $this->collection . PHP_EOL;
|
||||
ob_start();
|
||||
var_dump($this->condition);
|
||||
$condition = ob_get_clean();
|
||||
$result .= 'Condition: ' . $condition . PHP_EOL;
|
||||
$result .= 'Condition: ' . $condition;
|
||||
$result .= 'Type: FIND' . PHP_EOL;
|
||||
ob_start();
|
||||
var_dump($this->fields);
|
||||
@ -143,12 +143,12 @@ class CountMongoCommand extends MongoDbCommand
|
||||
public function __toString()
|
||||
{
|
||||
if ($this->checkParams()) {
|
||||
$result = 'Collection: ' . $this->collection . PHP_EOL;
|
||||
$result = PHP_EOL . 'Collection: ' . $this->collection . PHP_EOL;
|
||||
$result .= 'Type: COUNT' . PHP_EOL;
|
||||
ob_start();
|
||||
var_dump($this->condition);
|
||||
$condition = ob_get_clean();
|
||||
$result .= 'Condition: ' . $condition . PHP_EOL;
|
||||
$result .= 'Condition: ' . $condition;
|
||||
$result .= 'Limit: ' . $this->limit . PHP_EOL;
|
||||
$result .= 'Skip: ' . $this->skip . PHP_EOL;
|
||||
return $result;
|
||||
@ -199,12 +199,12 @@ class InsertMongoCommand extends MongoDbCommand
|
||||
public function __toString()
|
||||
{
|
||||
if ($this->checkParams()) {
|
||||
$result = 'Collection: ' . $this->collection . PHP_EOL;
|
||||
$result = PHP_EOL . 'Collection: ' . $this->collection . PHP_EOL;
|
||||
$result .= 'Type: INSERT' . PHP_EOL;
|
||||
ob_start();
|
||||
var_dump($this->data);
|
||||
$data = ob_get_clean();
|
||||
$result .= 'Data: ' . $data . PHP_EOL;
|
||||
$result .= 'Data: ' . $data;
|
||||
$mult = $this->multiple ? 'TRUE' : 'FALSE';
|
||||
$result .= 'Bulk insert: ' . $mult . PHP_EOL;
|
||||
$safe = $this->safe ? 'TRUE' : 'FALSE';
|
||||
@ -248,16 +248,16 @@ class UpdateMongoCommand extends MongoDbCommand
|
||||
public function __toString()
|
||||
{
|
||||
if ($this->checkParams()) {
|
||||
$result = 'Collection: ' . $this->collection . PHP_EOL;
|
||||
$result = PHP_EOL . 'Collection: ' . $this->collection . PHP_EOL;
|
||||
$result .= 'Type: UPDATE' . PHP_EOL;
|
||||
ob_start();
|
||||
var_dump($this->condition);
|
||||
$condition = ob_get_clean();
|
||||
$result .= 'Condition: ' . $condition . PHP_EOL;
|
||||
$result .= 'Condition: ' . $condition;
|
||||
ob_start();
|
||||
var_dump($this->data);
|
||||
$data = ob_get_clean();
|
||||
$result .= 'Data: ' . $data . PHP_EOL;
|
||||
$result .= 'Data: ' . $data;
|
||||
$mult = $this->multiple ? 'TRUE' : 'FALSE';
|
||||
$result .= 'Multiple fields: ' . $mult . PHP_EOL;
|
||||
$upsert = $this->upsert ? 'TRUE' : 'FALSE';
|
||||
@ -294,12 +294,12 @@ class RemoveMongoCommand extends MongoDbCommand
|
||||
public function __toString()
|
||||
{
|
||||
if ($this->checkParams()) {
|
||||
$result = 'Collection: ' . $this->collection . PHP_EOL;
|
||||
$result = PHP_EOL . 'Collection: ' . $this->collection . PHP_EOL;
|
||||
$result .= 'Type: REMOVE' . PHP_EOL;
|
||||
ob_start();
|
||||
var_dump($this->condition);
|
||||
$condition = ob_get_clean();
|
||||
$result .= 'Condition: ' . $condition . PHP_EOL;
|
||||
$result .= 'Condition: ' . $condition;
|
||||
$safe = $this->safe ? 'TRUE' : 'FALSE';
|
||||
$result .= 'Safe operation: ' . $safe . PHP_EOL;
|
||||
return $result;
|
||||
@ -335,12 +335,12 @@ class CommandMongoCommand extends MongoDbCommand
|
||||
public function __toString()
|
||||
{
|
||||
if ($this->checkParams()) {
|
||||
$result = 'Collection: ' . $this->collection . PHP_EOL;
|
||||
$result = PHP_EOL . 'Collection: ' . $this->collection . PHP_EOL;
|
||||
$result .= 'Type: COMMAND' . PHP_EOL;
|
||||
ob_start();
|
||||
var_dump($this->command);
|
||||
$command = ob_get_clean();
|
||||
$result .= 'Command: ' . $command . PHP_EOL;
|
||||
$result .= 'Command: ' . $command;
|
||||
return $result;
|
||||
} else {
|
||||
return 'Command properties not set';
|
||||
|
@ -330,7 +330,7 @@ class MongoDbCommandTest extends PHPUnit_Framework_TestCase
|
||||
$cmd = MongoCommandBuilder::factory(MongoCommandBuilder::COUNT, new CollectionMock());
|
||||
$cmd->bindParam('condition', array());
|
||||
$this->assertStringStartsWith('Collection: CollectionMock', $cmd->__toString());
|
||||
|
||||
|
||||
$cmd = MongoCommandBuilder::factory(MongoCommandBuilder::FIND, new CollectionMock());
|
||||
$cmd->bindParam('condition', array());
|
||||
$this->assertStringStartsWith('Collection: CollectionMock', $cmd->__toString());
|
||||
|
Reference in New Issue
Block a user