Browse files

Tweak the Code gen stuff to work on php 5.4 and Fedora 17, rebuilt the

bindings.  Added a composer file to allow packagist / composer use.
  • Loading branch information...
1 parent 5db6a3a commit 3f0d8413765b159cbf76434e2148a028aac04e24 @BraveSirRobin committed Jan 9, 2013
View
4 build.xml
@@ -26,8 +26,8 @@ Amqphp build system, can build to either "class per file" (CPF) or
</fileset>
<target name="clean">
- <delete dir="${builddir}" includeemptydirs="true" verbose="true" failonerror="true" />
- <delete dir="${build.tempdir}" includeemptydirs="true" verbose="true" failonerror="true" />
+ <delete dir="${builddir}" includeemptydirs="true" verbose="true" />
+ <delete dir="${build.tempdir}" includeemptydirs="true" verbose="true" />
</target>
View
8 build/nspf/amqphp.persistent.php
@@ -1,7 +1,7 @@
<?php
-namespace amqphp\persistent;
- class PChannel extends \amqphp\Channel implements \Serializable { public $suspendOnSerialize = false; public $resumeOnHydrate = false; private static $PersProps = array('chanId', 'flow', 'frameMax', 'confirmSeqs', 'confirmSeq', 'confirmMode', 'isOpen', 'callbackHandler', 'suspendOnSerialize', 'resumeOnHydrate', 'ackBuffer', 'ackHead', 'numPendAcks', 'ackFlag'); function serialize () { $data = array(); foreach (self::$PersProps as $k) { $data[$k] = $this->$k; } $data['consumers'] = array(); foreach ($this->consumers as $cons) { if ($cons[0] instanceof \Serializable && $cons[2] == 'READY') { $data['consumers'][] = $cons; } } return serialize($data); } function unserialize ($data) { $data = unserialize($data); foreach (self::$PersProps as $p) { $this->$p = $data[$p]; } foreach ($data['consumers'] as $i => $c) { $this->consumers[$i] = array($c[0], $c[1], $c[2], $c[3]); } } }
+namespace ${namespace};
class APCPersistenceHelper implements PersistenceHelper { private $data; private $uk; function setUrlKey ($k) { if (is_null($k)) { throw new \Exception("Url key cannot be null", 8260); } $this->uk = $k; } function getData () { return $this->data; } function setData ($data) { $this->data = $data; } private function getKey () { if (is_null($this->uk)) { throw new \Exception("Url key cannot be null", 8261); } return sprintf('apc.amqphp.%s.%s', getmypid(), $this->uk); } function save () { $k = $this->getKey(); return apc_store($k, $this->data); } function load () { $success = false; $this->data = apc_fetch($this->getKey(), $success); return $success; } function destroy () { return apc_delete($this->getKey()); } }
- use amqphp\protocol, amqphp\wire; class PConnection extends \amqphp\Connection implements \Serializable { const SOCK_NEW = 1; const SOCK_REUSED = 2; private static $BasicProps = array('capabilities', 'socketImpl', 'protoImpl', 'socketParams', 'vhost', 'frameMax', 'chanMax', 'signalDispatch', 'nextChan', 'unDelivered', 'unDeliverable', 'incompleteMethods', 'readSrc'); private $pHelper; public $pHelperImpl; private $stateFlag = 0; const ST_CONSTR = 1; const ST_UNSER = 2; const ST_SER = 4; final function __construct (array $params = array()) { $this->stateFlag |= self::ST_CONSTR; if (isset($params['heartbeat']) && $params['heartbeat'] > 0) { throw new \Exception("Persistent connections cannot use a heatbeat", 24803); } if (! array_key_exists('socketImpl', $params)) { $params['socketImpl'] = '\\amqphp\\StreamSocket'; } else if ($params['socketImpl'] != '\\amqphp\\StreamSocket') { throw new \Exception("Persistent connections must use the StreamSocket socket implementation", 24804); } if (! array_key_exists('socketFlags', $params)) { $params['socketFlags'] = array('STREAM_CLIENT_PERSISTENT'); } else if ( ! in_array('STREAM_CLIENT_PERSISTENT', $params['socketFlags'])) { $params['socketFlags'][] = 'STREAM_CLIENT_PERSISTENT'; } parent::__construct($params); } function connect () { if ($this->connected) { trigger_error("PConnection is connected already", E_USER_WARNING); return; } $this->initSocket(); $this->sock->connect(); if ($this->sock->isReusedPSock()) { $this->wakeup(); } else { $this->doConnectionStartup(); if ($ph = $this->getPersistenceHelper()) { $ph->destroy(); } } } function shutdown () { $ph = $this->getPersistenceHelper(); parent::shutdown(); if ($ph) { $ph->destroy(); } } protected function initNewChannel ($impl=null) { $impl = __NAMESPACE__ . "\\PChannel"; return parent::initNewChannel($impl); } private function getPersistenceHelper () { if (! $this->connected) { throw new \Exception("PConnection persistence helper cannot be created before the connection is open", 3789); } else if (! $this->pHelperImpl) { return false; } if (is_null($this->pHelper)) { $c = $this->pHelperImpl; $this->pHelper = new $c; if (! ($this->pHelper instanceof PersistenceHelper)) { throw new \Exception("PConnection persistence helper implementation is invalid", 26934); } $this->pHelper->setUrlKey($this->sock->getCK()); } return $this->pHelper; } function getPersistenceStatus () { if (! $this->connected) { return 0; } else if ($this->sock->isReusedPSock()) { return self::SOCK_REUSED; } else { return self::SOCK_NEW; } } function sleep () { if (! ($ph = $this->getPersistenceHelper())) { throw new \Exception("Failed to load a persistence helper during sleep", 10785); } $ph->setData($this->serialize()); $ph->save(); } function serialize () { $z = $data = array(); foreach ($this->chans as $chan) { if ($chan->suspendOnSerialize && ! $chan->isSuspended()) { $chan->toggleFlow(); } } $z[0] = $this->chans; foreach (self::$BasicProps as $k) { if (in_array($k, array('readSrc', 'incompleteMethods', 'unDelivered', 'unDeliverable')) && $this->$k) { trigger_error("PConnection will persist application data ({$k})", E_USER_WARNING); } $data[$k] = $this->$k; } $z[1] = $data; $this->stateFlag |= self::ST_SER; return serialize($z); } function unserialize ($serialised) { $data = unserialize($serialised); $rewake = false; if ($this->stateFlag & self::ST_UNSER) { throw new \Exception("PConnection is already unserialized", 2886); } else if (! ($this->stateFlag & self::ST_CONSTR)) { $this->__construct(); $rewake = true; } foreach (self::$BasicProps as $k) { $this->$k = $data[1][$k]; } if ($rewake) { $this->initSocket(); $this->sock->connect(); if (! $this->sock->isReusedPSock()) { throw new \Exception("Persisted connection woken up with a fresh socket connection", 9249); } foreach (self::$BasicProps as $k) { if ($k == 'vhost' && $data[1][$k] != $this->sock->getVHost()) { throw new \Exception("Persisted connection woken up as different VHost", 9250); } } $this->connected = true; } if (isset($data[0])) { $this->chans = $data[0]; foreach ($this->chans as $chan) { $chan->setConnection($this); } } $this->stateFlag |= self::ST_UNSER; foreach ($this->chans as $chan) { if ($chan->resumeOnHydrate && $chan->isSuspended()) { $chan->toggleFlow(); } } } private function wakeup () { $this->connected = true; if (! ($ph = $this->getPersistenceHelper())) { throw new \Exception("Failed to load persistence helper during wakeup", 1798); } if (! $ph->load()) { try { $e = null; $this->shutdown(); } catch (\Exception $e) { } throw new \Exception('Failed to reload amqp connection cache during wakeup', 8543, $e); } $this->unserialize($ph->getData()); } }
class FilePersistenceHelper implements PersistenceHelper { const TEMP_DIR = '/tmp'; private $data; private $uk; private $tmpDir = self::TEMP_DIR; function setUrlKey ($k) { if (is_null($k)) { throw new \Exception("Url key cannot be null", 8260); } $this->uk = $k; } function setTmpDir ($tmpDir) { $this->tmpDir = $tmpDir; } function getData () { return $this->data; } function setData ($data) { $this->data = $data; } function getTmpFile () { if (is_null($this->uk)) { throw new \Exception("Url key cannot be null", 8261); } return sprintf('%s%sapc.amqphp.%s.%s', $this->tmpDir, DIRECTORY_SEPARATOR, getmypid(), $this->uk); } function save () { return file_put_contents($this->getTmpFile(), (string) $this->data); } function load () { $this->data = file_get_contents($this->getTmpFile()); return ($this->data !== false); } function destroy () { return @unlink($this->getTmpFile()); } }
- interface PersistenceHelper { function setUrlKey ($k); function getData (); function setData ($data); function save (); function load (); function destroy (); }
+ interface PersistenceHelper { function setUrlKey ($k); function getData (); function setData ($data); function save (); function load (); function destroy (); }
+ use amqphp\protocol, amqphp\wire; class PConnection extends \amqphp\Connection implements \Serializable { const SOCK_NEW = 1; const SOCK_REUSED = 2; private static $BasicProps = array('capabilities', 'socketImpl', 'protoImpl', 'socketParams', 'vhost', 'frameMax', 'chanMax', 'signalDispatch', 'nextChan', 'unDelivered', 'unDeliverable', 'incompleteMethods', 'readSrc'); private $pHelper; public $pHelperImpl; private $stateFlag = 0; const ST_CONSTR = 1; const ST_UNSER = 2; const ST_SER = 4; final function __construct (array $params = array()) { $this->stateFlag |= self::ST_CONSTR; if (isset($params['heartbeat']) && $params['heartbeat'] > 0) { throw new \Exception("Persistent connections cannot use a heatbeat", 24803); } if (! array_key_exists('socketImpl', $params)) { $params['socketImpl'] = '\\amqphp\\StreamSocket'; } else if ($params['socketImpl'] != '\\amqphp\\StreamSocket') { throw new \Exception("Persistent connections must use the StreamSocket socket implementation", 24804); } if (! array_key_exists('socketFlags', $params)) { $params['socketFlags'] = array('STREAM_CLIENT_PERSISTENT'); } else if ( ! in_array('STREAM_CLIENT_PERSISTENT', $params['socketFlags'])) { $params['socketFlags'][] = 'STREAM_CLIENT_PERSISTENT'; } parent::__construct($params); } function connect () { if ($this->connected) { trigger_error("PConnection is connected already", E_USER_WARNING); return; } $this->initSocket(); $this->sock->connect(); if ($this->sock->isReusedPSock()) { $this->wakeup(); } else { $this->doConnectionStartup(); if ($ph = $this->getPersistenceHelper()) { $ph->destroy(); } } } function shutdown () { $ph = $this->getPersistenceHelper(); parent::shutdown(); if ($ph) { $ph->destroy(); } } protected function initNewChannel ($impl=null) { $impl = __NAMESPACE__ . "\\PChannel"; return parent::initNewChannel($impl); } private function getPersistenceHelper () { if (! $this->connected) { throw new \Exception("PConnection persistence helper cannot be created before the connection is open", 3789); } else if (! $this->pHelperImpl) { return false; } if (is_null($this->pHelper)) { $c = $this->pHelperImpl; $this->pHelper = new $c; if (! ($this->pHelper instanceof PersistenceHelper)) { throw new \Exception("PConnection persistence helper implementation is invalid", 26934); } $this->pHelper->setUrlKey($this->sock->getCK()); } return $this->pHelper; } function getPersistenceStatus () { if (! $this->connected) { return 0; } else if ($this->sock->isReusedPSock()) { return self::SOCK_REUSED; } else { return self::SOCK_NEW; } } function sleep () { if (! ($ph = $this->getPersistenceHelper())) { throw new \Exception("Failed to load a persistence helper during sleep", 10785); } $ph->setData($this->serialize()); $ph->save(); } function serialize () { $z = $data = array(); foreach ($this->chans as $chan) { if ($chan->suspendOnSerialize && ! $chan->isSuspended()) { $chan->toggleFlow(); } } $z[0] = $this->chans; foreach (self::$BasicProps as $k) { if (in_array($k, array('readSrc', 'incompleteMethods', 'unDelivered', 'unDeliverable')) && $this->$k) { trigger_error("PConnection will persist application data ({$k})", E_USER_WARNING); } $data[$k] = $this->$k; } $z[1] = $data; $this->stateFlag |= self::ST_SER; return serialize($z); } function unserialize ($serialised) { $data = unserialize($serialised); $rewake = false; if ($this->stateFlag & self::ST_UNSER) { throw new \Exception("PConnection is already unserialized", 2886); } else if (! ($this->stateFlag & self::ST_CONSTR)) { $this->__construct(); $rewake = true; } foreach (self::$BasicProps as $k) { $this->$k = $data[1][$k]; } if ($rewake) { $this->initSocket(); $this->sock->connect(); if (! $this->sock->isReusedPSock()) { throw new \Exception("Persisted connection woken up with a fresh socket connection", 9249); } foreach (self::$BasicProps as $k) { if ($k == 'vhost' && $data[1][$k] != $this->sock->getVHost()) { throw new \Exception("Persisted connection woken up as different VHost", 9250); } } $this->connected = true; } if (isset($data[0])) { $this->chans = $data[0]; foreach ($this->chans as $chan) { $chan->setConnection($this); } } $this->stateFlag |= self::ST_UNSER; foreach ($this->chans as $chan) { if ($chan->resumeOnHydrate && $chan->isSuspended()) { $chan->toggleFlow(); } } } private function wakeup () { $this->connected = true; if (! ($ph = $this->getPersistenceHelper())) { throw new \Exception("Failed to load persistence helper during wakeup", 1798); } if (! $ph->load()) { try { $e = null; $this->shutdown(); } catch (\Exception $e) { } throw new \Exception('Failed to reload amqp connection cache during wakeup', 8543, $e); } $this->unserialize($ph->getData()); } }
+ class PChannel extends \amqphp\Channel implements \Serializable { public $suspendOnSerialize = false; public $resumeOnHydrate = false; private static $PersProps = array('chanId', 'flow', 'frameMax', 'confirmSeqs', 'confirmSeq', 'confirmMode', 'isOpen', 'callbackHandler', 'suspendOnSerialize', 'resumeOnHydrate', 'ackBuffer', 'ackHead', 'numPendAcks', 'ackFlag'); function serialize () { $data = array(); foreach (self::$PersProps as $k) { $data[$k] = $this->$k; } $data['consumers'] = array(); foreach ($this->consumers as $cons) { if ($cons[0] instanceof \Serializable && $cons[2] == 'READY') { $data['consumers'][] = $cons; } } return serialize($data); } function unserialize ($data) { $data = unserialize($data); foreach (self::$PersProps as $p) { $this->$p = $data[$p]; } foreach ($data['consumers'] as $i => $c) { $this->consumers[$i] = array($c[0], $c[1], $c[2], $c[3]); } } }
View
24 build/nspf/amqphp.php
@@ -1,16 +1,16 @@
<?php
-namespace amqphp;
- use amqphp\protocol, amqphp\wire, \amqphp\persistent as pers; class EventLoop { const HB_TMOBUFF = 50000; private $cons = array(); private static $In = false; private $forceExit = false; private $minHb = -1; function addConnection (Connection $conn) { $this->cons[$conn->getSocketId()] = $conn; $this->setMinHb(); } private function setMinHb () { if ($this->cons) { foreach ($this->cons as $c) { if ((($n = $c->getHeartbeat()) > 0) && $n > $this->minHb) { $this->minHb = $n; } } } else { $this->minHb = -1; } } function removeConnection (Connection $conn) { if (array_key_exists($conn->getSocketId(), $this->cons)) { unset($this->cons[$conn->getSocketId()]); } $this->setMinHb(); } function forceLoopExit () { $this->forceExit = true; } function select () { $sockImpl = false; foreach ($this->cons as $c) { if ($c->isBlocking()) { throw new \Exception("Event loop cannot start - connection is already blocking", 3267); } if ($sockImpl === false) { $sockImpl = $c->getSocketImplClass(); } else if ($sockImpl != $c->getSocketImplClass()) { throw new \Exception("Event loop doesn't support mixed socket implementations", 2678); } if (! $c->isConnected()) { throw new \Exception("Connection is not connected", 2174); } } foreach ($this->cons as $c) { $c->setBlocking(true); $c->notifySelectInit(); } $started = false; $missedHb = 0; while (true) { $tv = array(); foreach ($this->cons as $cid => $c) { $c->deliverAll(); $tv[] = array($cid, $c->notifyPreSelect()); } $psr = $this->processPreSelects($tv); if (is_array($psr)) { list($tvSecs, $tvUsecs) = $psr; } else if ($psr === true) { $tvSecs = null; $tvUsecs = 0; } else if (is_null($psr) && empty($this->cons)) { if (! $started) { trigger_error("Select loop not entered - no connections are listening", E_USER_WARNING); } break; } else { throw new \Exception("Unexpected PSR response", 2758); } $this->signal(); if ($this->forceExit) { trigger_error("Select loop forced exit over-rides connection looping state", E_USER_WARNING); $this->forceExit = false; break; } $started = true; $selectCalledAt = microtime(); if (is_null($tvSecs)) { list($ret, $read, $ex) = call_user_func(array($sockImpl, 'Zelekt'), array_keys($this->cons), null, 0); } else { list($ret, $read, $ex) = call_user_func(array($sockImpl, 'Zelekt'), array_keys($this->cons), $tvSecs, $tvUsecs); } if ($ret === false) { $this->signal(); $errNo = $errStr = array('(No specific socket exceptions found)'); if ($ex) { $errNo = $errStr = array(); foreach ($ex as $sock) { $errNo[] = $sock->lastError(); $errStr[] = $sock->strError(); } } $eMsg = sprintf("[2] Read block select produced an error: [%s] (%s)", implode(",", $errNo), implode("),(", $errStr)); throw new \Exception ($eMsg, 9963); } else if ($ret > 0) { $missedHb = 0; foreach ($read as $sock) { $c = $this->cons[$sock->getId()]; try { $c->doSelectRead(); $c->deliverAll(); } catch (\Exception $e) { if ($sock->lastError()) { trigger_error("Exception raised on socket {$sock->getId()} during " . "event loop read (nested exception follows). Socket indicates an error, " . "close the connection immediately. Nested exception: '{$e->getMessage()}'", E_USER_WARNING); try { $c->shutdown(); } catch (\Exception $e) { trigger_error("Nested exception swallowed during emergency socket " . "shutdown: '{$e->getMessage()}'", E_USER_WARNING); } $this->removeConnection($c); } else { trigger_error("Exception raised on socket {$sock->getId()} during " . "event loop read (nested exception follows). Socket does NOT " . "indicate an error, try again. Nested exception: '{$e->getMessage()}'", E_USER_WARNING); } } } } else { if ($this->minHb > 0) { list($stUsecs, $stSecs) = explode(' ', $selectCalledAt); list($usecs, $secs) = explode(' ', microtime()); if (($secs + $usecs) - ($stSecs + $stUsecs) > $this->minHb) { if (++$missedHb >= 2) { throw new \Exception("Broker missed too many heartbeats", 2957); } else { trigger_error("Broker heartbeat missed from client side, one more triggers loop exit", E_USER_WARNING); } } } } } foreach ($this->cons as $id => $conn) { $conn->notifyComplete(); $conn->setBlocking(false); $this->removeConnection($conn); } } private function processPreSelects (array $tvs) { $wins = null; foreach ($tvs as $tv) { $sid = $tv[0]; $tv = $tv[1]; if ($tv === false) { $this->cons[$sid]->notifyComplete(); $this->cons[$sid]->setBlocking(false); $this->removeConnection($this->cons[$sid]); } else if (is_null($wins)) { $wins = $tv; } else if ($tv === true && ! is_array($wins)) { $wins = true; } else if (is_array($tv)) { if ($wins === true) { $wins = $tv; } else { switch (bccomp((string) $wins[0], (string) $tv[0])) { case 0: if (1 === bccomp((string) $wins[1], (string) $tv[1])) { $wins = $tv; } break; case 1; $wins = $tv; break; } } } } if ($wins && ($this->minHb > 0) && ($wins === true || $wins[0] > $this->minHb || ($wins[0] == $this->minHb && $wins[1] < self::HB_TMOBUFF)) ) { $wins = array($this->minHb, self::HB_TMOBUFF); } return $wins; } private function signal () { foreach ($this->cons as $c) { if ($c->getSignalDispatch()) { pcntl_signal_dispatch(); return; } } } }
- interface ExitStrategy { function configure ($sMode); function init (Connection $conn); function preSelect ($prev=null); function complete (); }
- class MaxloopExitStrategy implements ExitStrategy { private $maxLoops; private $nLoops; function configure ($sMode, $ml=null) { if (! (is_int($ml) || is_numeric($ml)) || $ml == 0) { trigger_error("Select mode - invalid maxloops params : '$ml'", E_USER_WARNING); return false; } else { $this->maxLoops = (int) $ml; return true; } } function init (Connection $conn) { $this->nLoops = 0; } function preSelect ($prev=null) { if ($prev === false) { return false; } if (++$this->nLoops > $this->maxLoops) { return false; } else { return $prev; } } function complete () {} }
- class Channel { protected $myConn; protected $chanId; protected $flow = true; private $destroyed = false; protected $frameMax; protected $isOpen = false; protected $consumers = array(); protected $callbackHandler; protected $confirmSeqs = array(); protected $confirmSeq = 0; protected $confirmMode = false; public $ackBuffer = 1; protected $ackHead; protected $numPendAcks = 0; protected $ackFlag; function setEventHandler (ChannelEventHandler $evh) { $this->callbackHandler = $evh; } function hasOutstandingConfirms () { return (bool) $this->confirmSeqs; } function setConfirmMode () { if ($this->confirmMode) { return; } $confSelect = $this->confirm('select'); $confSelectOk = $this->invoke($confSelect); if (! ($confSelectOk instanceof wire\Method) || $confSelectOk->amqpClass != 'confirm.select-ok') { throw new \Exception("Failed to set confirm mode", 8674); } $this->confirmMode = true; } function setConnection (Connection $rConn) { $this->myConn = $rConn; } function setChanId ($chanId) { $this->chanId = $chanId; } function getChanId () { return $this->chanId; } function setFrameMax ($frameMax) { $this->frameMax = $frameMax; } function initChannel () { $pl = $this->myConn->getProtocolLoader(); $meth = new wire\Method($pl('ClassFactory', 'GetMethod', array('channel', 'open')), $this->chanId); $meth->setField('reserved-1', ''); $resp = $this->myConn->invoke($meth); } function __call ($class, $args) { if ($this->destroyed) { throw new \Exception("Attempting to use a destroyed channel", 8766); } $m = $this->myConn->constructMethod($class, $args); $m->setWireChannel($this->chanId); $m->setMaxFrameSize($this->frameMax); return $m; } function invoke (wire\Method $m) { if ($this->destroyed) { throw new \Exception("Attempting to use a destroyed channel", 8767); } else if (! $this->flow) { trigger_error("Channel is closed", E_USER_WARNING); return; } else if (is_null($tmp = $m->getWireChannel())) { $m->setWireChannel($this->chanId); } else if ($tmp != $this->chanId) { throw new \Exception("Method is invoked through the wrong channel", 7645); } if ($this->confirmMode && $m->amqpClass == 'basic.publish') { $this->confirmSeq++; $this->confirmSeqs[$this->confirmSeq] = $m; } return $this->myConn->invoke($m); } function handleChannelMessage (wire\Method $meth) { switch ($meth->amqpClass) { case 'channel.flow': $this->flow = ! $this->flow; if ($r = $meth->getMethodProto()->getResponses()) { $meth = new wire\Method($r[0], $this->chanId); $this->invoke($meth); } return false; case 'channel.close': $pl = $this->myConn->getProtocolLoader(); if ($culprit = $pl('ClassFactory', 'GetMethod', array($meth->getField('class-id'), $meth->getField('method-id')))) { $culprit = $culprit->getSpecName(); } else { $culprit = '(Unknown or unspecified)'; } $errCode = $pl('ProtoConsts', 'Konstant', array($meth->getField('reply-code'))); $eb = ''; foreach ($meth->getFields() as $k => $v) { $eb .= sprintf("(%s=%s) ", $k, $v); } $tmp = $meth->getMethodProto()->getResponses(); $closeOk = new wire\Method($tmp[0], $this->chanId); $em = "[channel.close] reply-code={$errCode['name']} triggered by $culprit: $eb"; try { $this->myConn->invoke($closeOk); $em .= " Channel closed OK"; $n = 3687; } catch (\Exception $e) { $em .= " Additionally, channel closure ack send failed"; $n = 2435; } throw new \Exception($em, $n); case 'channel.close-ok': case 'channel.open-ok': case 'channel.flow-ok': return true; default: throw new \Exception("Received unexpected channel message: {$meth->amqpClass}", 8795); } } function handleChannelDelivery (wire\Method $meth) { switch ($meth->amqpClass) { case 'basic.deliver': return $this->deliverConsumerMessage($meth); case 'basic.return': if ($this->callbackHandler) { $this->callbackHandler->publishReturn($meth); } return false; case 'basic.ack': $this->removeConfirmSeqs($meth, 'publishConfirm'); return false; case 'basic.nack': $this->removeConfirmSeqs($meth, 'publishNack'); return false; case 'basic.cancel': $this->handleConsumerCancel($meth); break; default: throw new \Exception("Received unexpected channel delivery:\n{$meth->amqpClass}", 87998); } } private function handleConsumerCancel ($meth) { $ctag = $meth->getField('consumer-tag'); list($cons, $status,) = $this->getConsumerAndStatus($ctag); if ($cons && $status == 'READY') { $cons->handleCancel($meth, $this); $this->setConsumerStatus($ctag, 'CLOSED') OR trigger_error("Failed to set consumer status flag (2)", E_USER_WARNING); if (! $meth->getField('no-wait')) { $this->invoke($this->basic('cancel-ok', array('consumer-tag', $ctag))); } } else if ($cons) { $m = sprintf("Cancellation message delivered to closed consumer %s", $ctag); trigger_error($m, E_USER_WARNING); } else { $m = sprintf("Unable to load consumer for consumer cancellation %s", $ctag); trigger_error($m, E_USER_WARNING); } } private function deliverConsumerMessage ($meth) { $ctag = $meth->getField('consumer-tag'); $response = false; list($cons, $status, $consParams) = $this->getConsumerAndStatus($ctag); if ($cons && $status == 'READY') { $response = $cons->handleDelivery($meth, $this); } else if ($cons) { $m = sprintf("Message delivered to closed consumer %s in non-ready state %s -- reject %s", $ctag, $status, $meth->getField('delivery-tag')); trigger_error($m, E_USER_WARNING); $response = CONSUMER_REJECT; } else { $m = sprintf("Unable to load consumer for delivery %s -- reject %s", $ctag, $meth->getField('delivery-tag')); trigger_error($m, E_USER_WARNING); $response = CONSUMER_REJECT; } if (! $response) { return; } if (! is_array($response)) { $response = array($response); } $shouldAck = (! array_key_exists('no-ack', $consParams) || ! $consParams['no-ack']); foreach ($response as $resp) { switch ($resp) { case CONSUMER_ACK: if ($shouldAck) { $this->ack($meth, CONSUMER_ACK); } break; case CONSUMER_DROP: case CONSUMER_REJECT: if ($shouldAck) { $this->ack($meth, $resp); } break; case CONSUMER_CANCEL: $this->removeConsumerByTag($cons, $ctag); break; default: trigger_error("Invalid consumer response $resp - consumers must " . 'respond with either a single consumer flag, multiple ' . 'consumer flags, or an empty response', E_USER_WARNING); } } return false; } private function ack ($meth, $action) { if (is_null($this->ackFlag)) { $this->ackFlag = $action; } else if ($action != $this->ackFlag) { $this->flushAcks(); $this->ackFlag = $action; } $this->ackHead = $meth->getField('delivery-tag'); $this->numPendAcks++; if ($this->numPendAcks >= $this->ackBuffer) { $this->flushAcks(); } } private function flushAcks () { if (is_null($this->ackFlag)) { return; } switch ($this->ackFlag) { case CONSUMER_ACK: $ack = $this->basic('ack', array('delivery-tag' => $this->ackHead, 'multiple' => ($this->ackBuffer > 1))); $this->invoke($ack); break; case CONSUMER_REJECT: case CONSUMER_DROP: $rej = $this->basic('nack', array('delivery-tag' => $this->ackHead, 'multiple' => ($this->ackBuffer > 1), 'requeue' => ($this->ackFlag == CONSUMER_REJECT))); $this->invoke($rej); break; default: throw new \Exception("Internal (n)ack tracking state error", 2956); } $this->ackFlag = $this->ackHead = null; $this->numPendAcks = 0; } private function removeConfirmSeqs (wire\Method $meth, $event) { if (! $this->callbackHandler) { trigger_error("Received publish confirmations with no channel event handler in place", E_USER_WARNING); return; } $dtag = $meth->getField('delivery-tag'); if ($meth->getField('multiple')) { foreach (array_keys($this->confirmSeqs) as $sk) { if ($sk <= $dtag) { $this->callbackHandler->$event($this->confirmSeqs[$sk]); unset($this->confirmSeqs[$sk]); } } } else { if (array_key_exists($dtag, $this->confirmSeqs)) { $this->callbackHandler->$event($this->confirmSeqs[$dtag]); unset($this->confirmSeqs[$dtag]); } } } function shutdown () { if (! $this->invoke($this->channel('close', array('reply-code' => '', 'reply-text' => '')))) { trigger_error("Unclean channel shutdown", E_USER_WARNING); } $this->myConn->removeChannel($this); $this->destroyed = true; $this->myConn = $this->chanId = $this->ticket = null; } function addConsumer (Consumer $cons, array $cParams=null) { $this->consumers[] = array($cons, false, 'READY_WAIT', $cParams); } function canListen () { return $this->hasListeningConsumers() || $this->hasOutstandingConfirms(); } function removeConsumer (Consumer $cons) { foreach ($this->consumers as $c) { if ($c[0] === $cons) { if ($c[2] == 'READY') { $this->removeConsumerByTag($c[0], $c[1]); } return; } } trigger_error("Consumer does not belong to this Channel", E_USER_WARNING); } function removeAllConsumers () { foreach ($this->consumers as $c) { if ($c[2] == 'READY') { $this->removeConsumerByTag($c[0], $c[1]); } } } private function removeConsumerByTag (Consumer $cons, $ctag) { list(, $cstate,) = $this->getConsumerAndStatus($ctag); if ($cstate == 'CLOSED') { trigger_error("Consumer is already removed", E_USER_WARNING); return; } $cnl = $this->basic('cancel', array('consumer-tag' => $ctag, 'no-wait' => false)); $cOk = $this->invoke($cnl); if ($cOk->amqpClass == 'basic.cancel-ok') { $this->setConsumerStatus($ctag, 'CLOSED') OR trigger_error("Failed to set consumer status flag", E_USER_WARNING); } else { throw new \Exception("Failed to cancel consumer - bad broker response", 9768); } $cons->handleCancelOk($cOk, $this); } private function setConsumerStatus ($tag, $status) { foreach ($this->consumers as $k => $c) { if ($c[1] === $tag) { $this->consumers[$k][2] = $status; return true; } } return false; } private function getConsumerAndStatus ($tag) { foreach ($this->consumers as $c) { if ($c[1] == $tag) { return array($c[0], $c[2], $c[3]); } } return array(null, 'INVALID', null); } function hasListeningConsumers () { foreach ($this->consumers as $c) { if ($c[2] === 'READY') { return true; } } return false; } function getConsumerByTag ($t) { foreach ($this->consumers as $c) { if ($c[2] == 'READY' && $c[1] === $t) { return $c[0]; } } } function getConsumerTags () { $tags = array(); foreach ($this->consumers as $c) { if ($c[2] == 'READY') { $tags[] = $c[1]; } } return $tags; } function startAllConsumers () { if (! $this->consumers) { return false; } $r = false; foreach (array_keys($this->consumers) as $cnum) { if (false === $this->consumers[$cnum][1]) { $this->_startConsumer($cnum); $r = true; } } return $r; } private function _startConsumer ($cnum) { $consume = false; if (($consume = $this->consumers[$cnum][0]->getConsumeMethod($this)) && ! ($consume instanceof wire\Method)) { trigger_error("Consumer returned invalid consume method", E_USER_WARNING); $consume = false; } if (! $consume && is_array($this->consumers[$cnum][3])) { $consume = $this->basic('consume', $this->consumers[$cnum][3]); } if (! $consume) { throw new \Exception("Couldn't find any consume paramters while starting consumer", 9265); } $cOk = $this->invoke($consume); $this->consumers[$cnum][0]->handleConsumeOk($cOk, $this); $this->consumers[$cnum][2] = 'READY'; $this->consumers[$cnum][1] = $cOk->getField('consumer-tag'); $this->consumers[$cnum][3] = $consume->getFields(); } function startConsumer (Consumer $cons) { foreach ($this->consumers as $i => $c) { if ($c[0] === $cons && $c[1] === false) { $this->_startConsumer($i); return true; } } return false; } function onSelectEnd () { $this->flushAcks(); $this->consuming = false; } function isSuspended () { return ! $this->flow; } function toggleFlow () { $flow = ! $this->flow; $this->flow = true; $meth = $this->channel('flow', array('active' => $flow)); $fr = $this->invoke($meth); $newFlow = $fr->getField('active'); if ($newFlow != $flow) { trigger_error(sprintf("Flow Unexpected channel flow response, expected %d, got %d", ! $this->flow, $this->flow), E_USER_WARNING); } $this->flow = $newFlow; } }
- class Factory { const XML_FILE = 1; const XML_STRING = 2; private static $RC_CACHE = array(); private $simp; private $rootEl; function __construct ($xml, $documentURI=false, $flag=self::XML_FILE) { $d = new \DOMDocument; switch ($flag) { case self::XML_FILE: if (! $d->load($xml)) { throw new \Exception("Failed to load factory XML", 92656); } break; case self::XML_STRING: if (! $d->loadXML($xml)) { throw new \Exception("Failed to load factory XML", 92656); } if ($documentURI) { $d->documentURI = $documentURI; } break; default: throw new \Exception("Invalid construct flag", 95637); } if (-1 === $d->xinclude()) { throw new \Exception("Failed to load factory XML", 92657); } else if (! ($this->simp = simplexml_import_dom($d))) { throw new \Exception("Failed to load factory XML", 92658); } switch ($tmp = strtolower((string) $this->simp->getName())) { case 'setup': case 'methods': $this->rootEl = $tmp; break; default: throw new \Exception("Unexpected Factory configuration data root element", 17893); } } function run (Channel $chan=null) { switch ($this->rootEl) { case 'setup': return $this->runSetupSequence(); case 'methods': if (is_null($chan)) { throw new \Exception("Invalid factory configuration - expected a target channel", 15758); } return $this->runMethodSequence($chan, $this->simp->xpath('/methods/method')); } } function getConnections () { $r = array(); foreach ($this->run() as $res) { if ($res instanceof Connection) { $r[] = $res; } } return $r; } private function callProperties ($subj, $conf) { foreach ($conf->xpath('./set_properties/*') as $prop) { $pname = (string) $prop->getName(); $pval = $this->kast($prop, $prop['k']); $subj->$pname = $pval; } } private function runSetupSequence () { $ret = array(); foreach ($this->simp->connection as $conn) { $_chans = array(); $refl = $this->getRc((string) $conn->impl); $_conn = $refl->newInstanceArgs($this->xmlToArray($conn->constr_args->children())); $this->callProperties($_conn, $conn); $_conn->connect(); $ret[] = $_conn; if (count($conn->exit_strats) > 0) { foreach ($conn->exit_strats->strat as $strat) { call_user_func_array(array($_conn, 'pushExitStrategy'), $this->xmlToArray($strat->children())); } } if ($_conn instanceof pers\PConnection && $_conn->getPersistenceStatus() == pers\PConnection::SOCK_REUSED) { continue; } foreach ($conn->channel as $chan) { $_chan = $_conn->openChannel(); $this->callProperties($_chan, $chan); if (isset($chan->event_handler)) { $impl = (string) $chan->event_handler->impl; if (count($chan->event_handler->constr_args)) { $refl = $this->getRc($impl); $_evh = $refl->newInstanceArgs($this->xmlToArray($chan->event_handler->constr_args->children())); } else { $_evh = new $impl; } $_chan->setEventHandler($_evh); } $_chans[] = $_chan; $rMeths = $chan->xpath('.//method'); if (count($rMeths) > 0) { $ret[] = $this->runMethodSequence($_chan, $rMeths); } if (count($chan->confirm_mode) > 0 && $this->kast($chan->confirm_mode, 'boolean')) { $_chan->setConfirmMode(); } } $i = 0; foreach ($conn->channel as $chan) { $_chan = $_chans[$i++]; foreach ($chan->consumer as $cons) { $impl = (string) $cons->impl; if (count($cons->constr_args)) { $refl = $this->getRc($impl); $_cons = $refl->newInstanceArgs($this->xmlToArray($cons->constr_args->children())); } else { $_cons = new $impl; } $this->callProperties($_cons, $cons); $_chan->addConsumer($_cons); if (isset($cons->autostart) && $this->kast($cons->autostart, 'boolean')) { $_chan->startConsumer($_cons); } } } } return $ret; } private function runMethodSequence (Channel $chan, array $meths) { $r = array(); foreach ($meths as $iMeth) { $a = $this->xmlToArray($iMeth); $c = $a['a_class']; $r[] = $chan->invoke($chan->$c($a['a_method'], $a['a_args'])); } return $r; } private function kast ($val, $cast) { switch ($cast) { case 'string': return (string) $val; case 'bool': case 'boolean': $val = trim((string) $val); if ($val === '0' || strtolower($val) === 'false') { return false; } else if ($val === '1' || strtolower($val) === 'true') { return true; } else { trigger_error("Bad boolean cast $val - use 0/1 true/false", E_USER_WARNING); return true; } case 'int': case 'integer': return (int) $val; case 'const': return constant((string) $val); case 'eval': return eval((string) $val); default: trigger_error("Unknown Kast $cast", E_USER_WARNING); return (string) $val; } } private function xmlToArray (\SimpleXmlElement $e) { $ret = array(); foreach ($e as $c) { $ret[(string) $c->getName()] = (count($c) == 0) ? $this->kast($c, (string) $c['k']) : $this->xmlToArray($c); } return $ret; } private function getRc ($class) { return array_key_exists($class, self::$RC_CACHE) ? self::$RC_CACHE[$class] : (self::$RC_CACHE[$class] = new \ReflectionClass($class)); } }
- const DEBUG = false; const PROTOCOL_HEADER = "AMQP\x00\x00\x09\x01"; const STRAT_TIMEOUT_ABS = 1; const STRAT_TIMEOUT_REL = 2; const STRAT_MAXLOOPS = 3; const STRAT_CALLBACK = 4; const STRAT_COND = 5; const CONSUMER_ACK = 1; const CONSUMER_REJECT = 2; const CONSUMER_DROP = 3; const CONSUMER_CANCEL = 4; class Connection { public static $ClientProperties = array( 'product' => ' BraveSirRobin/amqphp', 'version' => '0.9.3', 'platform' => 'PHP 5.3 +', 'copyright' => 'Copyright (c) 2010,2011,2012 Robin Harvey (harvey.robin@gmail.com)', 'information' => 'This software is released under the terms of the GNU LGPL: http://www.gnu.org/licenses/lgpl-3.0.txt', 'capabilities' => array('exchange_exchange_bindings' => true, 'consumer_cancel_notify' => true, 'basic.nack' => true, 'publisher_confirms' => true)); public $capabilities; private static $CProps = array( 'socketImpl', 'socketParams', 'username', 'userpass', 'vhost', 'frameMax', 'chanMax', 'signalDispatch', 'heartbeat', 'socketFlags'); protected $sock; protected $socketImpl = '\amqphp\Socket'; protected $protoImpl = 'v0_9_1'; private $protoLoader; protected $socketParams = array('host' => 'localhost', 'port' => 5672); private $socketFlags; private $username; private $userpass; protected $vhost; protected $frameMax = 65536; protected $chanMax = 50; private $heartbeat = 0; protected $signalDispatch = true; protected $chans = array(); protected $nextChan = 1; private $blocking = false; protected $unDelivered = array(); protected $unDeliverable = array(); protected $incompleteMethods = array(); protected $readSrc = null; protected $connected = false; private $exStrats = array(); function __construct (array $params = array()) { $this->setConnectionParams($params); } function setConnectionParams (array $params) { foreach (self::$CProps as $pn) { if (isset($params[$pn])) { $this->$pn = $params[$pn]; } } } function getProtocolLoader () { if (is_null($this->protoLoader)) { $protoImpl = $this->protoImpl; $this->protoLoader = function ($class, $method, $args) use ($protoImpl) { $fqClass = '\\amqphp\\protocol\\' . $protoImpl . '\\' . $class; return call_user_func_array(array($fqClass, $method), $args); }; } return $this->protoLoader; } function shutdown () { if (! $this->connected) { trigger_error("Cannot shut a closed connection", E_USER_WARNING); return; } foreach (array_keys($this->chans) as $cName) { $this->chans[$cName]->shutdown(); } $pl = $this->getProtocolLoader(); $meth = new wire\Method($pl('ClassFactory', 'GetMethod', array('connection', 'close'))); $meth->setField('reply-code', ''); $meth->setField('reply-text', ''); $meth->setField('class-id', ''); $meth->setField('method-id', ''); if (! $this->write($meth->toBin($pl))) { trigger_error("Unclean connection shutdown (1)", E_USER_WARNING); return; } if (! ($raw = $this->read())) { trigger_error("Unclean connection shutdown (2)", E_USER_WARNING); return; } $meth = new wire\Method(); $meth->readConstruct(new wire\Reader($raw), $pl); if ($meth->amqpClass != 'connection.close-ok') { trigger_error("Channel protocol shudown fault", E_USER_WARNING); } $this->sock->close(); $this->connected = false; } protected function initSocket () { if (! isset($this->socketImpl)) { throw new \Exception("No socket implementation specified", 7545); } $this->sock = new $this->socketImpl($this->socketParams, $this->socketFlags, $this->vhost); } function connect () { if ($this->connected) { trigger_error("Connection is connected already", E_USER_WARNING); return; } $this->initSocket(); $this->sock->connect(); $this->doConnectionStartup(); } protected function doConnectionStartup () { if (! $this->write(PROTOCOL_HEADER)) { throw new \Exception("Connection initialisation failed (1)", 9873); } if (! ($raw = $this->read())) { throw new \Exception("Connection initialisation failed (2)", 9874); } if (substr($raw, 0, 4) == 'AMQP' && $raw !== PROTOCOL_HEADER) { throw new \Exception("Connection initialisation failed (3)", 9875); } $meth = new wire\Method(); $pl = $this->getProtocolLoader(); $meth->readConstruct(new wire\Reader($raw), $pl); if (($startF = $meth->getField('server-properties')) && isset($startF['capabilities']) && ($startF['capabilities']->getType() == 'F')) { $this->capabilities = $startF['capabilities']->getValue()->getArrayCopy(); } if ($meth->amqpClass == 'connection.start') { $resp = $meth->getMethodProto()->getResponses(); $meth = new wire\Method($resp[0]); } else { throw new \Exception("Connection initialisation failed (5)", 9877); } $meth->setField('client-properties', new wire\Table(self::$ClientProperties)); $meth->setField('mechanism', 'AMQPLAIN'); $meth->setField('response', $this->getSaslResponse()); $meth->setField('locale', 'en_US'); if (! ($this->write($meth->toBin($pl)))) { throw new \Exception("Connection initialisation failed (6)", 9878); } if (! ($raw = $this->read())) { throw new \Exception("Connection initialisation failed (7)", 9879); } $meth = new wire\Method(); $meth->readConstruct(new wire\Reader($raw), $pl); $chanMax = $meth->getField('channel-max'); $frameMax = $meth->getField('frame-max'); $this->chanMax = ($chanMax < $this->chanMax) ? $chanMax : $this->chanMax; $this->frameMax = ($this->frameMax == 0 || $frameMax < $this->frameMax) ? $frameMax : $this->frameMax; if ($meth->amqpClass == 'connection.tune') { $resp = $meth->getMethodProto()->getResponses(); $meth = new wire\Method($resp[0]); } else { throw new \Exception("Connection initialisation failed (9)", 9881); } $meth->setField('channel-max', $this->chanMax); $meth->setField('frame-max', $this->frameMax); $meth->setField('heartbeat', $this->heartbeat); if (! ($this->write($meth->toBin($pl)))) { throw new \Exception("Connection initialisation failed (10)", 9882); } $meth = $this->constructMethod('connection', array('open', array('virtual-host' => $this->vhost))); $meth = $this->invoke($meth); if ($meth->amqpClass != 'connection.open-ok') { throw new \Exception("Connection initialisation failed (13)", 9885); } $this->connected = true; } private function getSaslResponse () { $t = new wire\Table(array('LOGIN' => $this->username, 'PASSWORD' => $this->userpass)); $w = new wire\Writer(); $w->write($t, 'table'); return substr($w->getBuffer(), 4); } function getChannel ($num) { return $this->chans[$num]; } function openChannel () { return $this->initNewChannel(__NAMESPACE__ . '\\Channel'); } function getChannels () { return $this->chans; } function setSignalDispatch ($val) { $this->signalDispatch = (boolean) $val; } function getSignalDispatch () { return $this->signalDispatch; } function getHeartbeat () { return $this->heartbeat; } function removeChannel (Channel $chan) { if (false !== ($k = array_search($chan, $this->chans))) { unset($this->chans[$k]); } else { trigger_error("Channel not found", E_USER_WARNING); } } function getSocketId () { return $this->sock->getId(); } function getSocketCK () { return $this->sock->getCK(); } function clearSocketErrors () { $this->sock->clearErrors(); } protected function initNewChannel ($impl=null) { if (! $this->connected) { trigger_error("Connection is not connected - cannot create Channel", E_USER_WARNING); return null; } $newChan = $this->nextChan++; if ($this->chanMax > 0 && $newChan > $this->chanMax) { throw new \Exception("Channels are exhausted!", 23756); } $this->chans[$newChan] = is_null($impl) ? new Channel : new $impl; $this->chans[$newChan]->setConnection($this); $this->chans[$newChan]->setChanId($newChan); $this->chans[$newChan]->setFrameMax($this->frameMax); $this->chans[$newChan]->initChannel(); return $this->chans[$newChan]; } function getVHost () { return $this->vhost; } function getSocketImplClass () { return $this->socketImpl; } function isConnected () { return $this->connected; } private function read () { $ret = $this->sock->read(); if ($ret === false) { $errNo = $this->sock->lastError(); if ($this->signalDispatch && $this->sock->selectInterrupted()) { pcntl_signal_dispatch(); } $errStr = $this->sock->strError(); throw new \Exception ("[1] Read block select produced an error: [$errNo] $errStr", 9963); } return $ret; } private function write ($buffs) { $bw = 0; foreach ((array) $buffs as $buff) { $bw += $this->sock->write($buff); } return $bw; } private function handleConnectionMessage (wire\Method $meth) { if ($meth->isHeartbeat()) { $resp = "\x08\x00\x00\x00\x00\x00\x00\xce"; $this->write($resp); return; } switch ($meth->amqpClass) { case 'connection.close': $pl = $this->getProtocolLoader(); if ($culprit = $pl('ClassFactory', 'GetMethod', array($meth->getField('class-id'), $meth->getField('method-id')))) { $culprit = $culprit->getSpecName(); } else { $culprit = '(Unknown or unspecified)'; } $errCode = $pl('ProtoConsts', 'Konstant', array($meth->getField('reply-code'))); $eb = ''; foreach ($meth->getFields() as $k => $v) { $eb .= sprintf("(%s=%s) ", $k, $v); } $tmp = $meth->getMethodProto()->getResponses(); $closeOk = new wire\Method($tmp[0]); $em = "[connection.close] reply-code={$errCode['name']} triggered by $culprit: $eb"; if ($this->write($closeOk->toBin($pl))) { $em .= " Connection closed OK"; $n = 7565; } else { $em .= " Additionally, connection closure ack send failed"; $n = 7566; } $this->sock->close(); throw new \Exception($em, $n); default: $this->sock->close(); throw new \Exception(sprintf("Unexpected channel message (%s), connection closed", $meth->amqpClass), 96356); } } function isBlocking () { return $this->blocking; } function setBlocking ($b) { $this->blocking = (boolean) $b; } function select () { $evl = new EventLoop; $evl->addConnection($this); $evl->select(); } function pushExitStrategy () { if ($this->blocking) { trigger_error("Push exit strategy - cannot switch mode whilst blocking", E_USER_WARNING); return false; } $_args = func_get_args(); if (! $_args) { trigger_error("Push exit strategy - no select parameters supplied", E_USER_WARNING); return false; } switch ($mode = array_shift($_args)) { case STRAT_TIMEOUT_ABS: case STRAT_TIMEOUT_REL: @list($epoch, $usecs) = $_args; $this->exStrats[] = $tmp = new TimeoutExitStrategy; return $tmp->configure($mode, $epoch, $usecs); case STRAT_MAXLOOPS: $this->exStrats[] = $tmp = new MaxloopExitStrategy; return $tmp->configure(STRAT_MAXLOOPS, array_shift($_args)); case STRAT_CALLBACK: $cb = array_shift($_args); $this->exStrats[] = $tmp = new CallbackExitStrategy; return $tmp->configure(STRAT_CALLBACK, $cb, $_args); case STRAT_COND: $this->exStrats[] = $tmp = new ConditionalExitStrategy; return $tmp->configure(STRAT_COND, $this); default: trigger_error("Select mode - mode not found", E_USER_WARNING); return false; } } function clearExitStrategies () { $this->exStrats = array(); } function notifyPreSelect () { $r = true; foreach ($this->exStrats as $strat) { $r = $strat->preSelect($r); } return $r; } function notifySelectInit () { foreach ($this->exStrats as $strat) { $strat->init($this); } foreach ($this->chans as $chan) { $chan->startAllConsumers(); } } function notifyComplete () { foreach($this->exStrats as $strat) { $strat->complete(); } foreach ($this->chans as $chan) { $chan->onSelectEnd(); } } function doSelectRead () { $buff = $this->sock->readAll(); if ($buff && ($meths = $this->readMessages($buff))) { $this->unDelivered = array_merge($this->unDelivered, $meths); } else if ($buff === '') { $this->blocking = false; throw new \Exception("Empty read in blocking select loop, socket error: '{$this->sock->strError()}'", 9864); } } function invoke (wire\Method $inMeth, $noWait=false) { if (! ($this->write($inMeth->toBin($this->getProtocolLoader())))) { throw new \Exception("Send message failed (1)", 5623); } if (! $noWait && $inMeth->getMethodProto()->getSpecResponseMethods()) { if ($inMeth->getMethodProto()->hasNoWaitField()) { foreach ($inMeth->getMethodProto()->getFields() as $f) { if ($f->getSpecDomainName() == 'no-wait' && $inMeth->getField($f->getSpecFieldName())) { return; } } } while (true) { if (! ($buff = $this->read())) { throw new \Exception(sprintf("(2) Send message failed for %s", $inMeth->amqpClass), 5624); } $meths = $this->readMessages($buff); foreach (array_keys($meths) as $k) { $meth = $meths[$k]; unset($meths[$k]); if ($inMeth->isResponse($meth)) { if ($meths) { $this->unDelivered = array_merge($this->unDelivered, $meths); } return $meth; } else { $this->unDelivered[] = $meth; } } } } } private function readMessages ($buff) { if (is_null($this->readSrc)) { $src = new wire\Reader($buff); } else { $src = $this->readSrc; $src->append($buff); $this->readSrc = null; } $allMeths = array(); $pl = $this->getProtocolLoader(); while (true) { $meth = null; if ($this->incompleteMethods) { foreach ($this->incompleteMethods as $im) { if ($im->canReadFrom($src)) { $meth = $im; $rcr = $meth->readConstruct($src, $pl); break; } } } if (! $meth) { $meth = new wire\Method; $this->incompleteMethods[] = $meth; $rcr = $meth->readConstruct($src, $pl); } if ($meth->readConstructComplete()) { if (false !== ($p = array_search($meth, $this->incompleteMethods, true))) { unset($this->incompleteMethods[$p]); } if ($this->connected && $meth->getWireChannel() == 0) { $this->handleConnectionMessage($meth); } else if ($meth->getWireClassId() == 20 && ($chan = $this->chans[$meth->getWireChannel()])) { $chanR = $chan->handleChannelMessage($meth); if ($chanR === true) { $allMeths[] = $meth; } } else { $allMeths[] = $meth; } } if ($rcr === wire\Method::PARTIAL_FRAME) { $this->readSrc = $src; break; } else if ($src->isSpent()) { break; } } return $allMeths; } function getUndeliveredMessages () { return $this->unDelivered; } function deliverAll () { while ($this->unDelivered) { $meth = array_shift($this->unDelivered); if (isset($this->chans[$meth->getWireChannel()])) { $this->chans[$meth->getWireChannel()]->handleChannelDelivery($meth); } else { trigger_error("Message delivered on unknown channel", E_USER_WARNING); $this->unDeliverable[] = $meth; } } } function getUndeliverableMessages ($chan) { $r = array(); foreach (array_keys($this->unDeliverable) as $k) { if ($this->unDeliverable[$k]->getWireChannel() == $chan) { $r[] = $this->unDeliverable[$k]; } } return $r; } function removeUndeliverableMessages ($chan) { foreach (array_keys($this->unDeliverable) as $k) { if ($this->unDeliverable[$k]->getWireChannel() == $chan) { unset($this->unDeliverable[$k]); } } } function constructMethod ($class, $_args) { $method = (isset($_args[0])) ? $_args[0] : null; $args = (isset($_args[1])) ? $_args[1] : array(); $content = (isset($_args[2])) ? $_args[2] : null; $pl = $this->getProtocolLoader(); if (! ($cls = $pl('ClassFactory', 'GetClassByName', array($class)))) { throw new \Exception("Invalid Amqp class or php method", 8691); } else if (! ($meth = $cls->getMethodByName($method))) { throw new \Exception("Invalid Amqp method", 5435); } $m = new wire\Method($meth); foreach ($args as $k => $v) { $m->setField($k, $v); } $m->setContent($content); return $m; } }
+namespace ${namespace};
+ use amqphp\protocol, amqphp\wire, \amqphp\persistent as pers; class TimeoutExitStrategy implements ExitStrategy { private $toStyle; private $secs; private $usecs; private $epoch; function configure ($sMode, $secs=null, $usecs=null) { $this->toStyle = $sMode; $this->secs = (string) $secs; $this->usecs = (string) $usecs; return true; } function init (Connection $conn) { if ($this->toStyle == STRAT_TIMEOUT_REL) { list($uSecs, $epoch) = explode(' ', microtime()); $uSecs = bcmul($uSecs, '1000000'); $this->usecs = bcadd($this->usecs, $uSecs); $this->epoch = bcadd($this->secs, $epoch); if (! (bccomp($this->usecs, '1000000') < 0)) { $this->epoch = bcadd('1', $this->epoch); $this->usecs = bcsub($this->usecs, '1000000'); } } else { $this->epoch = $this->secs; } } function preSelect ($prev=null) { if ($prev === false) { return false; } list($uSecs, $epoch) = explode(' ', microtime()); $epDiff = bccomp($epoch, $this->epoch); if ($epDiff == 1) { return false; } $uSecs = bcmul($uSecs, '1000000'); if ($epDiff == 0 && bccomp($uSecs, $this->usecs) >= 0) { return false; } $udiff = bcsub($this->usecs, $uSecs); if (substr($udiff, 0, 1) == '-') { $blockTmSecs = (int) bcsub($this->epoch, $epoch) - 1; $udiff = bcadd($udiff, '1000000'); } else { $blockTmSecs = (int) bcsub($this->epoch, $epoch); } if (is_array($prev) && ($prev[0] < $blockTmSecs || ($prev[0] == $blockTmSecs && $prev[1] < $udiff))) { return $prev; } else { return array($blockTmSecs, $udiff); } } function complete () {} }
+ class EventLoop { const HB_TMOBUFF = 50000; private $cons = array(); private static $In = false; private $forceExit = false; private $minHb = -1; function addConnection (Connection $conn) { $this->cons[$conn->getSocketId()] = $conn; $this->setMinHb(); } private function setMinHb () { if ($this->cons) { foreach ($this->cons as $c) { if ((($n = $c->getHeartbeat()) > 0) && $n > $this->minHb) { $this->minHb = $n; } } } else { $this->minHb = -1; } } function removeConnection (Connection $conn) { if (array_key_exists($conn->getSocketId(), $this->cons)) { unset($this->cons[$conn->getSocketId()]); } $this->setMinHb(); } function forceLoopExit () { $this->forceExit = true; } function select () { $sockImpl = false; foreach ($this->cons as $c) { if ($c->isBlocking()) { throw new \Exception("Event loop cannot start - connection is already blocking", 3267); } if ($sockImpl === false) { $sockImpl = $c->getSocketImplClass(); } else if ($sockImpl != $c->getSocketImplClass()) { throw new \Exception("Event loop doesn't support mixed socket implementations", 2678); } if (! $c->isConnected()) { throw new \Exception("Connection is not connected", 2174); } } foreach ($this->cons as $c) { $c->setBlocking(true); $c->notifySelectInit(); } $started = false; $missedHb = 0; while (true) { $tv = array(); foreach ($this->cons as $cid => $c) { $c->deliverAll(); $tv[] = array($cid, $c->notifyPreSelect()); } $psr = $this->processPreSelects($tv); if (is_array($psr)) { list($tvSecs, $tvUsecs) = $psr; } else if ($psr === true) { $tvSecs = null; $tvUsecs = 0; } else if (is_null($psr) && empty($this->cons)) { if (! $started) { trigger_error("Select loop not entered - no connections are listening", E_USER_WARNING); } break; } else { throw new \Exception("Unexpected PSR response", 2758); } $this->signal(); if ($this->forceExit) { trigger_error("Select loop forced exit over-rides connection looping state", E_USER_WARNING); $this->forceExit = false; break; } $started = true; $selectCalledAt = microtime(); if (is_null($tvSecs)) { list($ret, $read, $ex) = call_user_func(array($sockImpl, 'Zelekt'), array_keys($this->cons), null, 0); } else { list($ret, $read, $ex) = call_user_func(array($sockImpl, 'Zelekt'), array_keys($this->cons), $tvSecs, $tvUsecs); } if ($ret === false) { $this->signal(); $errNo = $errStr = array('(No specific socket exceptions found)'); if ($ex) { $errNo = $errStr = array(); foreach ($ex as $sock) { $errNo[] = $sock->lastError(); $errStr[] = $sock->strError(); } } $eMsg = sprintf("[2] Read block select produced an error: [%s] (%s)", implode(",", $errNo), implode("),(", $errStr)); throw new \Exception ($eMsg, 9963); } else if ($ret > 0) { $missedHb = 0; foreach ($read as $sock) { $c = $this->cons[$sock->getId()]; try { $c->doSelectRead(); $c->deliverAll(); } catch (\Exception $e) { if ($sock->lastError()) { trigger_error("Exception raised on socket {$sock->getId()} during " . "event loop read (nested exception follows). Socket indicates an error, " . "close the connection immediately. Nested exception: '{$e->getMessage()}'", E_USER_WARNING); try { $c->shutdown(); } catch (\Exception $e) { trigger_error("Nested exception swallowed during emergency socket " . "shutdown: '{$e->getMessage()}'", E_USER_WARNING); } $this->removeConnection($c); } else { trigger_error("Exception raised on socket {$sock->getId()} during " . "event loop read (nested exception follows). Socket does NOT " . "indicate an error, try again. Nested exception: '{$e->getMessage()}'", E_USER_WARNING); } } } } else { if ($this->minHb > 0) { list($stUsecs, $stSecs) = explode(' ', $selectCalledAt); list($usecs, $secs) = explode(' ', microtime()); if (($secs + $usecs) - ($stSecs + $stUsecs) > $this->minHb) { if (++$missedHb >= 2) { throw new \Exception("Broker missed too many heartbeats", 2957); } else { trigger_error("Broker heartbeat missed from client side, one more triggers loop exit", E_USER_WARNING); } } } } } foreach ($this->cons as $id => $conn) { $conn->notifyComplete(); $conn->setBlocking(false); $this->removeConnection($conn); } } private function processPreSelects (array $tvs) { $wins = null; foreach ($tvs as $tv) { $sid = $tv[0]; $tv = $tv[1]; if ($tv === false) { $this->cons[$sid]->notifyComplete(); $this->cons[$sid]->setBlocking(false); $this->removeConnection($this->cons[$sid]); } else if (is_null($wins)) { $wins = $tv; } else if ($tv === true && ! is_array($wins)) { $wins = true; } else if (is_array($tv)) { if ($wins === true) { $wins = $tv; } else { switch (bccomp((string) $wins[0], (string) $tv[0])) { case 0: if (1 === bccomp((string) $wins[1], (string) $tv[1])) { $wins = $tv; } break; case 1; $wins = $tv; break; } } } } if ($wins && ($this->minHb > 0) && ($wins === true || $wins[0] > $this->minHb || ($wins[0] == $this->minHb && $wins[1] < self::HB_TMOBUFF)) ) { $wins = array($this->minHb, self::HB_TMOBUFF); } return $wins; } private function signal () { foreach ($this->cons as $c) { if ($c->getSignalDispatch()) { pcntl_signal_dispatch(); return; } } } }
class ConditionalExitStrategy implements ExitStrategy { private $conn; function configure ($sMode) {} function init (Connection $conn) { $this->conn = $conn; } function preSelect ($prev=null) { if ($prev === false) { return false; } $hasConsumers = false; foreach ($this->conn->getChannels() as $chan) { if ($chan->canListen()) { $hasConsumers = true; break; } } if (! $hasConsumers) { return false; } else { return $prev; } } function complete () { $this->conn = null; } }
- interface ChannelEventHandler { function publishConfirm (wire\Method $meth); function publishReturn (wire\Method $meth); function publishNack(wire\Method $meth); }
- class StreamSocket { const READ_SELECT = 1; const WRITE_SELECT = 2; const READ_LENGTH = 4096; const BLOCK_TIMEOUT = 5; private static $All = array(); private static $Counter = 0; private $host, $port, $vhost; private $id, $connected, $interrupt = false; private $flags; private $stfp; private $errFlag = 0; function __construct ($params, $flags, $vhost) { $this->url = $params['url']; $this->context = isset($params['context']) ? $params['context'] : array(); $this->flags = $flags ? $flags : array(); $this->id = ++self::$Counter; $this->vhost = $vhost; } function getVHost () { return $this->vhost; } function getCK () { return md5(sprintf("%s:%s:%s", $this->url, $this->getFlags(), $this->vhost)); } private function getFlags () { $flags = STREAM_CLIENT_CONNECT; foreach ($this->flags as $f) { $flags |= constant($f); } return $flags; } function connect () { $context = stream_context_create($this->context); $flags = $this->getFlags(); $this->sock = stream_socket_client($this->url, $errno, $errstr, ini_get("default_socket_timeout"), $flags, $context); $this->stfp = ftell($this->sock); if (! $this->sock) { throw new \Exception("Failed to connect stream socket {$this->url}, ($errno, $errstr): flags $flags", 7568); } else if (($flags & STREAM_CLIENT_PERSISTENT) && $this->stfp > 0) { foreach (self::$All as $sock) { if ($sock !== $this && $sock->getCK() == $this->getCK()) { $this->sock = null; throw new \Exception(sprintf("Stream socket connection created a new wrapper object for " . "an existing persistent connection on URL %s", $this->url), 8164); } } } if (! stream_set_blocking($this->sock, 0)) { throw new \Exception("Failed to place stream connection in non-blocking mode", 2795); } $this->connected = true; self::$All[] = $this; } function isReusedPSock () { return ($this->stfp > 0); } function getConnectionStartFP () { return $this->stfp; } function tell () { return ftell($this->sock); } function select ($tvSec, $tvUsec = 0, $rw = self::READ_SELECT) { $read = $write = $ex = null; if ($rw & self::READ_SELECT) { $read = $ex = array($this->sock); } if ($rw & self::WRITE_SELECT) { $write = array($this->sock); } if (! $read && ! $write) { throw new \Exception("Select must read and/or write", 9864); } $this->interrupt = false; $ret = stream_select($read, $write, $ex, $tvSec, $tvUsec); if ($ret === false) { $this->interrupt = true; } return $ret; } static function Zelekt (array $incSet, $tvSec, $tvUsec) { $write = null; $read = $all = array(); foreach (self::$All as $i => $o) { if (in_array($o->id, $incSet)) { $read[$i] = $all[$i] = $o->sock; } } $ex = $read; $ret = false; if ($read) { $ret = stream_select($read, $write, $ex, $tvSec, $tvUsec); } if ($ret === false) { return false; } $_read = $_ex = array(); foreach ($read as $sock) { if (false !== ($key = array_search($sock, $all, true))) { $_read[] = self::$All[$key]; } } foreach ($ex as $k => $sock) { if (false !== ($key = array_search($sock, $all, true))) { $_ex[] = self::$All[$key]; } } return array($ret, $_read, $_ex); } function selectInterrupted () { return $this->interrupt; } function lastError () { return $this->errFlag; } function clearErrors () { $this->errFlag = 0; } function strError () { switch ($this->errFlag) { case 1: return "Read error detected"; case 2: return "Write error detected"; case 3: return "Read and write errors detected"; default: return "No error detected"; } } function readAll ($readLen = self::READ_LENGTH) { $buff = ''; do { $buff .= $chk = fread($this->sock, $readLen); $smd = stream_get_meta_data($this->sock); $readLen = min($smd['unread_bytes'], $readLen); } while ($chk !== false && $smd['unread_bytes'] > 0); if (! $chk) { trigger_error("Stream fread returned false", E_USER_WARNING); $this->errFlag |= 1; } if (DEBUG) { echo "\n<read>\n"; echo wire\Hexdump::hexdump($buff); } return $buff; } function read () { $buff = ''; $select = $this->select(self::BLOCK_TIMEOUT); if ($select === false) { return false; } else if ($select > 0) { $buff = $this->readAll(); } return $buff; } function getUnreadBytes () { return ($smd = stream_get_meta_data($this->sock)) ? $smd['unread_bytes'] : false; } function eof () { return feof($this->sock); } function write ($buff) { if (! $this->select(self::BLOCK_TIMEOUT, 0, self::WRITE_SELECT)) { trigger_error('StreamSocket select failed for write (stream socket err: "' . $this->strError() . ')', E_USER_WARNING); return 0; } $bw = 0; $contentLength = strlen($buff); if ($contentLength == 0) { return 0; } while (true) { if (DEBUG) { echo "\n<write>\n"; echo wire\Hexdump::hexdump($buff); } if (($tmp = fwrite($this->sock, $buff)) === false) { $this->errFlag |= 2; throw new \Exception(sprintf("\nStream write failed (error): %s\n", $this->strError()), 7854); } else if ($tmp === 0) { throw new \Exception(sprintf("\nStream write failed (zero bytes written): %s\n", $this->strError()), 7855); } $bw += $tmp; if ($bw < $contentLength) { $buff = substr($buff, $bw); } else { break; } } fflush($this->sock); return $bw; } function close () { $this->connected = false; fclose($this->sock); $this->detach(); } private function detach () { if (false !== ($k = array_search($this, self::$All))) { unset(self::$All[$k]); } } function getId () { return $this->id; } }
class CallbackExitStrategy implements ExitStrategy { private $cb; private $args; function configure ($sMode, $cb=null, $args=null) { if (! is_callable($cb)) { trigger_error("Select mode - invalid callback params", E_USER_WARNING); return false; } else { $this->cb = $cb; $this->args = $args; return true; } } function init (Connection $conn) {} function preSelect ($prev=null) { if ($prev === false) { return false; } if (true !== call_user_func_array($this->cb, $this->args)) { return false; } else { return $prev; } } function complete () {} }
- class SimpleConsumer implements Consumer { protected $consumeParams; protected $consuming = false; function __construct (array $consumeParams) { $this->consumeParams = $consumeParams; } function handleCancelOk (wire\Method $meth, Channel $chan) { $this->consuming = false; } function handleCancel (wire\Method $meth, Channel $chan) { $this->consuming = false; } function handleConsumeOk (wire\Method $meth, Channel $chan) { $this->consuming = true; } function handleDelivery (wire\Method $meth, Channel $chan) {} function handleRecoveryOk (wire\Method $meth, Channel $chan) {} function getConsumeMethod (Channel $chan) { return $chan->basic('consume', $this->consumeParams); } }
- class TimeoutExitStrategy implements ExitStrategy { private $toStyle; private $secs; private $usecs; private $epoch; function configure ($sMode, $secs=null, $usecs=null) { $this->toStyle = $sMode; $this->secs = (string) $secs; $this->usecs = (string) $usecs; return true; } function init (Connection $conn) { if ($this->toStyle == STRAT_TIMEOUT_REL) { list($uSecs, $epoch) = explode(' ', microtime()); $uSecs = bcmul($uSecs, '1000000'); $this->usecs = bcadd($this->usecs, $uSecs); $this->epoch = bcadd($this->secs, $epoch); if (! (bccomp($this->usecs, '1000000') < 0)) { $this->epoch = bcadd('1', $this->epoch); $this->usecs = bcsub($this->usecs, '1000000'); } } else { $this->epoch = $this->secs; } } function preSelect ($prev=null) { if ($prev === false) { return false; } list($uSecs, $epoch) = explode(' ', microtime()); $epDiff = bccomp($epoch, $this->epoch); if ($epDiff == 1) { return false; } $uSecs = bcmul($uSecs, '1000000'); if ($epDiff == 0 && bccomp($uSecs, $this->usecs) >= 0) { return false; } $udiff = bcsub($this->usecs, $uSecs); if (substr($udiff, 0, 1) == '-') { $blockTmSecs = (int) bcsub($this->epoch, $epoch) - 1; $udiff = bcadd($udiff, '1000000'); } else { $blockTmSecs = (int) bcsub($this->epoch, $epoch); } if (is_array($prev) && ($prev[0] < $blockTmSecs || ($prev[0] == $blockTmSecs && $prev[1] < $udiff))) { return $prev; } else { return array($blockTmSecs, $udiff); } } function complete () {} }
+ const DEBUG = false; const PROTOCOL_HEADER = "AMQP\x00\x00\x09\x01"; const STRAT_TIMEOUT_ABS = 1; const STRAT_TIMEOUT_REL = 2; const STRAT_MAXLOOPS = 3; const STRAT_CALLBACK = 4; const STRAT_COND = 5; const CONSUMER_ACK = 1; const CONSUMER_REJECT = 2; const CONSUMER_DROP = 3; const CONSUMER_CANCEL = 4; class Connection { public static $ClientProperties = array( 'product' => ' BraveSirRobin/amqphp', 'version' => '0.9.3', 'platform' => 'PHP 5.3 +', 'copyright' => 'Copyright (c) 2010,2011,2012 Robin Harvey (harvey.robin@gmail.com)', 'information' => 'This software is released under the terms of the GNU LGPL: http://www.gnu.org/licenses/lgpl-3.0.txt', 'capabilities' => array('exchange_exchange_bindings' => true, 'consumer_cancel_notify' => true, 'basic.nack' => true, 'publisher_confirms' => true)); public $capabilities; private static $CProps = array( 'socketImpl', 'socketParams', 'username', 'userpass', 'vhost', 'frameMax', 'chanMax', 'signalDispatch', 'heartbeat', 'socketFlags'); protected $sock; protected $socketImpl = '\amqphp\Socket'; protected $protoImpl = 'v0_9_1'; private $protoLoader; protected $socketParams = array('host' => 'localhost', 'port' => 5672); private $socketFlags; private $username; private $userpass; protected $vhost; protected $frameMax = 65536; protected $chanMax = 50; private $heartbeat = 0; protected $signalDispatch = true; protected $chans = array(); protected $nextChan = 1; private $blocking = false; protected $unDelivered = array(); protected $unDeliverable = array(); protected $incompleteMethods = array(); protected $readSrc = null; protected $connected = false; private $exStrats = array(); function __construct (array $params = array()) { $this->setConnectionParams($params); } function setConnectionParams (array $params) { foreach (self::$CProps as $pn) { if (isset($params[$pn])) { $this->$pn = $params[$pn]; } } } function getProtocolLoader () { if (is_null($this->protoLoader)) { $protoImpl = $this->protoImpl; $this->protoLoader = function ($class, $method, $args) use ($protoImpl) { $fqClass = '\\amqphp\\protocol\\' . $protoImpl . '\\' . $class; return call_user_func_array(array($fqClass, $method), $args); }; } return $this->protoLoader; } function shutdown () { if (! $this->connected) { trigger_error("Cannot shut a closed connection", E_USER_WARNING); return; } foreach (array_keys($this->chans) as $cName) { $this->chans[$cName]->shutdown(); } $pl = $this->getProtocolLoader(); $meth = new wire\Method($pl('ClassFactory', 'GetMethod', array('connection', 'close'))); $meth->setField('reply-code', ''); $meth->setField('reply-text', ''); $meth->setField('class-id', ''); $meth->setField('method-id', ''); if (! $this->write($meth->toBin($pl))) { trigger_error("Unclean connection shutdown (1)", E_USER_WARNING); return; } if (! ($raw = $this->read())) { trigger_error("Unclean connection shutdown (2)", E_USER_WARNING); return; } $meth = new wire\Method(); $meth->readConstruct(new wire\Reader($raw), $pl); if ($meth->amqpClass != 'connection.close-ok') { trigger_error("Channel protocol shudown fault", E_USER_WARNING); } $this->sock->close(); $this->connected = false; } protected function initSocket () { if (! isset($this->socketImpl)) { throw new \Exception("No socket implementation specified", 7545); } $this->sock = new $this->socketImpl($this->socketParams, $this->socketFlags, $this->vhost); } function connect () { if ($this->connected) { trigger_error("Connection is connected already", E_USER_WARNING); return; } $this->initSocket(); $this->sock->connect(); $this->doConnectionStartup(); } protected function doConnectionStartup () { if (! $this->write(PROTOCOL_HEADER)) { throw new \Exception("Connection initialisation failed (1)", 9873); } if (! ($raw = $this->read())) { throw new \Exception("Connection initialisation failed (2)", 9874); } if (substr($raw, 0, 4) == 'AMQP' && $raw !== PROTOCOL_HEADER) { throw new \Exception("Connection initialisation failed (3)", 9875); } $meth = new wire\Method(); $pl = $this->getProtocolLoader(); $meth->readConstruct(new wire\Reader($raw), $pl); if (($startF = $meth->getField('server-properties')) && isset($startF['capabilities']) && ($startF['capabilities']->getType() == 'F')) { $this->capabilities = $startF['capabilities']->getValue()->getArrayCopy(); } if ($meth->amqpClass == 'connection.start') { $resp = $meth->getMethodProto()->getResponses(); $meth = new wire\Method($resp[0]); } else { throw new \Exception("Connection initialisation failed (5)", 9877); } $meth->setField('client-properties', new wire\Table(self::$ClientProperties)); $meth->setField('mechanism', 'AMQPLAIN'); $meth->setField('response', $this->getSaslResponse()); $meth->setField('locale', 'en_US'); if (! ($this->write($meth->toBin($pl)))) { throw new \Exception("Connection initialisation failed (6)", 9878); } if (! ($raw = $this->read())) { throw new \Exception("Connection initialisation failed (7)", 9879); } $meth = new wire\Method(); $meth->readConstruct(new wire\Reader($raw), $pl); $chanMax = $meth->getField('channel-max'); $frameMax = $meth->getField('frame-max'); $this->chanMax = ($chanMax < $this->chanMax) ? $chanMax : $this->chanMax; $this->frameMax = ($this->frameMax == 0 || $frameMax < $this->frameMax) ? $frameMax : $this->frameMax; if ($meth->amqpClass == 'connection.tune') { $resp = $meth->getMethodProto()->getResponses(); $meth = new wire\Method($resp[0]); } else { throw new \Exception("Connection initialisation failed (9)", 9881); } $meth->setField('channel-max', $this->chanMax); $meth->setField('frame-max', $this->frameMax); $meth->setField('heartbeat', $this->heartbeat); if (! ($this->write($meth->toBin($pl)))) { throw new \Exception("Connection initialisation failed (10)", 9882); } $meth = $this->constructMethod('connection', array('open', array('virtual-host' => $this->vhost))); $meth = $this->invoke($meth); if ($meth->amqpClass != 'connection.open-ok') { throw new \Exception("Connection initialisation failed (13)", 9885); } $this->connected = true; } private function getSaslResponse () { $t = new wire\Table(array('LOGIN' => $this->username, 'PASSWORD' => $this->userpass)); $w = new wire\Writer(); $w->write($t, 'table'); return substr($w->getBuffer(), 4); } function getChannel ($num) { return $this->chans[$num]; } function openChannel () { return $this->initNewChannel(__NAMESPACE__ . '\\Channel'); } function getChannels () { return $this->chans; } function setSignalDispatch ($val) { $this->signalDispatch = (boolean) $val; } function getSignalDispatch () { return $this->signalDispatch; } function getHeartbeat () { return $this->heartbeat; } function removeChannel (Channel $chan) { if (false !== ($k = array_search($chan, $this->chans))) { unset($this->chans[$k]); } else { trigger_error("Channel not found", E_USER_WARNING); } } function getSocketId () { return $this->sock->getId(); } function getSocketCK () { return $this->sock->getCK(); } function clearSocketErrors () { $this->sock->clearErrors(); } protected function initNewChannel ($impl=null) { if (! $this->connected) { trigger_error("Connection is not connected - cannot create Channel", E_USER_WARNING); return null; } $newChan = $this->nextChan++; if ($this->chanMax > 0 && $newChan > $this->chanMax) { throw new \Exception("Channels are exhausted!", 23756); } $this->chans[$newChan] = is_null($impl) ? new Channel : new $impl; $this->chans[$newChan]->setConnection($this); $this->chans[$newChan]->setChanId($newChan); $this->chans[$newChan]->setFrameMax($this->frameMax); $this->chans[$newChan]->initChannel(); return $this->chans[$newChan]; } function getVHost () { return $this->vhost; } function getSocketImplClass () { return $this->socketImpl; } function isConnected () { return $this->connected; } private function read () { $ret = $this->sock->read(); if ($ret === false) { $errNo = $this->sock->lastError(); if ($this->signalDispatch && $this->sock->selectInterrupted()) { pcntl_signal_dispatch(); } $errStr = $this->sock->strError(); throw new \Exception ("[1] Read block select produced an error: [$errNo] $errStr", 9963); } return $ret; } private function write ($buffs) { $bw = 0; foreach ((array) $buffs as $buff) { $bw += $this->sock->write($buff); } return $bw; } private function handleConnectionMessage (wire\Method $meth) { if ($meth->isHeartbeat()) { $resp = "\x08\x00\x00\x00\x00\x00\x00\xce"; $this->write($resp); return; } switch ($meth->amqpClass) { case 'connection.close': $pl = $this->getProtocolLoader(); if ($culprit = $pl('ClassFactory', 'GetMethod', array($meth->getField('class-id'), $meth->getField('method-id')))) { $culprit = $culprit->getSpecName(); } else { $culprit = '(Unknown or unspecified)'; } $errCode = $pl('ProtoConsts', 'Konstant', array($meth->getField('reply-code'))); $eb = ''; foreach ($meth->getFields() as $k => $v) { $eb .= sprintf("(%s=%s) ", $k, $v); } $tmp = $meth->getMethodProto()->getResponses(); $closeOk = new wire\Method($tmp[0]); $em = "[connection.close] reply-code={$errCode['name']} triggered by $culprit: $eb"; if ($this->write($closeOk->toBin($pl))) { $em .= " Connection closed OK"; $n = 7565; } else { $em .= " Additionally, connection closure ack send failed"; $n = 7566; } $this->sock->close(); throw new \Exception($em, $n); default: $this->sock->close(); throw new \Exception(sprintf("Unexpected channel message (%s), connection closed", $meth->amqpClass), 96356); } } function isBlocking () { return $this->blocking; } function setBlocking ($b) { $this->blocking = (boolean) $b; } function select () { $evl = new EventLoop; $evl->addConnection($this); $evl->select(); } function pushExitStrategy () { if ($this->blocking) { trigger_error("Push exit strategy - cannot switch mode whilst blocking", E_USER_WARNING); return false; } $_args = func_get_args(); if (! $_args) { trigger_error("Push exit strategy - no select parameters supplied", E_USER_WARNING); return false; } switch ($mode = array_shift($_args)) { case STRAT_TIMEOUT_ABS: case STRAT_TIMEOUT_REL: @list($epoch, $usecs) = $_args; $this->exStrats[] = $tmp = new TimeoutExitStrategy; return $tmp->configure($mode, $epoch, $usecs); case STRAT_MAXLOOPS: $this->exStrats[] = $tmp = new MaxloopExitStrategy; return $tmp->configure(STRAT_MAXLOOPS, array_shift($_args)); case STRAT_CALLBACK: $cb = array_shift($_args); $this->exStrats[] = $tmp = new CallbackExitStrategy; return $tmp->configure(STRAT_CALLBACK, $cb, $_args); case STRAT_COND: $this->exStrats[] = $tmp = new ConditionalExitStrategy; return $tmp->configure(STRAT_COND, $this); default: trigger_error("Select mode - mode not found", E_USER_WARNING); return false; } } function clearExitStrategies () { $this->exStrats = array(); } function notifyPreSelect () { $r = true; foreach ($this->exStrats as $strat) { $r = $strat->preSelect($r); } return $r; } function notifySelectInit () { foreach ($this->exStrats as $strat) { $strat->init($this); } foreach ($this->chans as $chan) { $chan->startAllConsumers(); } } function notifyComplete () { foreach($this->exStrats as $strat) { $strat->complete(); } foreach ($this->chans as $chan) { $chan->onSelectEnd(); } } function doSelectRead () { $buff = $this->sock->readAll(); if ($buff && ($meths = $this->readMessages($buff))) { $this->unDelivered = array_merge($this->unDelivered, $meths); } else if ($buff === '') { $this->blocking = false; throw new \Exception("Empty read in blocking select loop, socket error: '{$this->sock->strError()}'", 9864); } } function invoke (wire\Method $inMeth, $noWait=false) { if (! ($this->write($inMeth->toBin($this->getProtocolLoader())))) { throw new \Exception("Send message failed (1)", 5623); } if (! $noWait && $inMeth->getMethodProto()->getSpecResponseMethods()) { if ($inMeth->getMethodProto()->hasNoWaitField()) { foreach ($inMeth->getMethodProto()->getFields() as $f) { if ($f->getSpecDomainName() == 'no-wait' && $inMeth->getField($f->getSpecFieldName())) { return; } } } while (true) { if (! ($buff = $this->read())) { throw new \Exception(sprintf("(2) Send message failed for %s", $inMeth->amqpClass), 5624); } $meths = $this->readMessages($buff); foreach (array_keys($meths) as $k) { $meth = $meths[$k]; unset($meths[$k]); if ($inMeth->isResponse($meth)) { if ($meths) { $this->unDelivered = array_merge($this->unDelivered, $meths); } return $meth; } else { $this->unDelivered[] = $meth; } } } } } private function readMessages ($buff) { if (is_null($this->readSrc)) { $src = new wire\Reader($buff); } else { $src = $this->readSrc; $src->append($buff); $this->readSrc = null; } $allMeths = array(); $pl = $this->getProtocolLoader(); while (true) { $meth = null; if ($this->incompleteMethods) { foreach ($this->incompleteMethods as $im) { if ($im->canReadFrom($src)) { $meth = $im; $rcr = $meth->readConstruct($src, $pl); break; } } } if (! $meth) { $meth = new wire\Method; $this->incompleteMethods[] = $meth; $rcr = $meth->readConstruct($src, $pl); } if ($meth->readConstructComplete()) { if (false !== ($p = array_search($meth, $this->incompleteMethods, true))) { unset($this->incompleteMethods[$p]); } if ($this->connected && $meth->getWireChannel() == 0) { $this->handleConnectionMessage($meth); } else if ($meth->getWireClassId() == 20 && ($chan = $this->chans[$meth->getWireChannel()])) { $chanR = $chan->handleChannelMessage($meth); if ($chanR === true) { $allMeths[] = $meth; } } else { $allMeths[] = $meth; } } if ($rcr === wire\Method::PARTIAL_FRAME) { $this->readSrc = $src; break; } else if ($src->isSpent()) { break; } } return $allMeths; } function getUndeliveredMessages () { return $this->unDelivered; } function deliverAll () { while ($this->unDelivered) { $meth = array_shift($this->unDelivered); if (isset($this->chans[$meth->getWireChannel()])) { $this->chans[$meth->getWireChannel()]->handleChannelDelivery($meth); } else { trigger_error("Message delivered on unknown channel", E_USER_WARNING); $this->unDeliverable[] = $meth; } } } function getUndeliverableMessages ($chan) { $r = array(); foreach (array_keys($this->unDeliverable) as $k) { if ($this->unDeliverable[$k]->getWireChannel() == $chan) { $r[] = $this->unDeliverable[$k]; } } return $r; } function removeUndeliverableMessages ($chan) { foreach (array_keys($this->unDeliverable) as $k) { if ($this->unDeliverable[$k]->getWireChannel() == $chan) { unset($this->unDeliverable[$k]); } } } function constructMethod ($class, $_args) { $method = (isset($_args[0])) ? $_args[0] : null; $args = (isset($_args[1])) ? $_args[1] : array(); $content = (isset($_args[2])) ? $_args[2] : null; $pl = $this->getProtocolLoader(); if (! ($cls = $pl('ClassFactory', 'GetClassByName', array($class)))) { throw new \Exception("Invalid Amqp class or php method", 8691); } else if (! ($meth = $cls->getMethodByName($method))) { throw new \Exception("Invalid Amqp method", 5435); } $m = new wire\Method($meth); foreach ($args as $k => $v) { $m->setField($k, $v); } $m->setContent($content); return $m; } }
+ class Factory { const XML_FILE = 1; const XML_STRING = 2; private static $RC_CACHE = array(); private $simp; private $rootEl; function __construct ($xml, $documentURI=false, $flag=self::XML_FILE) { $d = new \DOMDocument; switch ($flag) { case self::XML_FILE: if (! $d->load($xml)) { throw new \Exception("Failed to load factory XML", 92656); } break; case self::XML_STRING: if (! $d->loadXML($xml)) { throw new \Exception("Failed to load factory XML", 92656); } if ($documentURI) { $d->documentURI = $documentURI; } break; default: throw new \Exception("Invalid construct flag", 95637); } if (-1 === $d->xinclude()) { throw new \Exception("Failed to load factory XML", 92657); } else if (! ($this->simp = simplexml_import_dom($d))) { throw new \Exception("Failed to load factory XML", 92658); } switch ($tmp = strtolower((string) $this->simp->getName())) { case 'setup': case 'methods': $this->rootEl = $tmp; break; default: throw new \Exception("Unexpected Factory configuration data root element", 17893); } } function run (Channel $chan=null) { switch ($this->rootEl) { case 'setup': return $this->runSetupSequence(); case 'methods': if (is_null($chan)) { throw new \Exception("Invalid factory configuration - expected a target channel", 15758); } return $this->runMethodSequence($chan, $this->simp->xpath('/methods/method')); } } function getConnections () { $r = array(); foreach ($this->run() as $res) { if ($res instanceof Connection) { $r[] = $res; } } return $r; } private function callProperties ($subj, $conf) { foreach ($conf->xpath('./set_properties/*') as $prop) { $pname = (string) $prop->getName(); $pval = $this->kast($prop, $prop['k']); $subj->$pname = $pval; } } private function runSetupSequence () { $ret = array(); foreach ($this->simp->connection as $conn) { $_chans = array(); $refl = $this->getRc((string) $conn->impl); $_conn = $refl->newInstanceArgs($this->xmlToArray($conn->constr_args->children())); $this->callProperties($_conn, $conn); $_conn->connect(); $ret[] = $_conn; if (count($conn->exit_strats) > 0) { foreach ($conn->exit_strats->strat as $strat) { call_user_func_array(array($_conn, 'pushExitStrategy'), $this->xmlToArray($strat->children())); } } if ($_conn instanceof pers\PConnection && $_conn->getPersistenceStatus() == pers\PConnection::SOCK_REUSED) { continue; } foreach ($conn->channel as $chan) { $_chan = $_conn->openChannel(); $this->callProperties($_chan, $chan); if (isset($chan->event_handler)) { $impl = (string) $chan->event_handler->impl; if (count($chan->event_handler->constr_args)) { $refl = $this->getRc($impl); $_evh = $refl->newInstanceArgs($this->xmlToArray($chan->event_handler->constr_args->children())); } else { $_evh = new $impl; } $_chan->setEventHandler($_evh); } $_chans[] = $_chan; $rMeths = $chan->xpath('.//method'); if (count($rMeths) > 0) { $ret[] = $this->runMethodSequence($_chan, $rMeths); } if (count($chan->confirm_mode) > 0 && $this->kast($chan->confirm_mode, 'boolean')) { $_chan->setConfirmMode(); } } $i = 0; foreach ($conn->channel as $chan) { $_chan = $_chans[$i++]; foreach ($chan->consumer as $cons) { $impl = (string) $cons->impl; if (count($cons->constr_args)) { $refl = $this->getRc($impl); $_cons = $refl->newInstanceArgs($this->xmlToArray($cons->constr_args->children())); } else { $_cons = new $impl; } $this->callProperties($_cons, $cons); $_chan->addConsumer($_cons); if (isset($cons->autostart) && $this->kast($cons->autostart, 'boolean')) { $_chan->startConsumer($_cons); } } } } return $ret; } private function runMethodSequence (Channel $chan, array $meths) { $r = array(); foreach ($meths as $iMeth) { $a = $this->xmlToArray($iMeth); $c = $a['a_class']; $r[] = $chan->invoke($chan->$c($a['a_method'], $a['a_args'])); } return $r; } private function kast ($val, $cast) { switch ($cast) { case 'string': return (string) $val; case 'bool': case 'boolean': $val = trim((string) $val); if ($val === '0' || strtolower($val) === 'false') { return false; } else if ($val === '1' || strtolower($val) === 'true') { return true; } else { trigger_error("Bad boolean cast $val - use 0/1 true/false", E_USER_WARNING); return true; } case 'int': case 'integer': return (int) $val; case 'const': return constant((string) $val); case 'eval': return eval((string) $val); default: trigger_error("Unknown Kast $cast", E_USER_WARNING); return (string) $val; } } private function xmlToArray (\SimpleXmlElement $e) { $ret = array(); foreach ($e as $c) { $ret[(string) $c->getName()] = (count($c) == 0) ? $this->kast($c, (string) $c['k']) : $this->xmlToArray($c); } return $ret; } private function getRc ($class) { return array_key_exists($class, self::$RC_CACHE) ? self::$RC_CACHE[$class] : (self::$RC_CACHE[$class] = new \ReflectionClass($class)); } }
+ class Channel { protected $myConn; protected $chanId; protected $flow = true; private $destroyed = false; protected $frameMax; protected $isOpen = false; protected $consumers = array(); protected $callbackHandler; protected $confirmSeqs = array(); protected $confirmSeq = 0; protected $confirmMode = false; public $ackBuffer = 1; protected $ackHead; protected $numPendAcks = 0; protected $ackFlag; function setEventHandler (ChannelEventHandler $evh) { $this->callbackHandler = $evh; } function hasOutstandingConfirms () { return (bool) $this->confirmSeqs; } function setConfirmMode () { if ($this->confirmMode) { return; } $confSelect = $this->confirm('select'); $confSelectOk = $this->invoke($confSelect); if (! ($confSelectOk instanceof wire\Method) || $confSelectOk->amqpClass != 'confirm.select-ok') { throw new \Exception("Failed to set confirm mode", 8674); } $this->confirmMode = true; } function setConnection (Connection $rConn) { $this->myConn = $rConn; } function setChanId ($chanId) { $this->chanId = $chanId; } function getChanId () { return $this->chanId; } function setFrameMax ($frameMax) { $this->frameMax = $frameMax; } function initChannel () { $pl = $this->myConn->getProtocolLoader(); $meth = new wire\Method($pl('ClassFactory', 'GetMethod', array('channel', 'open')), $this->chanId); $meth->setField('reserved-1', ''); $resp = $this->myConn->invoke($meth); } function __call ($class, $args) { if ($this->destroyed) { throw new \Exception("Attempting to use a destroyed channel", 8766); } $m = $this->myConn->constructMethod($class, $args); $m->setWireChannel($this->chanId); $m->setMaxFrameSize($this->frameMax); return $m; } function invoke (wire\Method $m) { if ($this->destroyed) { throw new \Exception("Attempting to use a destroyed channel", 8767); } else if (! $this->flow) { trigger_error("Channel is closed", E_USER_WARNING); return; } else if (is_null($tmp = $m->getWireChannel())) { $m->setWireChannel($this->chanId); } else if ($tmp != $this->chanId) { throw new \Exception("Method is invoked through the wrong channel", 7645); } if ($this->confirmMode && $m->amqpClass == 'basic.publish') { $this->confirmSeq++; $this->confirmSeqs[$this->confirmSeq] = $m; } return $this->myConn->invoke($m); } function handleChannelMessage (wire\Method $meth) { switch ($meth->amqpClass) { case 'channel.flow': $this->flow = ! $this->flow; if ($r = $meth->getMethodProto()->getResponses()) { $meth = new wire\Method($r[0], $this->chanId); $this->invoke($meth); } return false; case 'channel.close': $pl = $this->myConn->getProtocolLoader(); if ($culprit = $pl('ClassFactory', 'GetMethod', array($meth->getField('class-id'), $meth->getField('method-id')))) { $culprit = $culprit->getSpecName(); } else { $culprit = '(Unknown or unspecified)'; } $errCode = $pl('ProtoConsts', 'Konstant', array($meth->getField('reply-code'))); $eb = ''; foreach ($meth->getFields() as $k => $v) { $eb .= sprintf("(%s=%s) ", $k, $v); } $tmp = $meth->getMethodProto()->getResponses(); $closeOk = new wire\Method($tmp[0], $this->chanId); $em = "[channel.close] reply-code={$errCode['name']} triggered by $culprit: $eb"; try { $this->myConn->invoke($closeOk); $em .= " Channel closed OK"; $n = 3687; } catch (\Exception $e) { $em .= " Additionally, channel closure ack send failed"; $n = 2435; } throw new \Exception($em, $n); case 'channel.close-ok': case 'channel.open-ok': case 'channel.flow-ok': return true; default: throw new \Exception("Received unexpected channel message: {$meth->amqpClass}", 8795); } } function handleChannelDelivery (wire\Method $meth) { switch ($meth->amqpClass) { case 'basic.deliver': return $this->deliverConsumerMessage($meth); case 'basic.return': if ($this->callbackHandler) { $this->callbackHandler->publishReturn($meth); } return false; case 'basic.ack': $this->removeConfirmSeqs($meth, 'publishConfirm'); return false; case 'basic.nack': $this->removeConfirmSeqs($meth, 'publishNack'); return false; case 'basic.cancel': $this->handleConsumerCancel($meth); break; default: throw new \Exception("Received unexpected channel delivery:\n{$meth->amqpClass}", 87998); } } private function handleConsumerCancel ($meth) { $ctag = $meth->getField('consumer-tag'); list($cons, $status,) = $this->getConsumerAndStatus($ctag); if ($cons && $status == 'READY') { $cons->handleCancel($meth, $this); $this->setConsumerStatus($ctag, 'CLOSED') OR trigger_error("Failed to set consumer status flag (2)", E_USER_WARNING); if (! $meth->getField('no-wait')) { $this->invoke($this->basic('cancel-ok', array('consumer-tag', $ctag))); } } else if ($cons) { $m = sprintf("Cancellation message delivered to closed consumer %s", $ctag); trigger_error($m, E_USER_WARNING); } else { $m = sprintf("Unable to load consumer for consumer cancellation %s", $ctag); trigger_error($m, E_USER_WARNING); } } private function deliverConsumerMessage ($meth) { $ctag = $meth->getField('consumer-tag'); $response = false; list($cons, $status, $consParams) = $this->getConsumerAndStatus($ctag); if ($cons && $status == 'READY') { $response = $cons->handleDelivery($meth, $this); } else if ($cons) { $m = sprintf("Message delivered to closed consumer %s in non-ready state %s -- reject %s", $ctag, $status, $meth->getField('delivery-tag')); trigger_error($m, E_USER_WARNING); $response = CONSUMER_REJECT; } else { $m = sprintf("Unable to load consumer for delivery %s -- reject %s", $ctag, $meth->getField('delivery-tag')); trigger_error($m, E_USER_WARNING); $response = CONSUMER_REJECT; } if (! $response) { return; } if (! is_array($response)) { $response = array($response); } $shouldAck = (! array_key_exists('no-ack', $consParams) || ! $consParams['no-ack']); foreach ($response as $resp) { switch ($resp) { case CONSUMER_ACK: if ($shouldAck) { $this->ack($meth, CONSUMER_ACK); } break; case CONSUMER_DROP: case CONSUMER_REJECT: if ($shouldAck) { $this->ack($meth, $resp); } break; case CONSUMER_CANCEL: $this->removeConsumerByTag($cons, $ctag); break; default: trigger_error("Invalid consumer response $resp - consumers must " . 'respond with either a single consumer flag, multiple ' . 'consumer flags, or an empty response', E_USER_WARNING); } } return false; } private function ack ($meth, $action) { if (is_null($this->ackFlag)) { $this->ackFlag = $action; } else if ($action != $this->ackFlag) { $this->flushAcks(); $this->ackFlag = $action; } $this->ackHead = $meth->getField('delivery-tag'); $this->numPendAcks++; if ($this->numPendAcks >= $this->ackBuffer) { $this->flushAcks(); } } private function flushAcks () { if (is_null($this->ackFlag)) { return; } switch ($this->ackFlag) { case CONSUMER_ACK: $ack = $this->basic('ack', array('delivery-tag' => $this->ackHead, 'multiple' => ($this->ackBuffer > 1))); $this->invoke($ack); break; case CONSUMER_REJECT: case CONSUMER_DROP: $rej = $this->basic('nack', array('delivery-tag' => $this->ackHead, 'multiple' => ($this->ackBuffer > 1), 'requeue' => ($this->ackFlag == CONSUMER_REJECT))); $this->invoke($rej); break; default: throw new \Exception("Internal (n)ack tracking state error", 2956); } $this->ackFlag = $this->ackHead = null; $this->numPendAcks = 0; } private function removeConfirmSeqs (wire\Method $meth, $event) { if (! $this->callbackHandler) { trigger_error("Received publish confirmations with no channel event handler in place", E_USER_WARNING); return; } $dtag = $meth->getField('delivery-tag'); if ($meth->getField('multiple')) { foreach (array_keys($this->confirmSeqs) as $sk) { if ($sk <= $dtag) { $this->callbackHandler->$event($this->confirmSeqs[$sk]); unset($this->confirmSeqs[$sk]); } } } else { if (array_key_exists($dtag, $this->confirmSeqs)) { $this->callbackHandler->$event($this->confirmSeqs[$dtag]); unset($this->confirmSeqs[$dtag]); } } } function shutdown () { if (! $this->invoke($this->channel('close', array('reply-code' => '', 'reply-text' => '')))) { trigger_error("Unclean channel shutdown", E_USER_WARNING); } $this->myConn->removeChannel($this); $this->destroyed = true; $this->myConn = $this->chanId = $this->ticket = null; } function addConsumer (Consumer $cons, array $cParams=null) { $this->consumers[] = array($cons, false, 'READY_WAIT', $cParams); } function canListen () { return $this->hasListeningConsumers() || $this->hasOutstandingConfirms(); } function removeConsumer (Consumer $cons) { foreach ($this->consumers as $c) { if ($c[0] === $cons) { if ($c[2] == 'READY') { $this->removeConsumerByTag($c[0], $c[1]); } return; } } trigger_error("Consumer does not belong to this Channel", E_USER_WARNING); } function removeAllConsumers () { foreach ($this->consumers as $c) { if ($c[2] == 'READY') { $this->removeConsumerByTag($c[0], $c[1]); } } } private function removeConsumerByTag (Consumer $cons, $ctag) { list(, $cstate,) = $this->getConsumerAndStatus($ctag); if ($cstate == 'CLOSED') { trigger_error("Consumer is already removed", E_USER_WARNING); return; } $cnl = $this->basic('cancel', array('consumer-tag' => $ctag, 'no-wait' => false)); $cOk = $this->invoke($cnl); if ($cOk->amqpClass == 'basic.cancel-ok') { $this->setConsumerStatus($ctag, 'CLOSED') OR trigger_error("Failed to set consumer status flag", E_USER_WARNING); } else { throw new \Exception("Failed to cancel consumer - bad broker response", 9768); } $cons->handleCancelOk($cOk, $this); } private function setConsumerStatus ($tag, $status) { foreach ($this->consumers as $k => $c) { if ($c[1] === $tag) { $this->consumers[$k][2] = $status; return true; } } return false; } private function getConsumerAndStatus ($tag) { foreach ($this->consumers as $c) { if ($c[1] == $tag) { return array($c[0], $c[2], $c[3]); } } return array(null, 'INVALID', null); } function hasListeningConsumers () { foreach ($this->consumers as $c) { if ($c[2] === 'READY') { return true; } } return false; } function getConsumerByTag ($t) { foreach ($this->consumers as $c) { if ($c[2] == 'READY' && $c[1] === $t) { return $c[0]; } } } function getConsumerTags () { $tags = array(); foreach ($this->consumers as $c) { if ($c[2] == 'READY') { $tags[] = $c[1]; } } return $tags; } function startAllConsumers () { if (! $this->consumers) { return false; } $r = false; foreach (array_keys($this->consumers) as $cnum) { if (false === $this->consumers[$cnum][1]) { $this->_startConsumer($cnum); $r = true; } } return $r; } private function _startConsumer ($cnum) { $consume = false; if (($consume = $this->consumers[$cnum][0]->getConsumeMethod($this)) && ! ($consume instanceof wire\Method)) { trigger_error("Consumer returned invalid consume method", E_USER_WARNING); $consume = false; } if (! $consume && is_array($this->consumers[$cnum][3])) { $consume = $this->basic('consume', $this->consumers[$cnum][3]); } if (! $consume) { throw new \Exception("Couldn't find any consume paramters while starting consumer", 9265); } $cOk = $this->invoke($consume); $this->consumers[$cnum][0]->handleConsumeOk($cOk, $this); $this->consumers[$cnum][2] = 'READY'; $this->consumers[$cnum][1] = $cOk->getField('consumer-tag'); $this->consumers[$cnum][3] = $consume->getFields(); } function startConsumer (Consumer $cons) { foreach ($this->consumers as $i => $c) { if ($c[0] === $cons && $c[1] === false) { $this->_startConsumer($i); return true; } } return false; } function onSelectEnd () { $this->flushAcks(); $this->consuming = false; } function isSuspended () { return ! $this->flow; } function toggleFlow () { $flow = ! $this->flow; $this->flow = true; $meth = $this->channel('flow', array('active' => $flow)); $fr = $this->invoke($meth); $newFlow = $fr->getField('active'); if ($newFlow != $flow) { trigger_error(sprintf("Flow Unexpected channel flow response, expected %d, got %d", ! $this->flow, $this->flow), E_USER_WARNING); } $this->flow = $newFlow; } }
+ class StreamSocket { const READ_SELECT = 1; const WRITE_SELECT = 2; const READ_LENGTH = 4096; const BLOCK_TIMEOUT = 5; private static $All = array(); private static $Counter = 0; private $host, $port, $vhost; private $id, $connected, $interrupt = false; private $flags; private $stfp; private $errFlag = 0; function __construct ($params, $flags, $vhost) { $this->url = $params['url']; $this->context = isset($params['context']) ? $params['context'] : array(); $this->flags = $flags ? $flags : array(); $this->id = ++self::$Counter; $this->vhost = $vhost; } function getVHost () { return $this->vhost; } function getCK () { return md5(sprintf("%s:%s:%s", $this->url, $this->getFlags(), $this->vhost)); } private function getFlags () { $flags = STREAM_CLIENT_CONNECT; foreach ($this->flags as $f) { $flags |= constant($f); } return $flags; } function connect () { $context = stream_context_create($this->context); $flags = $this->getFlags(); $this->sock = stream_socket_client($this->url, $errno, $errstr, ini_get("default_socket_timeout"), $flags, $context); $this->stfp = ftell($this->sock); if (! $this->sock) { throw new \Exception("Failed to connect stream socket {$this->url}, ($errno, $errstr): flags $flags", 7568); } else if (($flags & STREAM_CLIENT_PERSISTENT) && $this->stfp > 0) { foreach (self::$All as $sock) { if ($sock !== $this && $sock->getCK() == $this->getCK()) { $this->sock = null; throw new \Exception(sprintf("Stream socket connection created a new wrapper object for " . "an existing persistent connection on URL %s", $this->url), 8164); } } } if (! stream_set_blocking($this->sock, 0)) { throw new \Exception("Failed to place stream connection in non-blocking mode", 2795); } $this->connected = true; self::$All[] = $this; } function isReusedPSock () { return ($this->stfp > 0); } function getConnectionStartFP () { return $this->stfp; } function tell () { return ftell($this->sock); } function select ($tvSec, $tvUsec = 0, $rw = self::READ_SELECT) { $read = $write = $ex = null; if ($rw & self::READ_SELECT) { $read = $ex = array($this->sock); } if ($rw & self::WRITE_SELECT) { $write = array($this->sock); } if (! $read && ! $write) { throw new \Exception("Select must read and/or write", 9864); } $this->interrupt = false; $ret = stream_select($read, $write, $ex, $tvSec, $tvUsec); if ($ret === false) { $this->interrupt = true; } return $ret; } static function Zelekt (array $incSet, $tvSec, $tvUsec) { $write = null; $read = $all = array(); foreach (self::$All as $i => $o) { if (in_array($o->id, $incSet)) { $read[$i] = $all[$i] = $o->sock; } } $ex = $read; $ret = false; if ($read) { $ret = stream_select($read, $write, $ex, $tvSec, $tvUsec); } if ($ret === false) { return false; } $_read = $_ex = array(); foreach ($read as $sock) { if (false !== ($key = array_search($sock, $all, true))) { $_read[] = self::$All[$key]; } } foreach ($ex as $k => $sock) { if (false !== ($key = array_search($sock, $all, true))) { $_ex[] = self::$All[$key]; } } return array($ret, $_read, $_ex); } function selectInterrupted () { return $this->interrupt; } function lastError () { return $this->errFlag; } function clearErrors () { $this->errFlag = 0; } function strError () { switch ($this->errFlag) { case 1: return "Read error detected"; case 2: return "Write error detected"; case 3: return "Read and write errors detected"; default: return "No error detected"; } } function readAll ($readLen = self::READ_LENGTH) { $buff = ''; do { $buff .= $chk = fread($this->sock, $readLen); $smd = stream_get_meta_data($this->sock); $readLen = min($smd['unread_bytes'], $readLen); } while ($chk !== false && $smd['unread_bytes'] > 0); if (! $chk) { trigger_error("Stream fread returned false", E_USER_WARNING); $this->errFlag |= 1; } if (DEBUG) { echo "\n<read>\n"; echo wire\Hexdump::hexdump($buff); } return $buff; } function read () { $buff = ''; $select = $this->select(self::BLOCK_TIMEOUT); if ($select === false) { return false; } else if ($select > 0) { $buff = $this->readAll(); } return $buff; } function getUnreadBytes () { return ($smd = stream_get_meta_data($this->sock)) ? $smd['unread_bytes'] : false; } function eof () { return feof($this->sock); } function write ($buff) { if (! $this->select(self::BLOCK_TIMEOUT, 0, self::WRITE_SELECT)) { trigger_error('StreamSocket select failed for write (stream socket err: "' . $this->strError() . ')', E_USER_WARNING); return 0; } $bw = 0; $contentLength = strlen($buff); if ($contentLength == 0) { return 0; } while (true) { if (DEBUG) { echo "\n<write>\n"; echo wire\Hexdump::hexdump($buff); } if (($tmp = fwrite($this->sock, $buff)) === false) { $this->errFlag |= 2; throw new \Exception(sprintf("\nStream write failed (error): %s\n", $this->strError()), 7854); } else if ($tmp === 0) { throw new \Exception(sprintf("\nStream write failed (zero bytes written): %s\n", $this->strError()), 7855); } $bw += $tmp; if ($bw < $contentLength) { $buff = substr($buff, $bw); } else { break; } } fflush($this->sock); return $bw; } function close () { $this->connected = false; fclose($this->sock); $this->detach(); } private function detach () { if (false !== ($k = array_search($this, self::$All))) { unset(self::$All[$k]); } } function getId () { return $this->id; } }
+ class MaxloopExitStrategy implements ExitStrategy { private $maxLoops; private $nLoops; function configure ($sMode, $ml=null) { if (! (is_int($ml) || is_numeric($ml)) || $ml == 0) { trigger_error("Select mode - invalid maxloops params : '$ml'", E_USER_WARNING); return false; } else { $this->maxLoops = (int) $ml; return true; } } function init (Connection $conn) { $this->nLoops = 0; } function preSelect ($prev=null) { if ($prev === false) { return false; } if (++$this->nLoops > $this->maxLoops) { return false; } else { return $prev; } } function complete () {} }
+ interface ExitStrategy { function configure ($sMode); function init (Connection $conn); function preSelect ($prev=null); function complete (); }
+ interface ChannelEventHandler { function publishConfirm (wire\Method $meth); function publishReturn (wire\Method $meth); function publishNack(wire\Method $meth); }
class Socket { const READ_SELECT = 1; const WRITE_SELECT = 2; const READ_LENGTH = 4096; const BLOCK_TIMEOUT = 5; private static $All = array(); private static $Counter = 0; private $host; private $port; private $sock; private $id; private $vhost; private $connected = false; private static $interrupt = false; function __construct ($params, $flags, $vhost) { $this->host = $params['host']; $this->port = $params['port']; $this->id = ++self::$Counter; $this->vhost = $vhost; } function getVHost () { return $this->vhost; } function getCK () { return sprintf("%s:%s:%s", $this->host, $this->port, md5($this->vhost)); } function connect () { if (! ($this->sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) { throw new \Exception("Failed to create inet socket", 7895); } else if (! socket_connect($this->sock, $this->host, $this->port)) { throw new \Exception("Failed to connect inet socket ({$this->host}, {$this->port})", 7564); } else if (! socket_set_nonblock($this->sock)) { throw new \Exception("Failed to switch connection in to non-blocking mode.", 2357); } $this->connected = true; self::$All[] = $this; } function isReusedPSock () { return false; } function select ($tvSec, $tvUsec = 0, $rw = self::READ_SELECT) { $read = $write = $ex = null; if ($rw & self::READ_SELECT) { $read = $ex = array($this->sock); } if ($rw & self::WRITE_SELECT) { $write = $ex = array($this->sock); } if (! $read && ! $write) { throw new \Exception("Select must read and/or write", 9864); } self::$interrupt = false; $ret = socket_select($read, $write, $ex, $tvSec, $tvUsec); if ($ret === false && $this->lastError() == SOCKET_EINTR) { self::$interrupt = true; } return $ret; } static function Zelekt (array $incSet, $tvSec, $tvUsec) { $write = null; $read = $all = array(); foreach (self::$All as $i => $o) { if (in_array($o->id, $incSet)) { $read[$i] = $all[$i] = $o->sock; } } $ex = $read; $ret = false; if ($read) { $ret = socket_select($read, $write, $ex, $tvSec, $tvUsec); } if ($ret === false && socket_last_error() == SOCKET_EINTR) { self::$interrupt = true; return false; } $_read = $_ex = array(); foreach ($read as $sock) { if (false !== ($key = array_search($sock, $all, true))) { $_read[] = self::$All[$key]; } } foreach ($ex as $k => $sock) { if (false !== ($key = array_search($sock, $all, true))) { $_ex[] = self::$All[$key]; } } return array($ret, $_read, $_ex); } function selectInterrupted () { return self::$interrupt; } function read () { $buff = ''; $select = $this->select(self::BLOCK_TIMEOUT); if ($select === false) { return false; } else if ($select > 0) { $buff = $this->readAll(); } return $buff; } function lastError () { return socket_last_error($this->sock); } function clearErrors () { socket_clear_error($this->sock); } function strError () { return socket_strerror($this->lastError()); } function readAll ($readLen = self::READ_LENGTH) { $buff = ''; while (@socket_recv($this->sock, $tmp, $readLen, MSG_DONTWAIT)) { $buff .= $tmp; } if (DEBUG) { echo "\n<read>\n"; echo wire\Hexdump::hexdump($buff); } return $buff; } function write ($buff) { if (! $this->select(self::BLOCK_TIMEOUT, 0, self::WRITE_SELECT)) { trigger_error('Socket select failed for write (socket err: "' . $this->strError() . ')', E_USER_WARNING); return 0; } $bw = 0; $contentLength = strlen($buff); while (true) { if (DEBUG) { echo "\n<write>\n"; echo wire\Hexdump::hexdump($buff); } if (($tmp = socket_write($this->sock, $buff)) === false) { throw new \Exception(sprintf("Socket write failed: %s", $this->strError()), 7854); } $bw += $tmp; if ($bw < $contentLength) { $buff = substr($buff, $bw); } else { break; } } return $bw; } function close () { $this->connected = false; socket_close($this->sock); $this->detach(); } private function detach () { if (false !== ($k = array_search($this, self::$All))) { unset(self::$All[$k]); } } function getId () { return $this->id; } }
- interface Consumer { function handleCancelOk (wire\Method $meth, Channel $chan); function handleCancel (wire\Method $meth, Channel $chan); function handleConsumeOk (wire\Method $meth, Channel $chan); function handleDelivery (wire\Method $meth, Channel $chan); function handleRecoveryOk (wire\Method $meth, Channel $chan); function getConsumeMethod (Channel $chan); }
+ interface Consumer { function handleCancelOk (wire\Method $meth, Channel $chan); function handleCancel (wire\Method $meth, Channel $chan); function handleConsumeOk (wire\Method $meth, Channel $chan); function handleDelivery (wire\Method $meth, Channel $chan); function handleRecoveryOk (wire\Method $meth, Channel $chan); function getConsumeMethod (Channel $chan); }
+ class SimpleConsumer implements Consumer { protected $consumeParams; protected $consuming = false; function __construct (array $consumeParams) { $this->consumeParams = $consumeParams; } function handleCancelOk (wire\Method $meth, Channel $chan) { $this->consuming = false; } function handleCancel (wire\Method $meth, Channel $chan) { $this->consuming = false; } function handleConsumeOk (wire\Method $meth, Channel $chan) { $this->consuming = true; } function handleDelivery (wire\Method $meth, Channel $chan) {} function handleRecoveryOk (wire\Method $meth, Channel $chan) {} function getConsumeMethod (Channel $chan) { return $chan->basic('consume', $this->consumeParams); } }
View
12 build/nspf/amqphp.protocol.abstrakt.php
@@ -1,10 +1,10 @@
<?php
-namespace amqphp\protocol\abstrakt;
- abstract class XmlSpecDomain { protected $name; protected $protocolType; final function getSpecDomainName () { return $this->name; } final function getSpecDomainType () { return $this->protocolType; } function validate($subject) { return true; } }
- abstract class DomainFactory { protected static $Cache; final static function IsDomain ($dName) { return isset(static::$Cache[$dName]); } final static function GetDomain ($dName) { if (isset(static::$Cache[$dName])) { return (is_string(static::$Cache[$dName])) ? (static::$Cache[$dName] = new static::$Cache[$dName]) : static::$Cache[$dName]; } } final static function Validate ($val, $dName) { return static::GetDomain($dName)->validate($val); } }
- abstract class XmlSpecClass { protected $name; protected $index; protected $fields; protected $methods; protected $methFact; protected $fieldFact; final function getSpecName () { return $this->name; } final function getSpecIndex () { return $this->index; } final function getSpecFields () { return $this->fields; } final function getSpecMethods () { return $this->methods; } final function getMethods () { return call_user_func(array($this->methFact, 'GetMethodsByName'), $this->methods); } final function getMethodByName ($mName) { if (in_array($mName, $this->methods)) { return call_user_func(array($this->methFact, 'GetMethodByName'), $mName); } } final function getMethodByIndex ($idx) { if (in_array($idx, array_keys($this->methods))) { return call_user_func(array($this->methFact, 'GetMethodByIndex'), $idx); } } final function getFields () { return call_user_func(array($this->fieldFact, 'GetClassFields'), $this->name); } final function getFieldByName ($fName) { if (in_array($fName, $this->fields)) { return call_user_func(array($this->fieldFact, 'GetField'), $fName); } } }
+namespace ${namespace};
abstract class XmlSpecMethod { protected $class; protected $name; protected $index; protected $synchronous; protected $responseMethods; protected $fields; protected $methFact; protected $fieldFact; protected $classFact; protected $content; final function getSpecClass () { return $this->class; } final function getSpecName () { return $this->name; } final function getSpecIndex () { return $this->index; } final function getSpecIsSynchronous () { return $this->synchronous; } final function getSpecResponseMethods () { return $this->responseMethods; } final function getSpecFields () { return $this->fields; } final function getSpecHasContent () { return $this->content; } final function getFields () { return call_user_func(array($this->fieldFact, 'GetFieldsForMethod'), $this->name); } final function getField ($fName) { if (in_array($fName, $this->fields)) { return call_user_func(array($this->fieldFact, 'GetField'), $fName, $this->name); } } final function getResponses () { return call_user_func(array($this->methFact, 'GetMethodsByName'), $this->responseMethods); } final function getClass () { return call_user_func(array($this->classFact, 'GetClassByName'), $this->class); } final function hasNoWaitField () { return $this->hasNoWait; } }
- abstract class ClassFactory { protected static $Cache; final static function GetClassByIndex ($index) { foreach (static::$Cache as $cNum => $c) { if ($c[0] === $index) { return is_string($c[2]) ? (static::$Cache[$cNum][2] = new $c[2]) : $c[2]; } } } final static function GetClassByName ($name) { foreach (static::$Cache as $cNum => $c) { if ($c[1] === $name) { return is_string($c[2]) ? (static::$Cache[$cNum][2] = new $c[2]) : $c[2]; } } } final static function GetMethod ($c, $m) { $c = is_int($c) || is_numeric($c) ? self::GetClassByIndex($c) : self::GetClassByName($c); if ($c) { $m = is_int($m) || is_numeric($m) ? $c->getMethodByIndex($m) : $c->getMethodByName($m); if ($m) { return $m; } } } }
+ abstract class FieldFactory { protected static $Cache; private static function Lookup ($fName, $mName = '') { foreach (static::$Cache as $i => $f) { if ($f[0] === $fName && $f[1] === $mName) { return $i; } } return false; } final static function IsField ($fName, $mName = '') { return (static::Lookup($fName, $mName) !== false); } final static function GetField ($fName, $mName = '') { if (false !== ($f = static::Lookup($fName, $mName))) { return is_string(static::$Cache[$f][2]) ? (static::$Cache[$f][2] = new static::$Cache[$f][2]) : static::$Cache[$f][2]; } } final static function GetClassFields () { $r = array(); foreach (static::$Cache as $f) { if ($f[1] === '') { $r[] = static::GetField($f[0]); } } return $r; } final static function GetFieldsForMethod ($mName) { $r = array(); foreach (static::$Cache as $f) { if ($f[1] === $mName) { $r[] = static::GetField($f[0], $mName); } } return $r; } final static function Validate ($val, $fName, $mName = '') { return static::GetField($fName, $mName)->validate($val); } }
interface XmlSpecField { function getSpecFieldName (); function getSpecFieldDomain (); }
+ abstract class ClassFactory { protected static $Cache; final static function GetClassByIndex ($index) { foreach (static::$Cache as $cNum => $c) { if ($c[0] === $index) { return is_string($c[2]) ? (static::$Cache[$cNum][2] = new $c[2]) : $c[2]; } } } final static function GetClassByName ($name) { foreach (static::$Cache as $cNum => $c) { if ($c[1] === $name) { return is_string($c[2]) ? (static::$Cache[$cNum][2] = new $c[2]) : $c[2]; } } } final static function GetMethod ($c, $m) { $c = is_int($c) || is_numeric($c) ? self::GetClassByIndex($c) : self::GetClassByName($c); if ($c) { $m = is_int($m) || is_numeric($m) ? $c->getMethodByIndex($m) : $c->getMethodByName($m); if ($m) { return $m; } } } }
abstract class MethodFactory { protected static $Cache; private static function Lookup ($mName, $asName = true) { $j = ($asName) ? 1 : 0; foreach (static::$Cache as $i => $f) { if ($f[$j] === $mName) { return $i; } } return false; } final static function GetMethodByName ($mName) { if (false !== ($i = static::Lookup($mName))) { return (is_string(static::$Cache[$i][2])) ? (static::$Cache[$i][2] = new static::$Cache[$i][2]) : static::$Cache[$i][2]; } } final static function GetMethodsByName (array $restrict = array()) { $m = array(); foreach (static::$Cache as $c) { if (! $restrict || in_array($c[1], $restrict)) { $m[] = static::GetMethodByName($c[1]); } } return $m; } final static function GetMethodByIndex ($idx) { if (false !== ($i = static::Lookup($idx, false))) { return (is_string(static::$Cache[$i][2])) ? (static::$Cache[$i][2] = new static::$Cache[$i][2]) : static::$Cache[$i][2]; } } final static function GetMethodsByIndex (array $restrict = array()) { $m = array(); foreach (static::$Cache as $c) { if (! $restrict || in_array($c[0], $restrict)) { $m[] = static::GetMethodByIndex($c[0]); } } return $m; } }
- abstract class FieldFactory { protected static $Cache; private static function Lookup ($fName, $mName = '') { foreach (static::$Cache as $i => $f) { if ($f[0] === $fName && $f[1] === $mName) { return $i; } } return false; } final static function IsField ($fName, $mName = '') { return (static::Lookup($fName, $mName) !== false); } final static function GetField ($fName, $mName = '') { if (false !== ($f = static::Lookup($fName, $mName))) { return is_string(static::$Cache[$f][2]) ? (static::$Cache[$f][2] = new static::$Cache[$f][2]) : static::$Cache[$f][2]; } } final static function GetClassFields () { $r = array(); foreach (static::$Cache as $f) { if ($f[1] === '') { $r[] = static::GetField($f[0]); } } return $r; } final static function GetFieldsForMethod ($mName) { $r = array(); foreach (static::$Cache as $f) { if ($f[1] === $mName) { $r[] = static::GetField($f[0], $mName); } } return $r; } final static function Validate ($val, $fName, $mName = '') { return static::GetField($fName, $mName)->validate($val); } }
+ abstract class XmlSpecClass { protected $name; protected $index; protected $fields; protected $methods; protected $methFact; protected $fieldFact; final function getSpecName () { return $this->name; } final function getSpecIndex () { return $this->index; } final function getSpecFields () { return $this->fields; } final function getSpecMethods () { return $this->methods; } final function getMethods () { return call_user_func(array($this->methFact, 'GetMethodsByName'), $this->methods); } final function getMethodByName ($mName) { if (in_array($mName, $this->methods)) { return call_user_func(array($this->methFact, 'GetMethodByName'), $mName); } } final function getMethodByIndex ($idx) { if (in_array($idx, array_keys($this->methods))) { return call_user_func(array($this->methFact, 'GetMethodByIndex'), $idx); } } final function getFields () { return call_user_func(array($this->fieldFact, 'GetClassFields'), $this->name); } final function getFieldByName ($fName) { if (in_array($fName, $this->fields)) { return call_user_func(array($this->fieldFact, 'GetField'), $fName); } } }
+ abstract class DomainFactory { protected static $Cache; final static function IsDomain ($dName) { return isset(static::$Cache[$dName]); } final static function GetDomain ($dName) { if (isset(static::$Cache[$dName])) { return (is_string(static::$Cache[$dName])) ? (static::$Cache[$dName] = new static::$Cache[$dName]) : static::$Cache[$dName]; } } final static function Validate ($val, $dName) { return static::GetDomain($dName)->validate($val); } }
+ abstract class XmlSpecDomain { protected $name; protected $protocolType; final function getSpecDomainName () { return $this->name; } final function getSpecDomainType () { return $this->protocolType; } function validate($subject) { return true; } }
View
136 build/nspf/amqphp.protocol.v0_9_1.basic.php
@@ -1,84 +1,84 @@
<?php
-namespace amqphp\protocol\v0_9_1\basic;
- class ExpirationField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'expiration'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class RecoverOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'recover-ok'; protected $index = 111; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class AppIdField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'app-id'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class GetEmptyReserved1Field extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class GetOkDeliveryTagField extends \amqphp\protocol\v0_9_1\DeliveryTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'delivery-tag'; } function getSpecFieldDomain() { return 'delivery-tag'; } }
- class GetOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'get-ok'; protected $index = 71; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('delivery-tag', 'redelivered', 'exchange', 'routing-key', 'message-count'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = true; protected $hasNoWait = false; }
- class RejectMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'reject'; protected $index = 90; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('delivery-tag', 'requeue'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class PublishRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class RecoverAsyncMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'recover-async'; protected $index = 100; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('requeue'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class DeliverMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'deliver'; protected $index = 60; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('consumer-tag', 'delivery-tag', 'redelivered', 'exchange', 'routing-key'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = true; protected $hasNoWait = false; }
+namespace ${namespace};
+ class GetOkExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } }
class QosPrefetchCountField extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'prefetch-count'; } function getSpecFieldDomain() { return 'short'; } }
- class ConsumeQueueField extends \amqphp\protocol\v0_9_1\QueueNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'queue'; } function getSpecFieldDomain() { return 'queue-name'; } }
- class QosGlobalField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'global'; } function getSpecFieldDomain() { return 'bit'; } }
- class NackDeliveryTagField extends \amqphp\protocol\v0_9_1\DeliveryTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'delivery-tag'; } function getSpecFieldDomain() { return 'delivery-tag'; } }
- class DeliverRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class ReturnReplyTextField extends \amqphp\protocol\v0_9_1\ReplyTextDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-text'; } function getSpecFieldDomain() { return 'reply-text'; } }
+ class MessageIdField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'message-id'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class RecoverAsyncRequeueField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'requeue'; } function getSpecFieldDomain() { return 'bit'; } }
+ class PublishMandatoryField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'mandatory'; } function getSpecFieldDomain() { return 'bit'; } }
+ class NackMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'nack'; protected $index = 120; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('delivery-tag', 'multiple', 'requeue'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class DeliverMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'deliver'; protected $index = 60; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('consumer-tag', 'delivery-tag', 'redelivered', 'exchange', 'routing-key'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = true; protected $hasNoWait = false; }
+ class DeliverDeliveryTagField extends \amqphp\protocol\v0_9_1\DeliveryTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'delivery-tag'; } function getSpecFieldDomain() { return 'delivery-tag'; } }
+ class ReturnExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } }
+ abstract class FieldFactory extends \amqphp\protocol\abstrakt\FieldFactory { protected static $Cache = array(array('content-type', '', '\\amqphp\\protocol\\v0_9_1\\basic\\ContentTypeField'),array('content-encoding', '', '\\amqphp\\protocol\\v0_9_1\\basic\\ContentEncodingField'),array('headers', '', '\\amqphp\\protocol\\v0_9_1\\basic\\HeadersField'),array('delivery-mode', '', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliveryModeField'),array('priority', '', '\\amqphp\\protocol\\v0_9_1\\basic\\PriorityField'),array('correlation-id', '', '\\amqphp\\protocol\\v0_9_1\\basic\\CorrelationIdField'),array('reply-to', '', '\\amqphp\\protocol\\v0_9_1\\basic\\ReplyToField'),array('expiration', '', '\\amqphp\\protocol\\v0_9_1\\basic\\ExpirationField'),array('message-id', '', '\\amqphp\\protocol\\v0_9_1\\basic\\MessageIdField'),array('timestamp', '', '\\amqphp\\protocol\\v0_9_1\\basic\\TimestampField'),array('type', '', '\\amqphp\\protocol\\v0_9_1\\basic\\TypeField'),array('user-id', '', '\\amqphp\\protocol\\v0_9_1\\basic\\UserIdField'),array('app-id', '', '\\amqphp\\protocol\\v0_9_1\\basic\\AppIdField'),array('reserved', '', '\\amqphp\\protocol\\v0_9_1\\basic\\ReservedField'),array('prefetch-size', 'qos', '\\amqphp\\protocol\\v0_9_1\\basic\\QosPrefetchSizeField'),array('prefetch-count', 'qos', '\\amqphp\\protocol\\v0_9_1\\basic\\QosPrefetchCountField'),array('global', 'qos', '\\amqphp\\protocol\\v0_9_1\\basic\\QosGlobalField'),array('reserved-1', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeReserved1Field'),array('queue', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeQueueField'),array('consumer-tag', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeConsumerTagField'),array('no-local', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeNoLocalField'),array('no-ack', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeNoAckField'),array('exclusive', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeExclusiveField'),array('no-wait', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeNoWaitField'),array('arguments', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeArgumentsField'),array('consumer-tag', 'consume-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeOkConsumerTagField'),array('consumer-tag', 'cancel', '\\amqphp\\protocol\\v0_9_1\\basic\\CancelConsumerTagField'),array('no-wait', 'cancel', '\\amqphp\\protocol\\v0_9_1\\basic\\CancelNoWaitField'),array('consumer-tag', 'cancel-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\CancelOkConsumerTagField'),array('reserved-1', 'publish', '\\amqphp\\protocol\\v0_9_1\\basic\\PublishReserved1Field'),array('exchange', 'publish', '\\amqphp\\protocol\\v0_9_1\\basic\\PublishExchangeField'),array('routing-key', 'publish', '\\amqphp\\protocol\\v0_9_1\\basic\\PublishRoutingKeyField'),array('mandatory', 'publish', '\\amqphp\\protocol\\v0_9_1\\basic\\PublishMandatoryField'),array('immediate', 'publish', '\\amqphp\\protocol\\v0_9_1\\basic\\PublishImmediateField'),array('reply-code', 'return', '\\amqphp\\protocol\\v0_9_1\\basic\\ReturnReplyCodeField'),array('reply-text', 'return', '\\amqphp\\protocol\\v0_9_1\\basic\\ReturnReplyTextField'),array('exchange', 'return', '\\amqphp\\protocol\\v0_9_1\\basic\\ReturnExchangeField'),array('routing-key', 'return', '\\amqphp\\protocol\\v0_9_1\\basic\\ReturnRoutingKeyField'),array('consumer-tag', 'deliver', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliverConsumerTagField'),array('delivery-tag', 'deliver', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliverDeliveryTagField'),array('redelivered', 'deliver', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliverRedeliveredField'),array('exchange', 'deliver', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliverExchangeField'),array('routing-key', 'deliver', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliverRoutingKeyField'),array('reserved-1', 'get', '\\amqphp\\protocol\\v0_9_1\\basic\\GetReserved1Field'),array('queue', 'get', '\\amqphp\\protocol\\v0_9_1\\basic\\GetQueueField'),array('no-ack', 'get', '\\amqphp\\protocol\\v0_9_1\\basic\\GetNoAckField'),array('delivery-tag', 'get-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\GetOkDeliveryTagField'),array('redelivered', 'get-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\GetOkRedeliveredField'),array('exchange', 'get-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\GetOkExchangeField'),array('routing-key', 'get-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\GetOkRoutingKeyField'),array('message-count', 'get-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\GetOkMessageCountField'),array('reserved-1', 'get-empty', '\\amqphp\\protocol\\v0_9_1\\basic\\GetEmptyReserved1Field'),array('delivery-tag', 'ack', '\\amqphp\\protocol\\v0_9_1\\basic\\AckDeliveryTagField'),array('multiple', 'ack', '\\amqphp\\protocol\\v0_9_1\\basic\\AckMultipleField'),array('delivery-tag', 'reject', '\\amqphp\\protocol\\v0_9_1\\basic\\RejectDeliveryTagField'),array('requeue', 'reject', '\\amqphp\\protocol\\v0_9_1\\basic\\RejectRequeueField'),array('requeue', 'recover-async', '\\amqphp\\protocol\\v0_9_1\\basic\\RecoverAsyncRequeueField'),array('requeue', 'recover', '\\amqphp\\protocol\\v0_9_1\\basic\\RecoverRequeueField'),array('delivery-tag', 'nack', '\\amqphp\\protocol\\v0_9_1\\basic\\NackDeliveryTagField'),array('multiple', 'nack', '\\amqphp\\protocol\\v0_9_1\\basic\\NackMultipleField'),array('requeue', 'nack', '\\amqphp\\protocol\\v0_9_1\\basic\\NackRequeueField')); }
+ class ConsumeMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'consume'; protected $index = 20; protected $synchronous = true; protected $responseMethods = array('consume-ok'); protected $fields = array('reserved-1', 'queue', 'consumer-tag', 'no-local', 'no-ack', 'exclusive', 'no-wait', 'arguments'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
class AckDeliveryTagField extends \amqphp\protocol\v0_9_1\DeliveryTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'delivery-tag'; } function getSpecFieldDomain() { return 'delivery-tag'; } }
+ class RejectMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'reject'; protected $index = 90; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('delivery-tag', 'requeue'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class QosPrefetchSizeField extends \amqphp\protocol\v0_9_1\LongDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'prefetch-size'; } function getSpecFieldDomain() { return 'long'; } }
+ class PublishRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
class PublishMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'publish'; protected $index = 40; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('reserved-1', 'exchange', 'routing-key', 'mandatory', 'immediate'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = true; protected $hasNoWait = false; }
- class DeliverDeliveryTagField extends \amqphp\protocol\v0_9_1\DeliveryTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'delivery-tag'; } function getSpecFieldDomain() { return 'delivery-tag'; } }
- class CancelOkConsumerTagField extends \amqphp\protocol\v0_9_1\ConsumerTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'consumer-tag'; } function getSpecFieldDomain() { return 'consumer-tag'; } }
- class CorrelationIdField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'correlation-id'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class ConsumeNoLocalField extends \amqphp\protocol\v0_9_1\NoLocalDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-local'; } function getSpecFieldDomain() { return 'no-local'; } }
- class HeadersField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'headers'; } function getSpecFieldDomain() { return 'table'; } }
+ class ReservedField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class ReturnRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class ContentTypeField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'content-type'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class CancelNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
+ class ConsumeReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
+ class ReturnReplyCodeField extends \amqphp\protocol\v0_9_1\ReplyCodeDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-code'; } function getSpecFieldDomain() { return 'reply-code'; } }
+ class RecoverRequeueField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'requeue'; } function getSpecFieldDomain() { return 'bit'; } }
+ class ConsumeOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'consume-ok'; protected $index = 21; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('consumer-tag'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class ContentEncodingField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'content-encoding'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class NackDeliveryTagField extends \amqphp\protocol\v0_9_1\DeliveryTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'delivery-tag'; } function getSpecFieldDomain() { return 'delivery-tag'; } }
+ class GetOkRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class RecoverOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'recover-ok'; protected $index = 111; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class ConsumeConsumerTagField extends \amqphp\protocol\v0_9_1\ConsumerTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'consumer-tag'; } function getSpecFieldDomain() { return 'consumer-tag'; } }
+ class ConsumeNoAckField extends \amqphp\protocol\v0_9_1\NoAckDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-ack'; } function getSpecFieldDomain() { return 'no-ack'; } }
+ class ReplyToField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-to'; } function getSpecFieldDomain() { return 'shortstr'; } }
class NackMultipleField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'multiple'; } function getSpecFieldDomain() { return 'bit'; } }
- class DeliveryModeField extends \amqphp\protocol\v0_9_1\OctetDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'delivery-mode'; } function getSpecFieldDomain() { return 'octet'; } }
- class RejectDeliveryTagField extends \amqphp\protocol\v0_9_1\DeliveryTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'delivery-tag'; } function getSpecFieldDomain() { return 'delivery-tag'; } }
- class GetEmptyMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'get-empty'; protected $index = 72; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('reserved-1'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class RejectRequeueField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'requeue'; } function getSpecFieldDomain() { return 'bit'; } }
+ class PublishImmediateField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'immediate'; } function getSpecFieldDomain() { return 'bit'; } }
class NackRequeueField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'requeue'; } function getSpecFieldDomain() { return 'bit'; } }
class CancelConsumerTagField extends \amqphp\protocol\v0_9_1\ConsumerTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'consumer-tag'; } function getSpecFieldDomain() { return 'consumer-tag'; } }
- class MessageIdField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'message-id'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class CancelOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'cancel-ok'; protected $index = 31; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('consumer-tag'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class GetEmptyMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'get-empty'; protected $index = 72; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('reserved-1'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class GetOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'get-ok'; protected $index = 71; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('delivery-tag', 'redelivered', 'exchange', 'routing-key', 'message-count'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = true; protected $hasNoWait = false; }
+ class AckMultipleField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'multiple'; } function getSpecFieldDomain() { return 'bit'; } }
+ class GetQueueField extends \amqphp\protocol\v0_9_1\QueueNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'queue'; } function getSpecFieldDomain() { return 'queue-name'; } }
+ class HeadersField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'headers'; } function getSpecFieldDomain() { return 'table'; } }
class ConsumeArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
- class ConsumeReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
- class ContentEncodingField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'content-encoding'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class GetOkRedeliveredField extends \amqphp\protocol\v0_9_1\RedeliveredDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'redelivered'; } function getSpecFieldDomain() { return 'redelivered'; } }
+ class GetEmptyReserved1Field extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class TimestampField extends \amqphp\protocol\v0_9_1\TimestampDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'timestamp'; } function getSpecFieldDomain() { return 'timestamp'; } }
+ class RecoverMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'recover'; protected $index = 110; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('requeue'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class PublishReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
class QosMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'qos'; protected $index = 10; protected $synchronous = true; protected $responseMethods = array('qos-ok'); protected $fields = array('prefetch-size', 'prefetch-count', 'global'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class GetOkDeliveryTagField extends \amqphp\protocol\v0_9_1\DeliveryTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'delivery-tag'; } function getSpecFieldDomain() { return 'delivery-tag'; } }
+ class ReturnMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'return'; protected $index = 50; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('reply-code', 'reply-text', 'exchange', 'routing-key'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = true; protected $hasNoWait = false; }
+ class DeliverExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } }
class AckMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'ack'; protected $index = 80; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('delivery-tag', 'multiple'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class CancelNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
- class GetQueueField extends \amqphp\protocol\v0_9_1\QueueNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'queue'; } function getSpecFieldDomain() { return 'queue-name'; } }
- class QosPrefetchSizeField extends \amqphp\protocol\v0_9_1\LongDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'prefetch-size'; } function getSpecFieldDomain() { return 'long'; } }
- class PublishImmediateField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'immediate'; } function getSpecFieldDomain() { return 'bit'; } }
- class CancelMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'cancel'; protected $index = 30; protected $synchronous = true; protected $responseMethods = array('cancel-ok'); protected $fields = array('consumer-tag', 'no-wait'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
- class BasicClass extends \amqphp\protocol\abstrakt\XmlSpecClass { protected $name = 'basic'; protected $index = 60; protected $fields = array('content-type','content-encoding','headers','delivery-mode','priority','correlation-id','reply-to','expiration','message-id','timestamp','type','user-id','app-id','reserved'); protected $methods = array(10 => 'qos',11 => 'qos-ok',20 => 'consume',21 => 'consume-ok',30 => 'cancel',31 => 'cancel-ok',40 => 'publish',50 => 'return',60 => 'deliver',70 => 'get',71 => 'get-ok',72 => 'get-empty',80 => 'ack',90 => 'reject',100 => 'recover-async',110 => 'recover',111 => 'recover-ok',120 => 'nack'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; }
- class PublishReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
+ class GetMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'get'; protected $index = 70; protected $synchronous = true; protected $responseMethods = array('get-ok', 'get-empty'); protected $fields = array('reserved-1', 'queue', 'no-ack'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class GetOkRedeliveredField extends \amqphp\protocol\v0_9_1\RedeliveredDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'redelivered'; } function getSpecFieldDomain() { return 'redelivered'; } }
+ class ConsumeNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
+ class UserIdField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'user-id'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class RejectDeliveryTagField extends \amqphp\protocol\v0_9_1\DeliveryTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'delivery-tag'; } function getSpecFieldDomain() { return 'delivery-tag'; } }
+ class PublishExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } }
class DeliverRedeliveredField extends \amqphp\protocol\v0_9_1\RedeliveredDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'redelivered'; } function getSpecFieldDomain() { return 'redelivered'; } }
- class PublishMandatoryField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'mandatory'; } function getSpecFieldDomain() { return 'bit'; } }
class ConsumeOkConsumerTagField extends \amqphp\protocol\v0_9_1\ConsumerTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'consumer-tag'; } function getSpecFieldDomain() { return 'consumer-tag'; } }
- class DeliverExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } }
class QosOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'qos-ok'; protected $index = 11; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class ConsumeConsumerTagField extends \amqphp\protocol\v0_9_1\ConsumerTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'consumer-tag'; } function getSpecFieldDomain() { return 'consumer-tag'; } }
- class TimestampField extends \amqphp\protocol\v0_9_1\TimestampDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'timestamp'; } function getSpecFieldDomain() { return 'timestamp'; } }
- class ConsumeMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'consume'; protected $index = 20; protected $synchronous = true; protected $responseMethods = array('consume-ok'); protected $fields = array('reserved-1', 'queue', 'consumer-tag', 'no-local', 'no-ack', 'exclusive', 'no-wait', 'arguments'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
- class DeliverConsumerTagField extends \amqphp\protocol\v0_9_1\ConsumerTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'consumer-tag'; } function getSpecFieldDomain() { return 'consumer-tag'; } }
- class RecoverRequeueField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'requeue'; } function getSpecFieldDomain() { return 'bit'; } }
- class PublishExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } }
- class ReturnReplyCodeField extends \amqphp\protocol\v0_9_1\ReplyCodeDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-code'; } function getSpecFieldDomain() { return 'reply-code'; } }
- class NackMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'nack'; protected $index = 120; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('delivery-tag', 'multiple', 'requeue'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class RejectRequeueField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'requeue'; } function getSpecFieldDomain() { return 'bit'; } }
- class ReturnReplyTextField extends \amqphp\protocol\v0_9_1\ReplyTextDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-text'; } function getSpecFieldDomain() { return 'reply-text'; } }
- class ReturnRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class UserIdField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'user-id'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class GetReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
- class GetOkMessageCountField extends \amqphp\protocol\v0_9_1\MessageCountDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'message-count'; } function getSpecFieldDomain() { return 'message-count'; } }
abstract class MethodFactory extends \amqphp\protocol\abstrakt\MethodFactory { protected static $Cache = array(array(10, 'qos', '\\amqphp\\protocol\\v0_9_1\\basic\\QosMethod'),array(11, 'qos-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\QosOkMethod'),array(20, 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeMethod'),array(21, 'consume-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeOkMethod'),array(30, 'cancel', '\\amqphp\\protocol\\v0_9_1\\basic\\CancelMethod'),array(31, 'cancel-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\CancelOkMethod'),array(40, 'publish', '\\amqphp\\protocol\\v0_9_1\\basic\\PublishMethod'),array(50, 'return', '\\amqphp\\protocol\\v0_9_1\\basic\\ReturnMethod'),array(60, 'deliver', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliverMethod'),array(70, 'get', '\\amqphp\\protocol\\v0_9_1\\basic\\GetMethod'),array(71, 'get-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\GetOkMethod'),array(72, 'get-empty', '\\amqphp\\protocol\\v0_9_1\\basic\\GetEmptyMethod'),array(80, 'ack', '\\amqphp\\protocol\\v0_9_1\\basic\\AckMethod'),array(90, 'reject', '\\amqphp\\protocol\\v0_9_1\\basic\\RejectMethod'),array(100, 'recover-async', '\\amqphp\\protocol\\v0_9_1\\basic\\RecoverAsyncMethod'),array(110, 'recover', '\\amqphp\\protocol\\v0_9_1\\basic\\RecoverMethod'),array(111, 'recover-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\RecoverOkMethod'),array(120, 'nack', '\\amqphp\\protocol\\v0_9_1\\basic\\NackMethod')); }
- class ReplyToField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-to'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class GetReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
+ class ConsumeNoLocalField extends \amqphp\protocol\v0_9_1\NoLocalDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-local'; } function getSpecFieldDomain() { return 'no-local'; } }
+ class RecoverAsyncMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'recover-async'; protected $index = 100; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('requeue'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class DeliverConsumerTagField extends \amqphp\protocol\v0_9_1\ConsumerTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'consumer-tag'; } function getSpecFieldDomain() { return 'consumer-tag'; } }
class ConsumeExclusiveField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exclusive'; } function getSpecFieldDomain() { return 'bit'; } }
- class ConsumeNoAckField extends \amqphp\protocol\v0_9_1\NoAckDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-ack'; } function getSpecFieldDomain() { return 'no-ack'; } }
- class RecoverMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'recover'; protected $index = 110; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('requeue'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class ReturnExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } }
- class AckMultipleField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'multiple'; } function getSpecFieldDomain() { return 'bit'; } }
- class CancelOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'cancel-ok'; protected $index = 31; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('consumer-tag'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class GetMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'get'; protected $index = 70; protected $synchronous = true; protected $responseMethods = array('get-ok', 'get-empty'); protected $fields = array('reserved-1', 'queue', 'no-ack'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class ReservedField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class TypeField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'type'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class BasicClass extends \amqphp\protocol\abstrakt\XmlSpecClass { protected $name = 'basic'; protected $index = 60; protected $fields = array('content-type','content-encoding','headers','delivery-mode','priority','correlation-id','reply-to','expiration','message-id','timestamp','type','user-id','app-id','reserved'); protected $methods = array(10 => 'qos',11 => 'qos-ok',20 => 'consume',21 => 'consume-ok',30 => 'cancel',31 => 'cancel-ok',40 => 'publish',50 => 'return',60 => 'deliver',70 => 'get',71 => 'get-ok',72 => 'get-empty',80 => 'ack',90 => 'reject',100 => 'recover-async',110 => 'recover',111 => 'recover-ok',120 => 'nack'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; }
+ class GetOkMessageCountField extends \amqphp\protocol\v0_9_1\MessageCountDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'message-count'; } function getSpecFieldDomain() { return 'message-count'; } }
+ class ConsumeQueueField extends \amqphp\protocol\v0_9_1\QueueNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'queue'; } function getSpecFieldDomain() { return 'queue-name'; } }
+ class CorrelationIdField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'correlation-id'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class DeliveryModeField extends \amqphp\protocol\v0_9_1\OctetDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'delivery-mode'; } function getSpecFieldDomain() { return 'octet'; } }
+ class CancelOkConsumerTagField extends \amqphp\protocol\v0_9_1\ConsumerTagDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'consumer-tag'; } function getSpecFieldDomain() { return 'consumer-tag'; } }
+ class ExpirationField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'expiration'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class QosGlobalField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'global'; } function getSpecFieldDomain() { return 'bit'; } }
+ class DeliverRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class AppIdField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'app-id'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class CancelMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'cancel'; protected $index = 30; protected $synchronous = true; protected $responseMethods = array('cancel-ok'); protected $fields = array('consumer-tag', 'no-wait'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
class PriorityField extends \amqphp\protocol\v0_9_1\OctetDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'priority'; } function getSpecFieldDomain() { return 'octet'; } }
- class ReturnMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'return'; protected $index = 50; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('reply-code', 'reply-text', 'exchange', 'routing-key'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = true; protected $hasNoWait = false; }
- class ConsumeOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'basic'; protected $name = 'consume-ok'; protected $index = 21; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('consumer-tag'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\basic\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\basic\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class ContentTypeField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'content-type'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class GetNoAckField extends \amqphp\protocol\v0_9_1\NoAckDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-ack'; } function getSpecFieldDomain() { return 'no-ack'; } }
- class GetOkExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } }
- class ConsumeNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
- abstract class FieldFactory extends \amqphp\protocol\abstrakt\FieldFactory { protected static $Cache = array(array('content-type', '', '\\amqphp\\protocol\\v0_9_1\\basic\\ContentTypeField'),array('content-encoding', '', '\\amqphp\\protocol\\v0_9_1\\basic\\ContentEncodingField'),array('headers', '', '\\amqphp\\protocol\\v0_9_1\\basic\\HeadersField'),array('delivery-mode', '', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliveryModeField'),array('priority', '', '\\amqphp\\protocol\\v0_9_1\\basic\\PriorityField'),array('correlation-id', '', '\\amqphp\\protocol\\v0_9_1\\basic\\CorrelationIdField'),array('reply-to', '', '\\amqphp\\protocol\\v0_9_1\\basic\\ReplyToField'),array('expiration', '', '\\amqphp\\protocol\\v0_9_1\\basic\\ExpirationField'),array('message-id', '', '\\amqphp\\protocol\\v0_9_1\\basic\\MessageIdField'),array('timestamp', '', '\\amqphp\\protocol\\v0_9_1\\basic\\TimestampField'),array('type', '', '\\amqphp\\protocol\\v0_9_1\\basic\\TypeField'),array('user-id', '', '\\amqphp\\protocol\\v0_9_1\\basic\\UserIdField'),array('app-id', '', '\\amqphp\\protocol\\v0_9_1\\basic\\AppIdField'),array('reserved', '', '\\amqphp\\protocol\\v0_9_1\\basic\\ReservedField'),array('prefetch-size', 'qos', '\\amqphp\\protocol\\v0_9_1\\basic\\QosPrefetchSizeField'),array('prefetch-count', 'qos', '\\amqphp\\protocol\\v0_9_1\\basic\\QosPrefetchCountField'),array('global', 'qos', '\\amqphp\\protocol\\v0_9_1\\basic\\QosGlobalField'),array('reserved-1', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeReserved1Field'),array('queue', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeQueueField'),array('consumer-tag', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeConsumerTagField'),array('no-local', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeNoLocalField'),array('no-ack', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeNoAckField'),array('exclusive', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeExclusiveField'),array('no-wait', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeNoWaitField'),array('arguments', 'consume', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeArgumentsField'),array('consumer-tag', 'consume-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\ConsumeOkConsumerTagField'),array('consumer-tag', 'cancel', '\\amqphp\\protocol\\v0_9_1\\basic\\CancelConsumerTagField'),array('no-wait', 'cancel', '\\amqphp\\protocol\\v0_9_1\\basic\\CancelNoWaitField'),array('consumer-tag', 'cancel-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\CancelOkConsumerTagField'),array('reserved-1', 'publish', '\\amqphp\\protocol\\v0_9_1\\basic\\PublishReserved1Field'),array('exchange', 'publish', '\\amqphp\\protocol\\v0_9_1\\basic\\PublishExchangeField'),array('routing-key', 'publish', '\\amqphp\\protocol\\v0_9_1\\basic\\PublishRoutingKeyField'),array('mandatory', 'publish', '\\amqphp\\protocol\\v0_9_1\\basic\\PublishMandatoryField'),array('immediate', 'publish', '\\amqphp\\protocol\\v0_9_1\\basic\\PublishImmediateField'),array('reply-code', 'return', '\\amqphp\\protocol\\v0_9_1\\basic\\ReturnReplyCodeField'),array('reply-text', 'return', '\\amqphp\\protocol\\v0_9_1\\basic\\ReturnReplyTextField'),array('exchange', 'return', '\\amqphp\\protocol\\v0_9_1\\basic\\ReturnExchangeField'),array('routing-key', 'return', '\\amqphp\\protocol\\v0_9_1\\basic\\ReturnRoutingKeyField'),array('consumer-tag', 'deliver', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliverConsumerTagField'),array('delivery-tag', 'deliver', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliverDeliveryTagField'),array('redelivered', 'deliver', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliverRedeliveredField'),array('exchange', 'deliver', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliverExchangeField'),array('routing-key', 'deliver', '\\amqphp\\protocol\\v0_9_1\\basic\\DeliverRoutingKeyField'),array('reserved-1', 'get', '\\amqphp\\protocol\\v0_9_1\\basic\\GetReserved1Field'),array('queue', 'get', '\\amqphp\\protocol\\v0_9_1\\basic\\GetQueueField'),array('no-ack', 'get', '\\amqphp\\protocol\\v0_9_1\\basic\\GetNoAckField'),array('delivery-tag', 'get-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\GetOkDeliveryTagField'),array('redelivered', 'get-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\GetOkRedeliveredField'),array('exchange', 'get-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\GetOkExchangeField'),array('routing-key', 'get-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\GetOkRoutingKeyField'),array('message-count', 'get-ok', '\\amqphp\\protocol\\v0_9_1\\basic\\GetOkMessageCountField'),array('reserved-1', 'get-empty', '\\amqphp\\protocol\\v0_9_1\\basic\\GetEmptyReserved1Field'),array('delivery-tag', 'ack', '\\amqphp\\protocol\\v0_9_1\\basic\\AckDeliveryTagField'),array('multiple', 'ack', '\\amqphp\\protocol\\v0_9_1\\basic\\AckMultipleField'),array('delivery-tag', 'reject', '\\amqphp\\protocol\\v0_9_1\\basic\\RejectDeliveryTagField'),array('requeue', 'reject', '\\amqphp\\protocol\\v0_9_1\\basic\\RejectRequeueField'),array('requeue', 'recover-async', '\\amqphp\\protocol\\v0_9_1\\basic\\RecoverAsyncRequeueField'),array('requeue', 'recover', '\\amqphp\\protocol\\v0_9_1\\basic\\RecoverRequeueField'),array('delivery-tag', 'nack', '\\amqphp\\protocol\\v0_9_1\\basic\\NackDeliveryTagField'),array('multiple', 'nack', '\\amqphp\\protocol\\v0_9_1\\basic\\NackMultipleField'),array('requeue', 'nack', '\\amqphp\\protocol\\v0_9_1\\basic\\NackRequeueField')); }
- class RecoverAsyncRequeueField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'requeue'; } function getSpecFieldDomain() { return 'bit'; } }
- class GetOkRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class TypeField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'type'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class GetNoAckField extends \amqphp\protocol\v0_9_1\NoAckDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-ack'; } function getSpecFieldDomain() { return 'no-ack'; } }
View
24 build/nspf/amqphp.protocol.v0_9_1.channel.php
@@ -1,19 +1,19 @@
<?php
-namespace amqphp\protocol\v0_9_1\channel;
- class FlowOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'channel'; protected $name = 'flow-ok'; protected $index = 21; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('active'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class CloseMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'channel'; protected $name = 'close'; protected $index = 40; protected $synchronous = true; protected $responseMethods = array('close-ok'); protected $fields = array('reply-code', 'reply-text', 'class-id', 'method-id'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class OpenOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'channel'; protected $name = 'open-ok'; protected $index = 11; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('reserved-1'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class CloseClassIdField extends \amqphp\protocol\v0_9_1\ClassIdDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'class-id'; } function getSpecFieldDomain() { return 'class-id'; } }
- class OpenMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'channel'; protected $name = 'open'; protected $index = 10; protected $synchronous = true; protected $responseMethods = array('open-ok'); protected $fields = array('reserved-1'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+namespace ${namespace};
class FlowOkActiveField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'active'; } function getSpecFieldDomain() { return 'bit'; } }
+ class FlowMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'channel'; protected $name = 'flow'; protected $index = 20; protected $synchronous = true; protected $responseMethods = array('flow-ok'); protected $fields = array('active'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class CloseClassIdField extends \amqphp\protocol\v0_9_1\ClassIdDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'class-id'; } function getSpecFieldDomain() { return 'class-id'; } }
+ class OpenOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'channel'; protected $name = 'open-ok'; protected $index = 11; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('reserved-1'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ abstract class FieldFactory extends \amqphp\protocol\abstrakt\FieldFactory { protected static $Cache = array(array('reserved-1', 'open', '\\amqphp\\protocol\\v0_9_1\\channel\\OpenReserved1Field'),array('reserved-1', 'open-ok', '\\amqphp\\protocol\\v0_9_1\\channel\\OpenOkReserved1Field'),array('active', 'flow', '\\amqphp\\protocol\\v0_9_1\\channel\\FlowActiveField'),array('active', 'flow-ok', '\\amqphp\\protocol\\v0_9_1\\channel\\FlowOkActiveField'),array('reply-code', 'close', '\\amqphp\\protocol\\v0_9_1\\channel\\CloseReplyCodeField'),array('reply-text', 'close', '\\amqphp\\protocol\\v0_9_1\\channel\\CloseReplyTextField'),array('class-id', 'close', '\\amqphp\\protocol\\v0_9_1\\channel\\CloseClassIdField'),array('method-id', 'close', '\\amqphp\\protocol\\v0_9_1\\channel\\CloseMethodIdField')); }
class FlowActiveField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'active'; } function getSpecFieldDomain() { return 'bit'; } }
+ class OpenReserved1Field extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class CloseReplyTextField extends \amqphp\protocol\v0_9_1\ReplyTextDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-text'; } function getSpecFieldDomain() { return 'reply-text'; } }
class CloseMethodIdField extends \amqphp\protocol\v0_9_1\MethodIdDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'method-id'; } function getSpecFieldDomain() { return 'method-id'; } }
- class CloseOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'channel'; protected $name = 'close-ok'; protected $index = 41; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
class ChannelClass extends \amqphp\protocol\abstrakt\XmlSpecClass { protected $name = 'channel'; protected $index = 20; protected $fields = array(); protected $methods = array(10 => 'open',11 => 'open-ok',20 => 'flow',21 => 'flow-ok',40 => 'close',41 => 'close-ok'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; }
- class CloseReplyCodeField extends \amqphp\protocol\v0_9_1\ReplyCodeDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-code'; } function getSpecFieldDomain() { return 'reply-code'; } }
- class OpenReserved1Field extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'shortstr'; } }
class OpenOkReserved1Field extends \amqphp\protocol\v0_9_1\LongstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'longstr'; } }
+ class CloseReplyCodeField extends \amqphp\protocol\v0_9_1\ReplyCodeDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-code'; } function getSpecFieldDomain() { return 'reply-code'; } }
+ class CloseOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'channel'; protected $name = 'close-ok'; protected $index = 41; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class CloseMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'channel'; protected $name = 'close'; protected $index = 40; protected $synchronous = true; protected $responseMethods = array('close-ok'); protected $fields = array('reply-code', 'reply-text', 'class-id', 'method-id'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class FlowOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'channel'; protected $name = 'flow-ok'; protected $index = 21; protected $synchronous = false; protected $responseMethods = array(); protected $fields = array('active'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
abstract class MethodFactory extends \amqphp\protocol\abstrakt\MethodFactory { protected static $Cache = array(array(10, 'open', '\\amqphp\\protocol\\v0_9_1\\channel\\OpenMethod'),array(11, 'open-ok', '\\amqphp\\protocol\\v0_9_1\\channel\\OpenOkMethod'),array(20, 'flow', '\\amqphp\\protocol\\v0_9_1\\channel\\FlowMethod'),array(21, 'flow-ok', '\\amqphp\\protocol\\v0_9_1\\channel\\FlowOkMethod'),array(40, 'close', '\\amqphp\\protocol\\v0_9_1\\channel\\CloseMethod'),array(41, 'close-ok', '\\amqphp\\protocol\\v0_9_1\\channel\\CloseOkMethod')); }
- class FlowMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'channel'; protected $name = 'flow'; protected $index = 20; protected $synchronous = true; protected $responseMethods = array('flow-ok'); protected $fields = array('active'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class CloseReplyTextField extends \amqphp\protocol\v0_9_1\ReplyTextDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-text'; } function getSpecFieldDomain() { return 'reply-text'; } }
- abstract class FieldFactory extends \amqphp\protocol\abstrakt\FieldFactory { protected static $Cache = array(array('reserved-1', 'open', '\\amqphp\\protocol\\v0_9_1\\channel\\OpenReserved1Field'),array('reserved-1', 'open-ok', '\\amqphp\\protocol\\v0_9_1\\channel\\OpenOkReserved1Field'),array('active', 'flow', '\\amqphp\\protocol\\v0_9_1\\channel\\FlowActiveField'),array('active', 'flow-ok', '\\amqphp\\protocol\\v0_9_1\\channel\\FlowOkActiveField'),array('reply-code', 'close', '\\amqphp\\protocol\\v0_9_1\\channel\\CloseReplyCodeField'),array('reply-text', 'close', '\\amqphp\\protocol\\v0_9_1\\channel\\CloseReplyTextField'),array('class-id', 'close', '\\amqphp\\protocol\\v0_9_1\\channel\\CloseClassIdField'),array('method-id', 'close', '\\amqphp\\protocol\\v0_9_1\\channel\\CloseMethodIdField')); }
+ class OpenMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'channel'; protected $name = 'open'; protected $index = 10; protected $synchronous = true; protected $responseMethods = array('open-ok'); protected $fields = array('reserved-1'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\channel\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\channel\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
View
10 build/nspf/amqphp.protocol.v0_9_1.confirm.php
@@ -1,8 +1,8 @@
<?php
-namespace amqphp\protocol\v0_9_1\confirm;
- class ConfirmClass extends \amqphp\protocol\abstrakt\XmlSpecClass { protected $name = 'confirm'; protected $index = 85; protected $fields = array(); protected $methods = array(10 => 'select',11 => 'select-ok'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\confirm\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\confirm\\FieldFactory'; }
+namespace ${namespace};
class SelectNowaitField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'nowait'; } function getSpecFieldDomain() { return 'bit'; } }
- class SelectMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'confirm'; protected $name = 'select'; protected $index = 10; protected $synchronous = true; protected $responseMethods = array('select-ok'); protected $fields = array('nowait'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\confirm\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\confirm\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- abstract class MethodFactory extends \amqphp\protocol\abstrakt\MethodFactory { protected static $Cache = array(array(10, 'select', '\\amqphp\\protocol\\v0_9_1\\confirm\\SelectMethod'),array(11, 'select-ok', '\\amqphp\\protocol\\v0_9_1\\confirm\\SelectOkMethod')); }
+ abstract class FieldFactory extends \amqphp\protocol\abstrakt\FieldFactory { protected static $Cache = array(array('nowait', 'select', '\\amqphp\\protocol\\v0_9_1\\confirm\\SelectNowaitField')); }
class SelectOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'confirm'; protected $name = 'select-ok'; protected $index = 11; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\confirm\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\confirm\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- abstract class FieldFactory extends \amqphp\protocol\abstrakt\FieldFactory { protected static $Cache = array(array('nowait', 'select', '\\amqphp\\protocol\\v0_9_1\\confirm\\SelectNowaitField')); }
+ abstract class MethodFactory extends \amqphp\protocol\abstrakt\MethodFactory { protected static $Cache = array(array(10, 'select', '\\amqphp\\protocol\\v0_9_1\\confirm\\SelectMethod'),array(11, 'select-ok', '\\amqphp\\protocol\\v0_9_1\\confirm\\SelectOkMethod')); }
+ class ConfirmClass extends \amqphp\protocol\abstrakt\XmlSpecClass { protected $name = 'confirm'; protected $index = 85; protected $fields = array(); protected $methods = array(10 => 'select',11 => 'select-ok'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\confirm\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\confirm\\FieldFactory'; }
+ class SelectMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'confirm'; protected $name = 'select'; protected $index = 10; protected $synchronous = true; protected $responseMethods = array('select-ok'); protected $fields = array('nowait'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\confirm\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\confirm\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
View
62 build/nspf/amqphp.protocol.v0_9_1.connection.php
@@ -1,40 +1,40 @@
<?php
-namespace amqphp\protocol\v0_9_1\connection;
- class TuneOkHeartbeatField extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'heartbeat'; } function getSpecFieldDomain() { return 'short'; } }
- class TuneFrameMaxField extends \amqphp\protocol\v0_9_1\LongDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'frame-max'; } function getSpecFieldDomain() { return 'long'; } }
- class CloseMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'close'; protected $index = 50; protected $synchronous = true; protected $responseMethods = array('close-ok'); protected $fields = array('reply-code', 'reply-text', 'class-id', 'method-id'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class SecureMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'secure'; protected $index = 20; protected $synchronous = true; protected $responseMethods = array('secure-ok'); protected $fields = array('challenge'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class TuneHeartbeatField extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'heartbeat'; } function getSpecFieldDomain() { return 'short'; } }
- class OpenOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'open-ok'; protected $index = 41; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('reserved-1'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+namespace ${namespace};
+ class TuneOkFrameMaxField extends \amqphp\protocol\v0_9_1\LongDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'frame-max'; } function getSpecFieldDomain() { return 'long'; } }
class TuneOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'tune-ok'; protected $index = 31; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('channel-max', 'frame-max', 'heartbeat'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class SecureOkResponseField extends \amqphp\protocol\v0_9_1\LongstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'response'; } function getSpecFieldDomain() { return 'longstr'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
class CloseClassIdField extends \amqphp\protocol\v0_9_1\ClassIdDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'class-id'; } function getSpecFieldDomain() { return 'class-id'; } }
- class OpenMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'open'; protected $index = 40; protected $synchronous = true; protected $responseMethods = array('open-ok'); protected $fields = array('virtual-host', 'reserved-1', 'reserved-2'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class ConnectionClass extends \amqphp\protocol\abstrakt\XmlSpecClass { protected $name = 'connection'; protected $index = 10; protected $fields = array(); protected $methods = array(10 => 'start',11 => 'start-ok',20 => 'secure',21 => 'secure-ok',30 => 'tune',31 => 'tune-ok',40 => 'open',41 => 'open-ok',50 => 'close',51 => 'close-ok'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; }
+ class SecureMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'secure'; protected $index = 20; protected $synchronous = true; protected $responseMethods = array('secure-ok'); protected $fields = array('challenge'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class OpenOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'open-ok'; protected $index = 41; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('reserved-1'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class StartMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'start'; protected $index = 10; protected $synchronous = true; protected $responseMethods = array('start-ok'); protected $fields = array('version-major', 'version-minor', 'server-properties', 'mechanisms', 'locales'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ abstract class FieldFactory extends \amqphp\protocol\abstrakt\FieldFactory { protected static $Cache = array(array('version-major', 'start', '\\amqphp\\protocol\\v0_9_1\\connection\\StartVersionMajorField'),array('version-minor', 'start', '\\amqphp\\protocol\\v0_9_1\\connection\\StartVersionMinorField'),array('server-properties', 'start', '\\amqphp\\protocol\\v0_9_1\\connection\\StartServerPropertiesField'),array('mechanisms', 'start', '\\amqphp\\protocol\\v0_9_1\\connection\\StartMechanismsField'),array('locales', 'start', '\\amqphp\\protocol\\v0_9_1\\connection\\StartLocalesField'),array('client-properties', 'start-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\StartOkClientPropertiesField'),array('mechanism', 'start-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\StartOkMechanismField'),array('response', 'start-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\StartOkResponseField'),array('locale', 'start-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\StartOkLocaleField'),array('challenge', 'secure', '\\amqphp\\protocol\\v0_9_1\\connection\\SecureChallengeField'),array('response', 'secure-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\SecureOkResponseField'),array('channel-max', 'tune', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneChannelMaxField'),array('frame-max', 'tune', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneFrameMaxField'),array('heartbeat', 'tune', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneHeartbeatField'),array('channel-max', 'tune-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneOkChannelMaxField'),array('frame-max', 'tune-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneOkFrameMaxField'),array('heartbeat', 'tune-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneOkHeartbeatField'),array('virtual-host', 'open', '\\amqphp\\protocol\\v0_9_1\\connection\\OpenVirtualHostField'),array('reserved-1', 'open', '\\amqphp\\protocol\\v0_9_1\\connection\\OpenReserved1Field'),array('reserved-2', 'open', '\\amqphp\\protocol\\v0_9_1\\connection\\OpenReserved2Field'),array('reserved-1', 'open-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\OpenOkReserved1Field'),array('reply-code', 'close', '\\amqphp\\protocol\\v0_9_1\\connection\\CloseReplyCodeField'),array('reply-text', 'close', '\\amqphp\\protocol\\v0_9_1\\connection\\CloseReplyTextField'),array('class-id', 'close', '\\amqphp\\protocol\\v0_9_1\\connection\\CloseClassIdField'),array('method-id', 'close', '\\amqphp\\protocol\\v0_9_1\\connection\\CloseMethodIdField')); }
+ class TuneFrameMaxField extends \amqphp\protocol\v0_9_1\LongDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'frame-max'; } function getSpecFieldDomain() { return 'long'; } }
+ class TuneOkHeartbeatField extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'heartbeat'; } function getSpecFieldDomain() { return 'short'; } }
+ class StartLocalesField extends \amqphp\protocol\v0_9_1\LongstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'locales'; } function getSpecFieldDomain() { return 'longstr'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
+ class OpenReserved1Field extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class StartOkClientPropertiesField extends \amqphp\protocol\v0_9_1\PeerPropertiesDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'client-properties'; } function getSpecFieldDomain() { return 'peer-properties'; } }
+ class CloseReplyTextField extends \amqphp\protocol\v0_9_1\ReplyTextDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-text'; } function getSpecFieldDomain() { return 'reply-text'; } }
class StartMechanismsField extends \amqphp\protocol\v0_9_1\LongstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'mechanisms'; } function getSpecFieldDomain() { return 'longstr'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
- class StartOkMechanismField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'mechanism'; } function getSpecFieldDomain() { return 'shortstr'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
- class OpenVirtualHostField extends \amqphp\protocol\v0_9_1\PathDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'virtual-host'; } function getSpecFieldDomain() { return 'path'; } }
+ class TuneHeartbeatField extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'heartbeat'; } function getSpecFieldDomain() { return 'short'; } }
class CloseMethodIdField extends \amqphp\protocol\v0_9_1\MethodIdDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'method-id'; } function getSpecFieldDomain() { return 'method-id'; } }
- class StartOkResponseField extends \amqphp\protocol\v0_9_1\LongstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'response'; } function getSpecFieldDomain() { return 'longstr'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
+ class OpenOkReserved1Field extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class CloseReplyCodeField extends \amqphp\protocol\v0_9_1\ReplyCodeDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-code'; } function getSpecFieldDomain() { return 'reply-code'; } }
class CloseOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'close-ok'; protected $index = 51; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class TuneChannelMaxField extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'channel-max'; } function getSpecFieldDomain() { return 'short'; } }
- class SecureChallengeField extends \amqphp\protocol\v0_9_1\LongstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'challenge'; } function getSpecFieldDomain() { return 'longstr'; } }
+ class StartOkLocaleField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'locale'; } function getSpecFieldDomain() { return 'shortstr'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
class StartVersionMinorField extends \amqphp\protocol\v0_9_1\OctetDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'version-minor'; } function getSpecFieldDomain() { return 'octet'; } }
- class StartVersionMajorField extends \amqphp\protocol\v0_9_1\OctetDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'version-major'; } function getSpecFieldDomain() { return 'octet'; } }
- class TuneOkFrameMaxField extends \amqphp\protocol\v0_9_1\LongDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'frame-max'; } function getSpecFieldDomain() { return 'long'; } }
- class TuneOkChannelMaxField extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'channel-max'; } function getSpecFieldDomain() { return 'short'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject) && true); } }
- class StartOkClientPropertiesField extends \amqphp\protocol\v0_9_1\PeerPropertiesDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'client-properties'; } function getSpecFieldDomain() { return 'peer-properties'; } }
- class CloseReplyCodeField extends \amqphp\protocol\v0_9_1\ReplyCodeDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-code'; } function getSpecFieldDomain() { return 'reply-code'; } }
- class TuneMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'tune'; protected $index = 30; protected $synchronous = true; protected $responseMethods = array('tune-ok'); protected $fields = array('channel-max', 'frame-max', 'heartbeat'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class StartLocalesField extends \amqphp\protocol\v0_9_1\LongstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'locales'; } function getSpecFieldDomain() { return 'longstr'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
- class SecureOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'secure-ok'; protected $index = 21; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('response'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class OpenReserved1Field extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class OpenOkReserved1Field extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class StartServerPropertiesField extends \amqphp\protocol\v0_9_1\PeerPropertiesDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'server-properties'; } function getSpecFieldDomain() { return 'peer-properties'; } }
+ class OpenVirtualHostField extends \amqphp\protocol\v0_9_1\PathDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'virtual-host'; } function getSpecFieldDomain() { return 'path'; } }
+ class SecureChallengeField extends \amqphp\protocol\v0_9_1\LongstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'challenge'; } function getSpecFieldDomain() { return 'longstr'; } }
class OpenReserved2Field extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-2'; } function getSpecFieldDomain() { return 'bit'; } }
- abstract class MethodFactory extends \amqphp\protocol\abstrakt\MethodFactory { protected static $Cache = array(array(10, 'start', '\\amqphp\\protocol\\v0_9_1\\connection\\StartMethod'),array(11, 'start-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\StartOkMethod'),array(20, 'secure', '\\amqphp\\protocol\\v0_9_1\\connection\\SecureMethod'),array(21, 'secure-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\SecureOkMethod'),array(30, 'tune', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneMethod'),array(31, 'tune-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneOkMethod'),array(40, 'open', '\\amqphp\\protocol\\v0_9_1\\connection\\OpenMethod'),array(41, 'open-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\OpenOkMethod'),array(50, 'close', '\\amqphp\\protocol\\v0_9_1\\connection\\CloseMethod'),array(51, 'close-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\CloseOkMethod')); }
- class CloseReplyTextField extends \amqphp\protocol\v0_9_1\ReplyTextDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reply-text'; } function getSpecFieldDomain() { return 'reply-text'; } }
- class StartOkLocaleField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'locale'; } function getSpecFieldDomain() { return 'shortstr'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
+ class StartServerPropertiesField extends \amqphp\protocol\v0_9_1\PeerPropertiesDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'server-properties'; } function getSpecFieldDomain() { return 'peer-properties'; } }
+ class TuneChannelMaxField extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'channel-max'; } function getSpecFieldDomain() { return 'short'; } }
class StartOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'start-ok'; protected $index = 11; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('client-properties', 'mechanism', 'response', 'locale'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- abstract class FieldFactory extends \amqphp\protocol\abstrakt\FieldFactory { protected static $Cache = array(array('version-major', 'start', '\\amqphp\\protocol\\v0_9_1\\connection\\StartVersionMajorField'),array('version-minor', 'start', '\\amqphp\\protocol\\v0_9_1\\connection\\StartVersionMinorField'),array('server-properties', 'start', '\\amqphp\\protocol\\v0_9_1\\connection\\StartServerPropertiesField'),array('mechanisms', 'start', '\\amqphp\\protocol\\v0_9_1\\connection\\StartMechanismsField'),array('locales', 'start', '\\amqphp\\protocol\\v0_9_1\\connection\\StartLocalesField'),array('client-properties', 'start-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\StartOkClientPropertiesField'),array('mechanism', 'start-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\StartOkMechanismField'),array('response', 'start-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\StartOkResponseField'),array('locale', 'start-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\StartOkLocaleField'),array('challenge', 'secure', '\\amqphp\\protocol\\v0_9_1\\connection\\SecureChallengeField'),array('response', 'secure-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\SecureOkResponseField'),array('channel-max', 'tune', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneChannelMaxField'),array('frame-max', 'tune', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneFrameMaxField'),array('heartbeat', 'tune', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneHeartbeatField'),array('channel-max', 'tune-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneOkChannelMaxField'),array('frame-max', 'tune-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneOkFrameMaxField'),array('heartbeat', 'tune-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneOkHeartbeatField'),array('virtual-host', 'open', '\\amqphp\\protocol\\v0_9_1\\connection\\OpenVirtualHostField'),array('reserved-1', 'open', '\\amqphp\\protocol\\v0_9_1\\connection\\OpenReserved1Field'),array('reserved-2', 'open', '\\amqphp\\protocol\\v0_9_1\\connection\\OpenReserved2Field'),array('reserved-1', 'open-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\OpenOkReserved1Field'),array('reply-code', 'close', '\\amqphp\\protocol\\v0_9_1\\connection\\CloseReplyCodeField'),array('reply-text', 'close', '\\amqphp\\protocol\\v0_9_1\\connection\\CloseReplyTextField'),array('class-id', 'close', '\\amqphp\\protocol\\v0_9_1\\connection\\CloseClassIdField'),array('method-id', 'close', '\\amqphp\\protocol\\v0_9_1\\connection\\CloseMethodIdField')); }
- class StartMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'start'; protected $index = 10; protected $synchronous = true; protected $responseMethods = array('start-ok'); protected $fields = array('version-major', 'version-minor', 'server-properties', 'mechanisms', 'locales'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class StartOkMechanismField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'mechanism'; } function getSpecFieldDomain() { return 'shortstr'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
+ class CloseMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'close'; protected $index = 50; protected $synchronous = true; protected $responseMethods = array('close-ok'); protected $fields = array('reply-code', 'reply-text', 'class-id', 'method-id'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class SecureOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'secure-ok'; protected $index = 21; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('response'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class ConnectionClass extends \amqphp\protocol\abstrakt\XmlSpecClass { protected $name = 'connection'; protected $index = 10; protected $fields = array(); protected $methods = array(10 => 'start',11 => 'start-ok',20 => 'secure',21 => 'secure-ok',30 => 'tune',31 => 'tune-ok',40 => 'open',41 => 'open-ok',50 => 'close',51 => 'close-ok'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; }
+ abstract class MethodFactory extends \amqphp\protocol\abstrakt\MethodFactory { protected static $Cache = array(array(10, 'start', '\\amqphp\\protocol\\v0_9_1\\connection\\StartMethod'),array(11, 'start-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\StartOkMethod'),array(20, 'secure', '\\amqphp\\protocol\\v0_9_1\\connection\\SecureMethod'),array(21, 'secure-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\SecureOkMethod'),array(30, 'tune', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneMethod'),array(31, 'tune-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\TuneOkMethod'),array(40, 'open', '\\amqphp\\protocol\\v0_9_1\\connection\\OpenMethod'),array(41, 'open-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\OpenOkMethod'),array(50, 'close', '\\amqphp\\protocol\\v0_9_1\\connection\\CloseMethod'),array(51, 'close-ok', '\\amqphp\\protocol\\v0_9_1\\connection\\CloseOkMethod')); }
+ class TuneMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'tune'; protected $index = 30; protected $synchronous = true; protected $responseMethods = array('tune-ok'); protected $fields = array('channel-max', 'frame-max', 'heartbeat'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class OpenMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'connection'; protected $name = 'open'; protected $index = 40; protected $synchronous = true; protected $responseMethods = array('open-ok'); protected $fields = array('virtual-host', 'reserved-1', 'reserved-2'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\connection\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\connection\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class TuneOkChannelMaxField extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'channel-max'; } function getSpecFieldDomain() { return 'short'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject) && true); } }
+ class StartVersionMajorField extends \amqphp\protocol\v0_9_1\OctetDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'version-major'; } function getSpecFieldDomain() { return 'octet'; } }
+ class SecureOkResponseField extends \amqphp\protocol\v0_9_1\LongstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'response'; } function getSpecFieldDomain() { return 'longstr'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
+ class StartOkResponseField extends \amqphp\protocol\v0_9_1\LongstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'response'; } function getSpecFieldDomain() { return 'longstr'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
View
54 build/nspf/amqphp.protocol.v0_9_1.exchange.php
@@ -1,38 +1,38 @@
<?php
-namespace amqphp\protocol\v0_9_1\exchange;
- class UnbindNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
- class UnbindReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
- class ExchangeClass extends \amqphp\protocol\abstrakt\XmlSpecClass { protected $name = 'exchange'; protected $index = 40; protected $fields = array(); protected $methods = array(10 => 'declare',11 => 'declare-ok',20 => 'delete',21 => 'delete-ok',30 => 'bind',31 => 'bind-ok',40 => 'unbind',51 => 'unbind-ok'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; }
- class BindMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'bind'; protected $index = 30; protected $synchronous = true; protected $responseMethods = array('bind-ok'); protected $fields = array('reserved-1', 'destination', 'source', 'routing-key', 'no-wait', 'arguments'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
- class DeleteExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
- class BindOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'bind-ok'; protected $index = 31; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class BindArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
- class DeclarePassiveField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'passive'; } function getSpecFieldDomain() { return 'bit'; } }
- class DeclareReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
- class UnbindOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'unbind-ok'; protected $index = 51; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class DeclareArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
+namespace ${namespace};
class DeclareOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'declare-ok'; protected $index = 11; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class DeleteMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'delete'; protected $index = 20; protected $synchronous = true; protected $responseMethods = array('delete-ok'); protected $fields = array('reserved-1', 'exchange', 'if-unused', 'no-wait'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
- class DeleteReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
+ class BindArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
+ class DeclareTypeField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'type'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class DeleteNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
+ class UnbindMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'unbind'; protected $index = 40; protected $synchronous = true; protected $responseMethods = array('unbind-ok'); protected $fields = array('reserved-1', 'destination', 'source', 'routing-key', 'no-wait', 'arguments'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
+ abstract class FieldFactory extends \amqphp\protocol\abstrakt\FieldFactory { protected static $Cache = array(array('reserved-1', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareReserved1Field'),array('exchange', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareExchangeField'),array('type', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareTypeField'),array('passive', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclarePassiveField'),array('durable', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareDurableField'),array('auto-delete', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareAutoDeleteField'),array('internal', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareInternalField'),array('no-wait', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareNoWaitField'),array('arguments', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareArgumentsField'),array('reserved-1', 'delete', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeleteReserved1Field'),array('exchange', 'delete', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeleteExchangeField'),array('if-unused', 'delete', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeleteIfUnusedField'),array('no-wait', 'delete', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeleteNoWaitField'),array('reserved-1', 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindReserved1Field'),array('destination', 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindDestinationField'),array('source', 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindSourceField'),array('routing-key', 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindRoutingKeyField'),array('no-wait', 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindNoWaitField'),array('arguments', 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindArgumentsField'),array('reserved-1', 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindReserved1Field'),array('destination', 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindDestinationField'),array('source', 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindSourceField'),array('routing-key', 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindRoutingKeyField'),array('no-wait', 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindNoWaitField'),array('arguments', 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindArgumentsField')); }
class DeclareDurableField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'durable'; } function getSpecFieldDomain() { return 'bit'; } }
class DeleteIfUnusedField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'if-unused'; } function getSpecFieldDomain() { return 'bit'; } }
- class DeclareInternalField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'internal'; } function getSpecFieldDomain() { return 'bit'; } }
- class DeclareTypeField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'type'; } function getSpecFieldDomain() { return 'shortstr'; } }
class DeclareMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'declare'; protected $index = 10; protected $synchronous = true; protected $responseMethods = array('declare-ok'); protected $fields = array('reserved-1', 'exchange', 'type', 'passive', 'durable', 'auto-delete', 'internal', 'no-wait', 'arguments'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
- class BindNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
- class UnbindArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
- class UnbindMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'unbind'; protected $index = 40; protected $synchronous = true; protected $responseMethods = array('unbind-ok'); protected $fields = array('reserved-1', 'destination', 'source', 'routing-key', 'no-wait', 'arguments'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
- class UnbindRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class DeclareReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
class DeclareNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
- class DeleteNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
- class UnbindSourceField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'source'; } function getSpecFieldDomain() { return 'exchange-name'; } }
- class DeclareAutoDeleteField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'auto-delete'; } function getSpecFieldDomain() { return 'bit'; } }
+ class UnbindArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
class BindRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class DeleteOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'delete-ok'; protected $index = 21; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class BindOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'bind-ok'; protected $index = 31; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
class BindSourceField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'source'; } function getSpecFieldDomain() { return 'exchange-name'; } }
+ class UnbindDestinationField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'destination'; } function getSpecFieldDomain() { return 'exchange-name'; } }
+ class UnbindNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
+ class UnbindOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'unbind-ok'; protected $index = 51; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class DeclareArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
+ class DeleteExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
class BindReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
+ class DeleteOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'delete-ok'; protected $index = 21; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class UnbindSourceField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'source'; } function getSpecFieldDomain() { return 'exchange-name'; } }
+ class ExchangeClass extends \amqphp\protocol\abstrakt\XmlSpecClass { protected $name = 'exchange'; protected $index = 40; protected $fields = array(); protected $methods = array(10 => 'declare',11 => 'declare-ok',20 => 'delete',21 => 'delete-ok',30 => 'bind',31 => 'bind-ok',40 => 'unbind',51 => 'unbind-ok'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; }
+ class BindNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
+ class DeclarePassiveField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'passive'; } function getSpecFieldDomain() { return 'bit'; } }
+ class DeclareExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
+ class DeleteReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
abstract class MethodFactory extends \amqphp\protocol\abstrakt\MethodFactory { protected static $Cache = array(array(10, 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareMethod'),array(11, 'declare-ok', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareOkMethod'),array(20, 'delete', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeleteMethod'),array(21, 'delete-ok', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeleteOkMethod'),array(30, 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindMethod'),array(31, 'bind-ok', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindOkMethod'),array(40, 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindMethod'),array(51, 'unbind-ok', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindOkMethod')); }
+ class UnbindRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class DeleteMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'delete'; protected $index = 20; protected $synchronous = true; protected $responseMethods = array('delete-ok'); protected $fields = array('reserved-1', 'exchange', 'if-unused', 'no-wait'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
+ class DeclareInternalField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'internal'; } function getSpecFieldDomain() { return 'bit'; } }
+ class DeclareAutoDeleteField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'auto-delete'; } function getSpecFieldDomain() { return 'bit'; } }
+ class UnbindReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
class BindDestinationField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'destination'; } function getSpecFieldDomain() { return 'exchange-name'; } }
- class DeclareExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
- abstract class FieldFactory extends \amqphp\protocol\abstrakt\FieldFactory { protected static $Cache = array(array('reserved-1', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareReserved1Field'),array('exchange', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareExchangeField'),array('type', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareTypeField'),array('passive', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclarePassiveField'),array('durable', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareDurableField'),array('auto-delete', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareAutoDeleteField'),array('internal', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareInternalField'),array('no-wait', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareNoWaitField'),array('arguments', 'declare', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeclareArgumentsField'),array('reserved-1', 'delete', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeleteReserved1Field'),array('exchange', 'delete', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeleteExchangeField'),array('if-unused', 'delete', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeleteIfUnusedField'),array('no-wait', 'delete', '\\amqphp\\protocol\\v0_9_1\\exchange\\DeleteNoWaitField'),array('reserved-1', 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindReserved1Field'),array('destination', 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindDestinationField'),array('source', 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindSourceField'),array('routing-key', 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindRoutingKeyField'),array('no-wait', 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindNoWaitField'),array('arguments', 'bind', '\\amqphp\\protocol\\v0_9_1\\exchange\\BindArgumentsField'),array('reserved-1', 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindReserved1Field'),array('destination', 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindDestinationField'),array('source', 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindSourceField'),array('routing-key', 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindRoutingKeyField'),array('no-wait', 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindNoWaitField'),array('arguments', 'unbind', '\\amqphp\\protocol\\v0_9_1\\exchange\\UnbindArgumentsField')); }
- class UnbindDestinationField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'destination'; } function getSpecFieldDomain() { return 'exchange-name'; } }
+ class BindMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'exchange'; protected $name = 'bind'; protected $index = 30; protected $synchronous = true; protected $responseMethods = array('bind-ok'); protected $fields = array('reserved-1', 'destination', 'source', 'routing-key', 'no-wait', 'arguments'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\exchange\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
View
42 build/nspf/amqphp.protocol.v0_9_1.php
@@ -1,29 +1,29 @@
<?php
-namespace amqphp\protocol\v0_9_1;
- class PeerPropertiesDomain extends TableDomain { protected $name = 'peer-properties'; protected $protocolType = 'table'; }
- class LongstrDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'longstr'; protected $protocolType = 'longstr'; }
- class DomainFactory extends \amqphp\protocol\abstrakt\DomainFactory { protected static $Cache = array('class-id' => '\\amqphp\\protocol\\v0_9_1\\ClassIdDomain', 'consumer-tag' => '\\amqphp\\protocol\\v0_9_1\\ConsumerTagDomain', 'delivery-tag' => '\\amqphp\\protocol\\v0_9_1\\DeliveryTagDomain', 'exchange-name' => '\\amqphp\\protocol\\v0_9_1\\ExchangeNameDomain', 'method-id' => '\\amqphp\\protocol\\v0_9_1\\MethodIdDomain', 'no-ack' => '\\amqphp\\protocol\\v0_9_1\\NoAckDomain', 'no-local' => '\\amqphp\\protocol\\v0_9_1\\NoLocalDomain', 'no-wait' => '\\amqphp\\protocol\\v0_9_1\\NoWaitDomain', 'path' => '\\amqphp\\protocol\\v0_9_1\\PathDomain', 'peer-properties' => '\\amqphp\\protocol\\v0_9_1\\PeerPropertiesDomain', 'queue-name' => '\\amqphp\\protocol\\v0_9_1\\QueueNameDomain', 'redelivered' => '\\amqphp\\protocol\\v0_9_1\\RedeliveredDomain', 'message-count' => '\\amqphp\\protocol\\v0_9_1\\MessageCountDomain', 'reply-code' => '\\amqphp\\protocol\\v0_9_1\\ReplyCodeDomain', 'reply-text' => '\\amqphp\\protocol\\v0_9_1\\ReplyTextDomain', 'bit' => '\\amqphp\\protocol\\v0_9_1\\BitDomain', 'octet' => '\\amqphp\\protocol\\v0_9_1\\OctetDomain', 'short' => '\\amqphp\\protocol\\v0_9_1\\ShortDomain', 'long' => '\\amqphp\\protocol\\v0_9_1\\LongDomain', 'longlong' => '\\amqphp\\protocol\\v0_9_1\\LonglongDomain', 'shortstr' => '\\amqphp\\protocol\\v0_9_1\\ShortstrDomain', 'longstr' => '\\amqphp\\protocol\\v0_9_1\\LongstrDomain', 'timestamp' => '\\amqphp\\protocol\\v0_9_1\\TimestampDomain', 'table' => '\\amqphp\\protocol\\v0_9_1\\TableDomain'); }
- class DeliveryTagDomain extends LonglongDomain { protected $name = 'delivery-tag'; protected $protocolType = 'longlong'; }
- class ProtoConsts { const FRAME_METHOD = "\x01"; const FRAME_HEADER = "\x02"; const FRAME_BODY = "\x03"; const FRAME_HEARTBEAT = "\x08"; const FRAME_MIN_SIZE = "\x10\x00"; const FRAME_END = "\xCE"; const REPLY_SUCCESS = "\xC8"; const CONTENT_TOO_LARGE = "\x01\x37"; const NO_CONSUMERS = "\x01\x39"; const CONNECTION_FORCED = "\x01\x40"; const INVALID_PATH = "\x01\x92"; const ACCESS_REFUSED = "\x01\x93"; const NOT_FOUND = "\x01\x94"; const RESOURCE_LOCKED = "\x01\x95"; const PRECONDITION_FAILED = "\x01\x96"; const FRAME_ERROR = "\x01\xF5"; const SYNTAX_ERROR = "\x01\xF6"; const COMMAND_INVALID = "\x01\xF7"; const CHANNEL_ERROR = "\x01\xF8"; const UNEXPECTED_FRAME = "\x01\xF9"; const RESOURCE_ERROR = "\x01\xFA"; const NOT_ALLOWED = "\x02\x12"; const NOT_IMPLEMENTED = "\x02\x1C"; const INTERNAL_ERROR = "\x02\x1D"; static $kz = array(1 => array('value' => '1', 'name' => 'FRAME_METHOD', 'class' => ''), 2 => array('value' => '2', 'name' => 'FRAME_HEADER', 'class' => ''), 3 => array('value' => '3', 'name' => 'FRAME_BODY', 'class' => ''), 8 => array('value' => '8', 'name' => 'FRAME_HEARTBEAT', 'class' => ''), 4096 => array('value' => '4096', 'name' => 'FRAME_MIN_SIZE', 'class' => ''), 206 => array('value' => '206', 'name' => 'FRAME_END', 'class' => ''), 200 => array('value' => '200', 'name' => 'REPLY_SUCCESS', 'class' => ''), 311 => array('value' => '311', 'name' => 'CONTENT_TOO_LARGE', 'class' => 'soft-error'), 313 => array('value' => '313', 'name' => 'NO_CONSUMERS', 'class' => 'soft-error'), 320 => array('value' => '320', 'name' => 'CONNECTION_FORCED', 'class' => 'hard-error'), 402 => array('value' => '402', 'name' => 'INVALID_PATH', 'class' => 'hard-error'), 403 => array('value' => '403', 'name' => 'ACCESS_REFUSED', 'class' => 'soft-error'), 404 => array('value' => '404', 'name' => 'NOT_FOUND', 'class' => 'soft-error'), 405 => array('value' => '405', 'name' => 'RESOURCE_LOCKED', 'class' => 'soft-error'), 406 => array('value' => '406', 'name' => 'PRECONDITION_FAILED', 'class' => 'soft-error'), 501 => array('value' => '501', 'name' => 'FRAME_ERROR', 'class' => 'hard-error'), 502 => array('value' => '502', 'name' => 'SYNTAX_ERROR', 'class' => 'hard-error'), 503 => array('value' => '503', 'name' => 'COMMAND_INVALID', 'class' => 'hard-error'), 504 => array('value' => '504', 'name' => 'CHANNEL_ERROR', 'class' => 'hard-error'), 505 => array('value' => '505', 'name' => 'UNEXPECTED_FRAME', 'class' => 'hard-error'), 506 => array('value' => '506', 'name' => 'RESOURCE_ERROR', 'class' => 'hard-error'), 530 => array('value' => '530', 'name' => 'NOT_ALLOWED', 'class' => 'hard-error'), 540 => array('value' => '540', 'name' => 'NOT_IMPLEMENTED', 'class' => 'hard-error'), 541 => array('value' => '541', 'name' => 'INTERNAL_ERROR', 'class' => 'hard-error')); static function Konstant($c) { return isset(self::$kz[$c]) ? self::$kz[$c] : null; } static function GetConstant ($c) { return constant('self::' . $c); } }
- class TableDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'table'; protected $protocolType = 'table'; }
- class ClassFactory extends \amqphp\protocol\abstrakt\ClassFactory { protected static $Cache = array(array(10, 'connection', '\\amqphp\\protocol\\v0_9_1\\connection\\ConnectionClass'),array(20, 'channel', '\\amqphp\\protocol\\v0_9_1\\channel\\ChannelClass'),array(40, 'exchange', '\\amqphp\\protocol\\v0_9_1\\exchange\\ExchangeClass'),array(50, 'queue', '\\amqphp\\protocol\\v0_9_1\\queue\\QueueClass'),array(60, 'basic', '\\amqphp\\protocol\\v0_9_1\\basic\\BasicClass'),array(90, 'tx', '\\amqphp\\protocol\\v0_9_1\\tx\\TxClass'),array(85, 'confirm', '\\amqphp\\protocol\\v0_9_1\\confirm\\ConfirmClass')); }
- class RedeliveredDomain extends BitDomain { protected $name = 'redelivered'; protected $protocolType = 'bit'; }
- class LongDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'long'; protected $protocolType = 'long'; }
- class NoWaitDomain extends BitDomain { protected $name = 'no-wait'; protected $protocolType = 'bit'; }
- class ConsumerTagDomain extends ShortstrDomain { protected $name = 'consumer-tag'; protected $protocolType = 'shortstr'; }
- class LonglongDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'longlong'; protected $protocolType = 'longlong'; }
- class MessageCountDomain extends LongDomain { protected $name = 'message-count'; protected $protocolType = 'long'; }
+namespace ${namespace};
+ class TimestampDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'timestamp'; protected $protocolType = 'timestamp'; }
class MethodIdDomain extends ShortDomain { protected $name = 'method-id'; protected $protocolType = 'short'; }
- class ReplyCodeDomain extends ShortDomain { protected $name = 'reply-code'; protected $protocolType = 'short'; function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
class ShortstrDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'shortstr'; protected $protocolType = 'shortstr'; }
class QueueNameDomain extends ShortstrDomain { protected $name = 'queue-name'; protected $protocolType = 'shortstr'; function validate($subject) { return (parent::validate($subject) && strlen($subject) < 127 && preg_match("/^[a-zA-Z0-9-_.:]*$/", $subject)); } }
- class NoLocalDomain extends BitDomain { protected $name = 'no-local'; protected $protocolType = 'bit'; }
+ class ShortDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'short'; protected $protocolType = 'short'; }
+ class ClassFactory extends \amqphp\protocol\abstrakt\ClassFactory { protected static $Cache = array(array(10, 'connection', '\\amqphp\\protocol\\v0_9_1\\connection\\ConnectionClass'),array(20, 'channel', '\\amqphp\\protocol\\v0_9_1\\channel\\ChannelClass'),array(40, 'exchange', '\\amqphp\\protocol\\v0_9_1\\exchange\\ExchangeClass'),array(50, 'queue', '\\amqphp\\protocol\\v0_9_1\\queue\\QueueClass'),array(60, 'basic', '\\amqphp\\protocol\\v0_9_1\\basic\\BasicClass'),array(90, 'tx', '\\amqphp\\protocol\\v0_9_1\\tx\\TxClass'),array(85, 'confirm', '\\amqphp\\protocol\\v0_9_1\\confirm\\ConfirmClass')); }
class BitDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'bit'; protected $protocolType = 'bit'; }
+ class PeerPropertiesDomain extends TableDomain { protected $name = 'peer-properties'; protected $protocolType = 'table'; }
+ class LongstrDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'longstr'; protected $protocolType = 'longstr'; }
class NoAckDomain extends BitDomain { protected $name = 'no-ack'; protected $protocolType = 'bit'; }
- class TimestampDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'timestamp'; protected $protocolType = 'timestamp'; }
- class ReplyTextDomain extends ShortstrDomain { protected $name = 'reply-text'; protected $protocolType = 'shortstr'; function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
- class ShortDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'short'; protected $protocolType = 'short'; }
class OctetDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'octet'; protected $protocolType = 'octet'; }
+ class RedeliveredDomain extends BitDomain { protected $name = 'redelivered'; protected $protocolType = 'bit'; }
+ class LongDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'long'; protected $protocolType = 'long'; }
+ class TableDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'table'; protected $protocolType = 'table'; }
+ class DeliveryTagDomain extends LonglongDomain { protected $name = 'delivery-tag'; protected $protocolType = 'longlong'; }
+ class ReplyTextDomain extends ShortstrDomain { protected $name = 'reply-text'; protected $protocolType = 'shortstr'; function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
+ class ReplyCodeDomain extends ShortDomain { protected $name = 'reply-code'; protected $protocolType = 'short'; function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
+ class LonglongDomain extends \amqphp\protocol\abstrakt\XmlSpecDomain { protected $name = 'longlong'; protected $protocolType = 'longlong'; }
+ class ProtoConsts { const FRAME_METHOD = "\x01"; const FRAME_HEADER = "\x02"; const FRAME_BODY = "\x03"; const FRAME_HEARTBEAT = "\x08"; const FRAME_MIN_SIZE = "\x10\x00"; const FRAME_END = "\xCE"; const REPLY_SUCCESS = "\xC8"; const CONTENT_TOO_LARGE = "\x01\x37"; const NO_CONSUMERS = "\x01\x39"; const CONNECTION_FORCED = "\x01\x40"; const INVALID_PATH = "\x01\x92"; const ACCESS_REFUSED = "\x01\x93"; const NOT_FOUND = "\x01\x94"; const RESOURCE_LOCKED = "\x01\x95"; const PRECONDITION_FAILED = "\x01\x96"; const FRAME_ERROR = "\x01\xF5"; const SYNTAX_ERROR = "\x01\xF6"; const COMMAND_INVALID = "\x01\xF7"; const CHANNEL_ERROR = "\x01\xF8"; const UNEXPECTED_FRAME = "\x01\xF9"; const RESOURCE_ERROR = "\x01\xFA"; const NOT_ALLOWED = "\x02\x12"; const NOT_IMPLEMENTED = "\x02\x1C"; const INTERNAL_ERROR = "\x02\x1D"; static $kz = array(1 => array('value' => '1', 'name' => 'FRAME_METHOD', 'class' => ''), 2 => array('value' => '2', 'name' => 'FRAME_HEADER', 'class' => ''), 3 => array('value' => '3', 'name' => 'FRAME_BODY', 'class' => ''), 8 => array('value' => '8', 'name' => 'FRAME_HEARTBEAT', 'class' => ''), 4096 => array('value' => '4096', 'name' => 'FRAME_MIN_SIZE', 'class' => ''), 206 => array('value' => '206', 'name' => 'FRAME_END', 'class' => ''), 200 => array('value' => '200', 'name' => 'REPLY_SUCCESS', 'class' => ''), 311 => array('value' => '311', 'name' => 'CONTENT_TOO_LARGE', 'class' => 'soft-error'), 313 => array('value' => '313', 'name' => 'NO_CONSUMERS', 'class' => 'soft-error'), 320 => array('value' => '320', 'name' => 'CONNECTION_FORCED', 'class' => 'hard-error'), 402 => array('value' => '402', 'name' => 'INVALID_PATH', 'class' => 'hard-error'), 403 => array('value' => '403', 'name' => 'ACCESS_REFUSED', 'class' => 'soft-error'), 404 => array('value' => '404', 'name' => 'NOT_FOUND', 'class' => 'soft-error'), 405 => array('value' => '405', 'name' => 'RESOURCE_LOCKED', 'class' => 'soft-error'), 406 => array('value' => '406', 'name' => 'PRECONDITION_FAILED', 'class' => 'soft-error'), 501 => array('value' => '501', 'name' => 'FRAME_ERROR', 'class' => 'hard-error'), 502 => array('value' => '502', 'name' => 'SYNTAX_ERROR', 'class' => 'hard-error'), 503 => array('value' => '503', 'name' => 'COMMAND_INVALID', 'class' => 'hard-error'), 504 => array('value' => '504', 'name' => 'CHANNEL_ERROR', 'class' => 'hard-error'), 505 => array('value' => '505', 'name' => 'UNEXPECTED_FRAME', 'class' => 'hard-error'), 506 => array('value' => '506', 'name' => 'RESOURCE_ERROR', 'class' => 'hard-error'), 530 => array('value' => '530', 'name' => 'NOT_ALLOWED', 'class' => 'hard-error'), 540 => array('value' => '540', 'name' => 'NOT_IMPLEMENTED', 'class' => 'hard-error'), 541 => array('value' => '541', 'name' => 'INTERNAL_ERROR', 'class' => 'hard-error')); static function Konstant($c) { return isset(self::$kz[$c]) ? self::$kz[$c] : null; } static function GetConstant ($c) { return constant('self::' . $c); } }
+ class ExchangeNameDomain extends ShortstrDomain { protected $name = 'exchange-name'; protected $protocolType = 'shortstr'; function validate($subject) { return (parent::validate($subject) && strlen($subject) < 127 && preg_match("/^[a-zA-Z0-9-_.:]*$/", $subject)); } }
+ class ConsumerTagDomain extends ShortstrDomain { protected $name = 'consumer-tag'; protected $protocolType = 'shortstr'; }
+ class NoLocalDomain extends BitDomain { protected $name = 'no-local'; protected $protocolType = 'bit'; }
+ class NoWaitDomain extends BitDomain { protected $name = 'no-wait'; protected $protocolType = 'bit'; }
+ class DomainFactory extends \amqphp\protocol\abstrakt\DomainFactory { protected static $Cache = array('class-id' => '\\amqphp\\protocol\\v0_9_1\\ClassIdDomain', 'consumer-tag' => '\\amqphp\\protocol\\v0_9_1\\ConsumerTagDomain', 'delivery-tag' => '\\amqphp\\protocol\\v0_9_1\\DeliveryTagDomain', 'exchange-name' => '\\amqphp\\protocol\\v0_9_1\\ExchangeNameDomain', 'method-id' => '\\amqphp\\protocol\\v0_9_1\\MethodIdDomain', 'no-ack' => '\\amqphp\\protocol\\v0_9_1\\NoAckDomain', 'no-local' => '\\amqphp\\protocol\\v0_9_1\\NoLocalDomain', 'no-wait' => '\\amqphp\\protocol\\v0_9_1\\NoWaitDomain', 'path' => '\\amqphp\\protocol\\v0_9_1\\PathDomain', 'peer-properties' => '\\amqphp\\protocol\\v0_9_1\\PeerPropertiesDomain', 'queue-name' => '\\amqphp\\protocol\\v0_9_1\\QueueNameDomain', 'redelivered' => '\\amqphp\\protocol\\v0_9_1\\RedeliveredDomain', 'message-count' => '\\amqphp\\protocol\\v0_9_1\\MessageCountDomain', 'reply-code' => '\\amqphp\\protocol\\v0_9_1\\ReplyCodeDomain', 'reply-text' => '\\amqphp\\protocol\\v0_9_1\\ReplyTextDomain', 'bit' => '\\amqphp\\protocol\\v0_9_1\\BitDomain', 'octet' => '\\amqphp\\protocol\\v0_9_1\\OctetDomain', 'short' => '\\amqphp\\protocol\\v0_9_1\\ShortDomain', 'long' => '\\amqphp\\protocol\\v0_9_1\\LongDomain', 'longlong' => '\\amqphp\\protocol\\v0_9_1\\LonglongDomain', 'shortstr' => '\\amqphp\\protocol\\v0_9_1\\ShortstrDomain', 'longstr' => '\\amqphp\\protocol\\v0_9_1\\LongstrDomain', 'timestamp' => '\\amqphp\\protocol\\v0_9_1\\TimestampDomain', 'table' => '\\amqphp\\protocol\\v0_9_1\\TableDomain'); }
class ClassIdDomain extends ShortDomain { protected $name = 'class-id'; protected $protocolType = 'short'; }
- class PathDomain extends ShortstrDomain { protected $name = 'path'; protected $protocolType = 'shortstr'; function validate($subject) { return (parent::validate($subject) && ! is_null($subject) && strlen($subject) < 127); } }
- class ExchangeNameDomain extends ShortstrDomain { protected $name = 'exchange-name'; protected $protocolType = 'shortstr'; function validate($subject) { return (parent::validate($subject) && strlen($subject) < 127 && preg_match("/^[a-zA-Z0-9-_.:]*$/", $subject)); } }
+ class MessageCountDomain extends LongDomain { protected $name = 'message-count'; protected $protocolType = 'long'; }
+ class PathDomain extends ShortstrDomain { protected $name = 'path'; protected $protocolType = 'shortstr'; function validate($subject) { return (parent::validate($subject) && ! is_null($subject) && strlen($subject) < 127); } }
View
70 build/nspf/amqphp.protocol.v0_9_1.queue.php
@@ -1,47 +1,47 @@
<?php
-namespace amqphp\protocol\v0_9_1\queue;
- class UnbindReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
- class BindMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'bind'; protected $index = 20; protected $synchronous = true; protected $responseMethods = array('bind-ok'); protected $fields = array('reserved-1', 'queue', 'exchange', 'routing-key', 'no-wait', 'arguments'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
- class BindOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'bind-ok'; protected $index = 21; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class PurgeOkMessageCountField extends \amqphp\protocol\v0_9_1\MessageCountDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'message-count'; } function getSpecFieldDomain() { return 'message-count'; } }
- class BindArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
- class DeclarePassiveField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'passive'; } function getSpecFieldDomain() { return 'bit'; } }
- class DeclareReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
- class DeclareQueueField extends \amqphp\protocol\v0_9_1\QueueNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'queue'; } function getSpecFieldDomain() { return 'queue-name'; } }
- class PurgeOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'purge-ok'; protected $index = 31; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('message-count'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class UnbindQueueField extends \amqphp\protocol\v0_9_1\QueueNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'queue'; } function getSpecFieldDomain() { return 'queue-name'; } }
- class UnbindOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'unbind-ok'; protected $index = 51; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class DeclareArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
+namespace ${namespace};
class DeclareOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'declare-ok'; protected $index = 11; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('queue', 'message-count', 'consumer-count'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class BindQueueField extends \amqphp\protocol\v0_9_1\QueueNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'queue'; } function getSpecFieldDomain() { return 'queue-name'; } }
- class DeleteOkMessageCountField extends \amqphp\protocol\v0_9_1\MessageCountDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'message-count'; } function getSpecFieldDomain() { return 'message-count'; } }
+ class BindArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
+ class UnbindExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } }
+ class DeleteNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
+ class UnbindMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'unbind'; protected $index = 50; protected $synchronous = true; protected $responseMethods = array('unbind-ok'); protected $fields = array('reserved-1', 'queue', 'exchange', 'routing-key', 'arguments'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
class QueueClass extends \amqphp\protocol\abstrakt\XmlSpecClass { protected $name = 'queue'; protected $index = 50; protected $fields = array(); protected $methods = array(10 => 'declare',11 => 'declare-ok',20 => 'bind',21 => 'bind-ok',50 => 'unbind',51 => 'unbind-ok',30 => 'purge',31 => 'purge-ok',40 => 'delete',41 => 'delete-ok'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; }
- class PurgeMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'purge'; protected $index = 30; protected $synchronous = true; protected $responseMethods = array('purge-ok'); protected $fields = array('reserved-1', 'queue', 'no-wait'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
- class DeleteMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'delete'; protected $index = 40; protected $synchronous = true; protected $responseMethods = array('delete-ok'); protected $fields = array('reserved-1', 'queue', 'if-unused', 'if-empty', 'no-wait'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
- class DeleteReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
- class PurgeReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
+ abstract class FieldFactory extends \amqphp\protocol\abstrakt\FieldFactory { protected static $Cache = array(array('reserved-1', 'declare', '\\amqphp\\protocol\\v0_9_1\\queue\\DeclareReserved1Field'),array('queue', 'declare', '\\amqphp\\protocol\\v0_9_1\\queue\\DeclareQueueField'),array('passive', 'declare', '\\amqphp\\protocol\\v0_9_1\\queue\\DeclarePassiveField'),array('durable', 'declare', '\\amqphp\\protocol\\v0_9_1\\queue\\DeclareDurableField'),array('exclusive', 'declare', '\\amqphp\\protocol\\v0_9_1\\queue\\DeclareExclusiveField'),array('auto-delete', 'declare', '\\amqphp\\protocol\\v0_9_1\\queue\\DeclareAutoDeleteField'),array('no-wait', 'declare', '\\amqphp\\protocol\\v0_9_1\\queue\\DeclareNoWaitField'),array('arguments', 'declare', '\\amqphp\\protocol\\v0_9_1\\queue\\DeclareArgumentsField'),array('queue', 'declare-ok', '\\amqphp\\protocol\\v0_9_1\\queue\\DeclareOkQueueField'),array('message-count', 'declare-ok', '\\amqphp\\protocol\\v0_9_1\\queue\\DeclareOkMessageCountField'),array('consumer-count', 'declare-ok', '\\amqphp\\protocol\\v0_9_1\\queue\\DeclareOkConsumerCountField'),array('reserved-1', 'bind', '\\amqphp\\protocol\\v0_9_1\\queue\\BindReserved1Field'),array('queue', 'bind', '\\amqphp\\protocol\\v0_9_1\\queue\\BindQueueField'),array('exchange', 'bind', '\\amqphp\\protocol\\v0_9_1\\queue\\BindExchangeField'),array('routing-key', 'bind', '\\amqphp\\protocol\\v0_9_1\\queue\\BindRoutingKeyField'),array('no-wait', 'bind', '\\amqphp\\protocol\\v0_9_1\\queue\\BindNoWaitField'),array('arguments', 'bind', '\\amqphp\\protocol\\v0_9_1\\queue\\BindArgumentsField'),array('reserved-1', 'unbind', '\\amqphp\\protocol\\v0_9_1\\queue\\UnbindReserved1Field'),array('queue', 'unbind', '\\amqphp\\protocol\\v0_9_1\\queue\\UnbindQueueField'),array('exchange', 'unbind', '\\amqphp\\protocol\\v0_9_1\\queue\\UnbindExchangeField'),array('routing-key', 'unbind', '\\amqphp\\protocol\\v0_9_1\\queue\\UnbindRoutingKeyField'),array('arguments', 'unbind', '\\amqphp\\protocol\\v0_9_1\\queue\\UnbindArgumentsField'),array('reserved-1', 'purge', '\\amqphp\\protocol\\v0_9_1\\queue\\PurgeReserved1Field'),array('queue', 'purge', '\\amqphp\\protocol\\v0_9_1\\queue\\PurgeQueueField'),array('no-wait', 'purge', '\\amqphp\\protocol\\v0_9_1\\queue\\PurgeNoWaitField'),array('message-count', 'purge-ok', '\\amqphp\\protocol\\v0_9_1\\queue\\PurgeOkMessageCountField'),array('reserved-1', 'delete', '\\amqphp\\protocol\\v0_9_1\\queue\\DeleteReserved1Field'),array('queue', 'delete', '\\amqphp\\protocol\\v0_9_1\\queue\\DeleteQueueField'),array('if-unused', 'delete', '\\amqphp\\protocol\\v0_9_1\\queue\\DeleteIfUnusedField'),array('if-empty', 'delete', '\\amqphp\\protocol\\v0_9_1\\queue\\DeleteIfEmptyField'),array('no-wait', 'delete', '\\amqphp\\protocol\\v0_9_1\\queue\\DeleteNoWaitField'),array('message-count', 'delete-ok', '\\amqphp\\protocol\\v0_9_1\\queue\\DeleteOkMessageCountField')); }
+ class DeclareQueueField extends \amqphp\protocol\v0_9_1\QueueNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'queue'; } function getSpecFieldDomain() { return 'queue-name'; } }
class DeclareDurableField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'durable'; } function getSpecFieldDomain() { return 'bit'; } }
+ class UnbindQueueField extends \amqphp\protocol\v0_9_1\QueueNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'queue'; } function getSpecFieldDomain() { return 'queue-name'; } }
+ class DeleteQueueField extends \amqphp\protocol\v0_9_1\QueueNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'queue'; } function getSpecFieldDomain() { return 'queue-name'; } }
+ class DeclareOkQueueField extends \amqphp\protocol\v0_9_1\QueueNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'queue'; } function getSpecFieldDomain() { return 'queue-name'; } function validate($subject) { return (parent::validate($subject) && ! is_null($subject)); } }
class DeleteIfUnusedField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'if-unused'; } function getSpecFieldDomain() { return 'bit'; } }
- class DeleteIfEmptyField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'if-empty'; } function getSpecFieldDomain() { return 'bit'; } }
class DeclareMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'declare'; protected $index = 10; protected $synchronous = true; protected $responseMethods = array('declare-ok'); protected $fields = array('reserved-1', 'queue', 'passive', 'durable', 'exclusive', 'auto-delete', 'no-wait', 'arguments'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = true; }
- class BindNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
- class UnbindArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
- class UnbindMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'unbind'; protected $index = 50; protected $synchronous = true; protected $responseMethods = array('unbind-ok'); protected $fields = array('reserved-1', 'queue', 'exchange', 'routing-key', 'arguments'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class UnbindRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
- class DeclareOkConsumerCountField extends \amqphp\protocol\v0_9_1\LongDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'consumer-count'; } function getSpecFieldDomain() { return 'long'; } }
+ class DeclareReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
class DeclareNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
- class DeleteNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }
- class UnbindExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } }
- class DeclareAutoDeleteField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'auto-delete'; } function getSpecFieldDomain() { return 'bit'; } }
+ class UnbindArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
class BindRoutingKeyField extends \amqphp\protocol\v0_9_1\ShortstrDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'routing-key'; } function getSpecFieldDomain() { return 'shortstr'; } }
+ class BindOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'bind-ok'; protected $index = 21; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class DeleteIfEmptyField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'if-empty'; } function getSpecFieldDomain() { return 'bit'; } }
+ class BindQueueField extends \amqphp\protocol\v0_9_1\QueueNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'queue'; } function getSpecFieldDomain() { return 'queue-name'; } }
+ class PurgeReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
+ class UnbindOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'unbind-ok'; protected $index = 51; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array(); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class DeclareArgumentsField extends \amqphp\protocol\v0_9_1\TableDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'arguments'; } function getSpecFieldDomain() { return 'table'; } }
+ class DeclareOkConsumerCountField extends \amqphp\protocol\v0_9_1\LongDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'consumer-count'; } function getSpecFieldDomain() { return 'long'; } }
+ class PurgeOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'purge-ok'; protected $index = 31; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('message-count'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
+ class BindReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
class DeleteOkMethod extends \amqphp\protocol\abstrakt\XmlSpecMethod { protected $class = 'queue'; protected $name = 'delete-ok'; protected $index = 41; protected $synchronous = true; protected $responseMethods = array(); protected $fields = array('message-count'); protected $methFact = '\\amqphp\\protocol\\v0_9_1\\queue\\MethodFactory'; protected $fieldFact = '\\amqphp\\protocol\\v0_9_1\\queue\\FieldFactory'; protected $classFact = '\\amqphp\\protocol\\v0_9_1\\ClassFactory'; protected $content = false; protected $hasNoWait = false; }
- class DeclareOkMessageCountField extends \amqphp\protocol\v0_9_1\MessageCountDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'message-count'; } function getSpecFieldDomain() { return 'message-count'; } }
- class BindExchangeField extends \amqphp\protocol\v0_9_1\ExchangeNameDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exchange'; } function getSpecFieldDomain() { return 'exchange-name'; } }
+ class PurgeOkMessageCountField extends \amqphp\protocol\v0_9_1\MessageCountDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'message-count'; } function getSpecFieldDomain() { return 'message-count'; } }
class DeclareExclusiveField extends \amqphp\protocol\v0_9_1\BitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'exclusive'; } function getSpecFieldDomain() { return 'bit'; } }
- class BindReserved1Field extends \amqphp\protocol\v0_9_1\ShortDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'reserved-1'; } function getSpecFieldDomain() { return 'short'; } }
+ class BindNoWaitField extends \amqphp\protocol\v0_9_1\NoWaitDomain implements \amqphp\protocol\abstrakt\XmlSpecField { function getSpecFieldName() { return 'no-wait'; } function getSpecFieldDomain() { return 'no-wait'; } }