Commits

Ruslan Osmanov committed 61ea0f2

Change: Event:: property removed; generic Event:: property added

Comments (0)

Files changed (4)

 }
 /* }}} */
 
-/* {{{ proto resource EventBuffer::search(string what[, EventBufferPosition start = NULL[, EventBufferPosition end = NULL]]);
+/* {{{ proto EventBufferPosition EventBuffer::search(string what[, EventBufferPosition start = NULL[, EventBufferPosition end = NULL]]);
  *
  * Scans the buffer for an occurrence of the len-character string what. It
- * returns resource representing the position of the string, or NULL if the
+ * returns object representing the position of the string, or NULL if the
  * string was not found. If the start argument is provided, it's the position
  * at which the search should begin; otherwise, the search is from the start
  * of the string. If end argument provided, the search is performed between
  * start and end buffer positions.
  *
- * Returns resource representing position of the first occurance of the string
+ * Returns EventBufferPosition representing position of the first occurance of the string
  * in the buffer, or NULL if string is not found
  */
 PHP_METHOD(EventBuffer, search)
   <!--{{{ Current version -->
   <version>
     <release>1.2.7</release>
-    <api>1.3.0</api>
+    <api>1.3.1</api>
   </version>
   <stability>
     <release>beta</release>
   <license uri="http://www.php.net/license">PHP</license>
   <notes><![CDATA[
   Fix: possible memory access violations in EventBufferEvent input/output property handlers
+  Change: Event::$timer_pending property removed; generic Event::$pending property added
   ]]></notes>
   <!--}}}-->
   <!--{{{ Contents -->
     <release>
       <version>
         <release>1.2.7</release>
-        <api>1.3.0</api>
+        <api>1.3.1</api>
       </version>
       <stability>
         <release>beta</release>
       <license uri="http://www.php.net/license">PHP</license>
       <notes><![CDATA[
   Fix: possible memory access violations in EventBufferEvent input/output property handlers
+  Change: Event::$timer_pending property removed; generic Event::$pending property added
   ]]></notes>
     </release>
     <!--}}}-->
 /* }}} */
 
 
-/* {{{ event_timer_pending_prop_read */
-static int event_timer_pending_prop_read(php_event_abstract_object_t *obj, zval **retval TSRMLS_DC)
+/* {{{ event_pending_prop_read */
+static int event_pending_prop_read(php_event_abstract_object_t *obj, zval **retval TSRMLS_DC)
 {
 	php_event_t *e = (php_event_t *) obj;
 
 	PHP_EVENT_ASSERT(e->event);
 
 	MAKE_STD_ZVAL(*retval);
-	ZVAL_BOOL(*retval, (evtimer_pending(e->event, NULL) ? 1 : 0));
+	ZVAL_BOOL(*retval, (php_event_is_pending(e->event) ? 1 : 0));
 
 	return SUCCESS;
 }
 
 
 const php_event_property_entry_t event_property_entries[] = {
-	{"timer_pending",           sizeof("timer_pending") - 1, event_timer_pending_prop_read, NULL, NULL},
+	{"pending",           sizeof("pending") - 1, event_pending_prop_read, NULL, NULL},
     {NULL, 0, NULL, NULL, NULL}
 };
 const php_event_property_entry_t event_bevent_property_entries[] = {
 #endif
 
 const zend_property_info event_property_entry_info[] = {
-	{ZEND_ACC_PUBLIC, "timer_pending", sizeof("timer_pending") - 1, -1, 0, NULL, 0, NULL},
+	{ZEND_ACC_PUBLIC, "pending", sizeof("pending") - 1, -1, 0, NULL, 0, NULL},
 	{0, NULL, 0, -1, 0, NULL, 0, NULL}
 };
 const zend_property_info event_bevent_property_entry_info[] = {

tests/03-event-del.phpt

 $e2 = Event::timer($base, function () { echo "ok 3\n"; });
 $e2->add(0.2);
 
-$e1->timer_pending and print("ok 1\n");
-$e2->timer_pending and print("ok 2\n");
+$e1->pending and print("ok 1\n");
+$e2->pending and print("ok 2\n");
 
 $e1->del();
-$e1->timer_pending and print("not ok 4\n");
+$e1->pending and print("not ok 4\n");
 
 $base->loop(EventBase::LOOP_ONCE);