Skip to content

Commit 6eb2390

Browse files
committed
Merge branch 'onphp-master' into dialect-fix
Conflicts: doc/ChangeLog
2 parents a0bfd7f + bb3c499 commit 6eb2390

File tree

6 files changed

+59
-17
lines changed

6 files changed

+59
-17
lines changed

doc/ChangeLog

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
11
2011-11-21 Evgeny V. Kokovikhin
22

33
* core/DB/PostgresDialect.class.php, test/main/PostgresDialectTest.class.php:
4-
use mb_* string function for utf-8 strings
4+
use mb_* string function for utf-8 strings.
5+
6+
2011-11-18 Sergey S. Sergeev
7+
8+
* main/Utils/AMQP/AMQPConsumer.class.php,
9+
main/Utils/AMQP/AMQPDefaultConsumer.class.php,
10+
main/Utils/AMQP/Pecl/AMQPPeclChannel.class.php:
11+
handle the change of СonsumerTag implemented.
512

613
2011-11-18 Evgeny V. Kokovikhin
7-
8-
* main/Messages/TextMessage.class.php, main/Messages/TextFileReceiver.class.php :
9-
a bit optimize: don't needed to make Timestamp twice
1014

11-
2011-11-14 Dmitry V. Snezhinskiy
12-
15+
* main/Messages/TextMessage.class.php, main/Messages/TextFileReceiver.class.php:
16+
a bit optimize: don't needed to make Timestamp twice.
17+
18+
2011-11-17 Sergey S. Sergeev
19+
20+
* main/Base/LightMetaProperty.class.php: speed up insert or update operations,
21+
removes loading objects if property is lazy. Thanks to Alexander V. Solomatin.
22+
23+
2011-11-14 Dmitry V. Snezhinskiy
24+
1325
* main/Utils/AMQP/Pecl/AMQPPeclChannel.class.php :
14-
customize AMQPPeclChannel Exception. Author Evgenia T. Tekalin
26+
customize AMQPPeclChannel Exception. Author Evgenia T. Tekalin.
1527

1628
2011-11-14 Evgeny V. Kokovikhin
17-
29+
1830
* core/Cache/PeclMemcached.class.php, test/core/MemcachedTest.class.php :
19-
fix PeclMemcached working with wrong keys. Thanks to Nikita V. Konstantinov
31+
fix PeclMemcached working with wrong keys. Thanks to Nikita V. Konstantinov.
2032

2133
2011-10-31 Vasily M. Stashko
2234

main/Base/LightMetaProperty.class.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,17 @@ public function fillQuery(
358358
&& !$this->generic
359359
)
360360
return $query;
361-
362-
$value = $object->{$this->getter}();
361+
362+
$getter = $this->getter;
363+
364+
if (
365+
$this->relationId
366+
&& $this->strategyId == FetchStrategy::LAZY
367+
) {
368+
$getter = $getter.'Id';
369+
}
370+
371+
$value = $object->{$getter}();
363372

364373
if ($this->type == 'binary') {
365374
$query->set($this->columnName, new DBBinary($value));

main/Utils/AMQP/AMQPConsumer.class.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ public function handleConsumeOk($consumerTag);
4141
**/
4242
public function handleCancelOk($consumerTag);
4343

44+
/**
45+
* Called when the consumer is changed tag
46+
*
47+
* @param string $fromTag
48+
* @param string $toTag
49+
* @return void
50+
**/
51+
public function handleChangeConsumerTag($fromTag, $toTag);
52+
4453
/**
4554
* @return AMQPConsumer
4655
**/

main/Utils/AMQP/AMQPDefaultConsumer.class.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ public function handleDelivery(AMQPIncomingMessage $delivery)
7272
// no work to do
7373
}
7474

75+
/**
76+
* @return void
77+
**/
78+
public function handleChangeConsumerTag($fromTag, $toTag)
79+
{
80+
// no work to do
81+
}
82+
7583
/**
7684
* @return AMQPDefaultConsumer
7785
**/

main/Utils/AMQP/Pecl/AMQPPeclChannel.class.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,12 @@ public function getNextDelivery()
485485
}
486486

487487
$this->checkCommandResult(
488-
is_array($messages),
488+
is_array($messages) && !empty($messages),
489489
"Could not consume from queue"
490490
);
491491

492492
$message = array_shift($messages);
493+
493494
$incoming = AMQPIncomingMessage::spawn($message);
494495

495496
if ($this->consumer->getConsumerTag() === null) {
@@ -499,11 +500,9 @@ public function getNextDelivery()
499500
$this->consumer->getConsumerTag()
500501
!= $incoming->getConsumerTag()
501502
) {
502-
throw new WrongStateException(
503-
"Consumer change tag consumerTag="
504-
."{$this->consumer->getConsumerTag()}, "
505-
."message.consumerTag={$incoming->getConsumerTag()}, "
506-
."message.body={$incoming->getBody()}"
503+
$this->consumer->handleChangeConsumerTag(
504+
$this->consumer->getConsumerTag(),
505+
$incoming->getConsumerTag()
507506
);
508507
}
509508

test/main/Utils/AMQP/AMQPPeclTest.class.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ public function getCheckString()
3232
{
3333
return $this->checkString;
3434
}
35+
36+
public function handleChangeConsumerTag($fromTag, $toTag)
37+
{
38+
return;
39+
}
3540
}
3641

3742
class AMQPPeclTest extends TestCase

0 commit comments

Comments
 (0)