Skip to content

Commit f7c9e9a

Browse files
committed
Update api.php
1 parent bb2c549 commit f7c9e9a

File tree

2 files changed

+86
-179
lines changed

2 files changed

+86
-179
lines changed

api.php

Lines changed: 77 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* zmq-API v@PACKAGE_VERSION@ Docs build by DocThor [2016-01-14]
3+
* zmq-API v@PACKAGE_VERSION@ Docs build by DocThor [2016-02-01]
44
* @package zmq
55
*/
66

@@ -11,8 +11,6 @@ class ZMQ {
1111
const SOCKET_PAIR = 0;
1212
const SOCKET_PUB = 1;
1313
const SOCKET_SUB = 2;
14-
const SOCKET_XSUB = 10;
15-
const SOCKET_XPUB = 9;
1614
const SOCKET_REQ = 3;
1715
const SOCKET_REP = 4;
1816
const SOCKET_XREQ = 5;
@@ -21,6 +19,8 @@ class ZMQ {
2119
const SOCKET_PULL = 7;
2220
const SOCKET_DEALER = 5;
2321
const SOCKET_ROUTER = 6;
22+
const SOCKET_XSUB = 10;
23+
const SOCKET_XPUB = 9;
2424
const SOCKET_STREAM = 11;
2525
const SOCKET_UPSTREAM = 7;
2626
const SOCKET_DOWNSTREAM = 8;
@@ -29,19 +29,48 @@ class ZMQ {
2929
const MODE_SNDMORE = 2;
3030
const MODE_NOBLOCK = 1;
3131
const MODE_DONTWAIT = 1;
32-
const DEVICE_FORWARDER = 2;
33-
const DEVICE_QUEUE = 3;
34-
const DEVICE_STREAMER = 1;
3532
const ERR_INTERNAL = -99;
36-
const ERR_EAGAIN = 11;
37-
const ERR_ENOTSUP = 95;
33+
const ERR_EAGAIN = 35;
34+
const ERR_ENOTSUP = 45;
3835
const ERR_EFSM = 156384763;
3936
const ERR_ETERM = 156384765;
40-
const LIBZMQ_VER = '4.0.5';
41-
const SOCKOPT_HWM = 201;
37+
const LIBZMQ_VER = '4.1.4';
38+
const LIBZMQ_VERSION = '4.1.4';
39+
const LIBZMQ_VERSION_ID = 40104;
40+
const LIBZMQ_VERSION_MAJOR = 4;
41+
const LIBZMQ_VERSION_MINOR = 1;
42+
const LIBZMQ_VERSION_PATCH = 4;
43+
const SOCKOPT_TOS = 57;
44+
const SOCKOPT_ROUTER_HANDOVER = 56;
45+
const SOCKOPT_ROUTER_MANDATORY = 33;
46+
const SOCKOPT_PROBE_ROUTER = 51;
47+
const SOCKOPT_REQ_RELAXED = 53;
48+
const SOCKOPT_REQ_CORRELATE = 52;
49+
const SOCKOPT_CONFLATE = 54;
50+
const SOCKOPT_ZAP_DOMAIN = 55;
51+
const SOCKOPT_MECHANISM = 43;
52+
const SOCKOPT_PLAIN_SERVER = 44;
53+
const SOCKOPT_PLAIN_USERNAME = 45;
54+
const SOCKOPT_PLAIN_PASSWORD = 46;
55+
const SOCKOPT_CURVE_SERVER = 47;
56+
const SOCKOPT_CURVE_PUBLICKEY = 48;
57+
const SOCKOPT_CURVE_SECRETKEY = 49;
58+
const SOCKOPT_CURVE_SERVERKEY = 50;
59+
const SOCKOPT_GSSAPI_SERVER = 62;
60+
const SOCKOPT_GSSAPI_PLAINTEXT = 65;
61+
const SOCKOPT_GSSAPI_PRINCIPAL = 63;
62+
const SOCKOPT_GSSAPI_SERVICE_PRINCIPAL = 64;
63+
const SOCKOPT_IPV6 = 42;
64+
const SOCKOPT_IMMEDIATE = 39;
65+
const SOCKOPT_ROUTER_RAW = 41;
66+
const SOCKOPT_IPV4ONLY = 31;
67+
const SOCKOPT_DELAY_ATTACH_ON_CONNECT = 39;
68+
const SOCKOPT_TYPE = 16;
4269
const SOCKOPT_SNDHWM = 23;
4370
const SOCKOPT_RCVHWM = 24;
4471
const SOCKOPT_AFFINITY = 4;
72+
const SOCKOPT_SUBSCRIBE = 6;
73+
const SOCKOPT_UNSUBSCRIBE = 7;
4574
const SOCKOPT_IDENTITY = 5;
4675
const SOCKOPT_RATE = 8;
4776
const SOCKOPT_RECOVERY_IVL = 9;
@@ -52,219 +81,92 @@ class ZMQ {
5281
const SOCKOPT_RECONNECT_IVL_MAX = 21;
5382
const SOCKOPT_BACKLOG = 19;
5483
const SOCKOPT_MAXMSGSIZE = 22;
55-
const SOCKOPT_SUBSCRIBE = 6;
56-
const SOCKOPT_UNSUBSCRIBE = 7;
57-
const SOCKOPT_TYPE = 16;
58-
const SOCKOPT_RCVMORE = 13;
59-
const SOCKOPT_FD = 14;
60-
const SOCKOPT_EVENTS = 15;
61-
const SOCKOPT_SNDTIMEO = 28;
84+
const SOCKOPT_MULTICAST_HOPS = 25;
6285
const SOCKOPT_RCVTIMEO = 27;
63-
const SOCKOPT_IPV4ONLY = 31;
64-
const SOCKOPT_LAST_ENDPOINT = 32;
86+
const SOCKOPT_SNDTIMEO = 28;
87+
const SOCKOPT_XPUB_VERBOSE = 40;
6588
const SOCKOPT_TCP_KEEPALIVE = 34;
6689
const SOCKOPT_TCP_KEEPALIVE_IDLE = 36;
6790
const SOCKOPT_TCP_KEEPALIVE_CNT = 35;
6891
const SOCKOPT_TCP_KEEPALIVE_INTVL = 37;
6992
const SOCKOPT_TCP_ACCEPT_FILTER = 38;
70-
const SOCKOPT_DELAY_ATTACH_ON_CONNECT = 39;
71-
const SOCKOPT_XPUB_VERBOSE = 40;
72-
const SOCKOPT_ROUTER_MANDATORY = 33;
73-
const SOCKOPT_ROUTER_RAW = 41;
74-
const SOCKOPT_IPV6 = 42;
75-
const SOCKOPT_PLAIN_SERVER = 44;
76-
const SOCKOPT_PLAIN_USERNAME = 45;
77-
const SOCKOPT_PLAIN_PASSWORD = 46;
78-
const SOCKOPT_CURVE_SERVER = 47;
79-
const SOCKOPT_CURVE_PUBLICKEY = 48;
80-
const SOCKOPT_CURVE_SECRETKEY = 49;
81-
const SOCKOPT_CURVE_SERVERKEY = 50;
82-
const SOCKOPT_PROBE_ROUTER = 51;
83-
const SOCKOPT_REQ_CORRELATE = 52;
84-
const SOCKOPT_REQ_RELAXED = 53;
85-
const SOCKOPT_CONFLATE = 54;
86-
const SOCKOPT_ZAP_DOMAIN = 55;
93+
const SOCKOPT_RCVMORE = 13;
94+
const SOCKOPT_FD = 14;
95+
const SOCKOPT_EVENTS = 15;
96+
const SOCKOPT_LAST_ENDPOINT = 32;
97+
const SOCKOPT_HWM = 2001;
8798
const CTXOPT_MAX_SOCKETS = 2;
8899
const CTXOPT_MAX_SOCKETS_DEFAULT = 1023;
89-
/**
90-
* A monotonic clock
91-
*
92-
* @return integer
93-
*/
100+
const EVENT_CONNECTED = 1;
101+
const EVENT_CONNECT_DELAYED = 2;
102+
const EVENT_CONNECT_RETRIED = 4;
103+
const EVENT_LISTENING = 8;
104+
const EVENT_BIND_FAILED = 16;
105+
const EVENT_ACCEPTED = 32;
106+
const EVENT_ACCEPT_FAILED = 64;
107+
const EVENT_CLOSED = 128;
108+
const EVENT_CLOSE_FAILED = 256;
109+
const EVENT_DISCONNECTED = 512;
110+
const EVENT_MONITOR_STOPPED = 1024;
111+
const EVENT_ALL = 65535;
94112
public function clock() {}
113+
public function z85encode($data) {}
114+
public function z85decode($data) {}
115+
public function curvekeypair() {}
95116
}
96117
/**
97118
* @package zmq
98119
*/
99120
class ZMQContext {
100-
/**
101-
* Build a new ZMQContext object
102-
*
103-
* @param integer $io_threads
104-
* @param boolean $is_persistent
105-
* @return ZMQContext
106-
*/
107121
public function __construct($io_threads = 1, $persistent = true) {}
108-
/**
109-
* Acquires a handle to the request global context
110-
*
111-
* @return ZMQContext
112-
*/
113122
public function acquire() {}
114-
public function getsocket($type, $dsn, $on_new_socket = null) {}
123+
public function getsocketcount() {}
124+
public function getsocket($type, $dsn, $on_new_socket="") {}
115125
public function ispersistent() {}
116-
/**
117-
* Set a context option
118-
*
119-
* @param int $option
120-
* @param int $value
121-
* @return ZMQContext
122-
*/
123126
public function setOpt($option, $value) {}
124-
/**
125-
* Set a context option
126-
*
127-
* @param int $option
128-
* @return ZMQContext
129-
*/
130127
public function getOpt($option) {}
131128
}
132129
/**
133130
* @package zmq
134131
*/
135132
class ZMQSocket {
136-
/**
137-
* Build a new ZMQSocket object
138-
*
139-
* @param ZMQContext $context
140-
* @param integer $type
141-
* @param string $persistent_id
142-
* @param callback $on_new_socket
143-
* @return ZMQSocket
144-
*/
145-
public function __construct(ZMQContext $ZMQContext, $type, $persistent_id = null, $on_new_socket = null) {}
146-
/**
147-
* Send a message. Return true if message was sent and false on EAGAIN
148-
*
149-
* @param string $message
150-
* @param integer $flags
151-
* @return ZMQSocket
152-
*/
153-
public function send($message, $flags = 0) {}
154-
public function recv($flags = 0) {}
155-
/**
156-
* Send a multipart message. Return true if message was sent and false on EAGAIN
157-
*
158-
* @param arrays $messages
159-
* @param integer $flags
160-
* @return ZMQSocket
161-
*/
162-
public function sendmulti($message, $flags = 0) {}
163-
public function recvmulti($flags = 0) {}
164-
/**
165-
* Bind the socket to an endpoint
166-
*
167-
* @param string $dsn
168-
* @param boolean $force
169-
* @return ZMQSocket
170-
*/
171-
public function bind($dsn, $force = false) {}
172-
/**
173-
* Connect the socket to an endpoint
174-
*
175-
* @param string $dsn
176-
* @param boolean $force
177-
* @return ZMQSocket
178-
*/
179-
public function connect($dsn, $force = false) {}
180-
/**
181-
* Unbind the socket from an endpoint
182-
*
183-
* @param string $dsn
184-
* @return ZMQSocket
185-
*/
133+
public function __construct(ZMQContext $ZMQContext, $type, $persistent_id=null, $on_new_socket=null) {}
134+
public function send($message, $mode=0) {}
135+
public function recv($mode="") {}
136+
public function sendmulti($message, $mode=0) {}
137+
public function recvmulti($mode=0) {}
138+
public function bind($dsn, $force=false) {}
139+
public function connect($dsn, $force=false) {}
140+
public function monitor($dsn, $events=ZMQ::EVENT_ALL) {}
141+
public function recvevent($flags=0) {}
186142
public function unbind($dsn) {}
187-
/**
188-
* Disconnect the socket from an endpoint
189-
*
190-
* @param string $dsn
191-
* @return ZMQSocket
192-
*/
193143
public function disconnect($dsn) {}
194144
public function setsockopt($key, $value) {}
195145
public function getendpoints() {}
196146
public function getsockettype() {}
197147
public function ispersistent() {}
198148
public function getpersistentid() {}
199149
public function getsockopt($key) {}
200-
public function sendmsg($message, $flags = 0) {}
201-
public function recvmsg($flags = 0) {}
150+
public function sendmsg($message, $mode=0) {}
151+
public function recvmsg($mode=0) {}
202152
}
203153
/**
204154
* @package zmq
205155
*/
206156
class ZMQPoll {
207-
/**
208-
* Add a ZMQSocket object into the pollset
209-
*
210-
* @param ZMQSocket $object
211-
* @param integer $events
212-
* @return integer
213-
*/
214157
public function add($entry, $type) {}
215-
/**
216-
* Poll the sockets
217-
*
218-
* @param array $readable
219-
* @param array $writable
220-
* @param integer $timeout
221-
* @return integer
222-
*/
223-
public function poll(&$readable, &$writable, $timeout = 0) {}
158+
public function poll(&$readable, &$writable, $timeout="") {}
224159
public function getlasterrors() {}
225-
/**
226-
* Remove item from poll set
227-
*
228-
* @param mixed $item
229-
* @return boolean
230-
*/
231160
public function remove($remove) {}
232-
/**
233-
* Returns the number of items in the set
234-
*
235-
* @return integer
236-
*/
237161
public function count() {}
238-
/**
239-
* Clear the pollset
240-
*
241-
* @return ZMQPoll
242-
*/
243162
public function clear() {}
244-
/**
245-
* Returns items in the pollset
246-
*
247-
* @return array
248-
*/
249163
public function items() {}
250164
}
251165
/**
252166
* @package zmq
253167
*/
254168
class ZMQDevice {
255-
/**
256-
* Construct a device
257-
*
258-
* @param ZMQSocket $frontend
259-
* @param ZMQSocket $backend
260-
* @return void
261-
*/
262-
public function __construct(ZMQSocket $frontend, ZMQSocket $backend, ZMQSocket $capture="") {}
263-
/**
264-
* Start a device
265-
*
266-
* @return void
267-
*/
169+
public function __construct(ZMQSocket $frontend, ZMQSocket $backend, ZMQSocket $capture=null) {}
268170
public function run() {}
269171
public function setidlecallback($idle_callback, $timeout, $user_data="") {}
270172
public function setidletimeout($timeout) {}

package.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<email>[email protected]</email>
1111
<active>yes</active>
1212
</lead>
13-
<date>2016-01-21</date>
13+
<date>2016-02-01</date>
1414
<time>17:00:00</time>
1515
<version>
16-
<release>1.1.4</release>
16+
<release>1.1.5</release>
1717
<api>1.1.0</api>
1818
</version>
1919
<stability>
@@ -22,8 +22,13 @@
2222
</stability>
2323
<license>BSD License</license>
2424
<notes>
25-
- Introduces PHP7 support
26-
- Added methods: ZMQSocket::monitor, ZMQSocket::recvEvent, ZMQ::has
25+
- Introduces PHP7 support. PHP5 compilation should work but receives no updates.
26+
- Added new methods:
27+
* ZMQSocket::monitor (and related ZMQSocket::recvEvent)
28+
* ZMQ::z85Encode/Decode
29+
* ZMQ::has
30+
- Socket options are now restricted to their valid socket types
31+
- Usage pthreads extension is now better supported and tested
2732
</notes>
2833
<contents>
2934
<dir name="/">

0 commit comments

Comments
 (0)