├── ext ├── missing ├── install-sh ├── mkinstalldirs ├── Makefile.fragments ├── .libs │ ├── interop.la │ ├── interop.o │ ├── interop.so │ └── interop.lai ├── build │ ├── shtool │ ├── scan_makefile_in.awk │ ├── mkdep.awk │ └── ax_check_compile_flag.m4 ├── kernel │ ├── array.h.gch │ ├── debug.h.gch │ ├── exit.h.gch │ ├── fcall.h.gch │ ├── file.h.gch │ ├── main.h.gch │ ├── math.h.gch │ ├── time.h.gch │ ├── .libs │ │ ├── array.o │ │ ├── concat.o │ │ ├── debug.o │ │ ├── exit.o │ │ ├── fcall.o │ │ ├── file.o │ │ ├── filter.o │ │ ├── main.o │ │ ├── math.o │ │ ├── memory.o │ │ ├── object.o │ │ ├── string.o │ │ ├── time.o │ │ ├── iterator.o │ │ ├── require.o │ │ ├── backtrace.o │ │ ├── exception.o │ │ ├── operators.o │ │ └── variables.o │ ├── concat.h.gch │ ├── filter.h.gch │ ├── globals.h.gch │ ├── iterator.h.gch │ ├── memory.h.gch │ ├── object.h.gch │ ├── require.h.gch │ ├── string.h.gch │ ├── backtrace.h.gch │ ├── exception.h.gch │ ├── operators.h.gch │ ├── variables.h.gch │ ├── fcall_internal.h.gch │ ├── fcall_internal.h │ ├── array.lo │ ├── debug.lo │ ├── exit.lo │ ├── fcall.lo │ ├── file.lo │ ├── main.lo │ ├── math.lo │ ├── time.lo │ ├── concat.lo │ ├── filter.lo │ ├── memory.lo │ ├── object.lo │ ├── string.lo │ ├── iterator.lo │ ├── require.lo │ ├── backtrace.lo │ ├── exception.lo │ ├── operators.lo │ ├── variables.lo │ ├── require.h │ ├── exit.h │ ├── time.h │ ├── README.md │ ├── exit.c │ ├── backtrace.h │ ├── variables.h │ ├── concat.h │ ├── filter.h │ ├── math.h │ ├── iterator.h │ ├── time.c │ ├── iterator.c │ ├── file.h │ ├── debug.c │ ├── backtrace.c │ ├── variables.c │ ├── require.c │ ├── debug.h │ ├── exception.h │ ├── array.h │ ├── globals.h │ ├── string.h │ └── exception.c ├── modules │ └── interop.so ├── clean ├── ext_config.h ├── ext.h ├── interop │ └── queue │ │ ├── .libs │ │ ├── queue.o │ │ ├── topic.o │ │ ├── consumer.o │ │ ├── context.o │ │ ├── exception.o │ │ ├── message.o │ │ ├── processor.o │ │ ├── producer.o │ │ ├── destination.o │ │ ├── connectionfactory.o │ │ └── subscriptionconsumer.o │ │ ├── exception │ │ ├── .libs │ │ │ ├── exception.o │ │ │ ├── invalidmessageexception.o │ │ │ ├── invaliddestinationexception.o │ │ │ ├── prioritynotsupportedexception.o │ │ │ ├── purgequeuenotsupportedexception.o │ │ │ ├── timetolivenotsupportedexception.o │ │ │ ├── deliverydelaynotsupportedexception.o │ │ │ ├── temporaryqueuenotsupportedexception.o │ │ │ └── subscriptionconsumernotsupportedexception.o │ │ ├── exception.zep.h │ │ ├── exception.lo │ │ ├── invalidmessageexception.lo │ │ ├── invaliddestinationexception.lo │ │ ├── prioritynotsupportedexception.lo │ │ ├── purgequeuenotsupportedexception.lo │ │ ├── timetolivenotsupportedexception.lo │ │ ├── deliverydelaynotsupportedexception.lo │ │ ├── temporaryqueuenotsupportedexception.lo │ │ ├── subscriptionconsumernotsupportedexception.lo │ │ ├── exception.zep.c │ │ ├── invalidmessageexception.zep.h │ │ ├── invaliddestinationexception.zep.h │ │ ├── prioritynotsupportedexception.zep.h │ │ ├── purgequeuenotsupportedexception.zep.h │ │ ├── timetolivenotsupportedexception.zep.h │ │ ├── deliverydelaynotsupportedexception.zep.h │ │ ├── temporaryqueuenotsupportedexception.zep.h │ │ ├── subscriptionconsumernotsupportedexception.zep.h │ │ ├── prioritynotsupportedexception.zep.c │ │ ├── purgequeuenotsupportedexception.zep.c │ │ ├── timetolivenotsupportedexception.zep.c │ │ ├── deliverydelaynotsupportedexception.zep.c │ │ ├── temporaryqueuenotsupportedexception.zep.c │ │ ├── subscriptionconsumernotsupportedexception.zep.c │ │ ├── invalidmessageexception.zep.c │ │ └── invaliddestinationexception.zep.c │ │ ├── exception.zep.h │ │ ├── destination.zep.h │ │ ├── queue.lo │ │ ├── topic.lo │ │ ├── context.lo │ │ ├── message.lo │ │ ├── consumer.lo │ │ ├── producer.lo │ │ ├── exception.lo │ │ ├── processor.lo │ │ ├── destination.lo │ │ ├── connectionfactory.lo │ │ ├── subscriptionconsumer.lo │ │ ├── processor.zep.h │ │ ├── exception.zep.c │ │ ├── queue.zep.h │ │ ├── topic.zep.h │ │ ├── connectionfactory.zep.c │ │ ├── queue.zep.c │ │ ├── connectionfactory.zep.h │ │ ├── topic.zep.c │ │ ├── destination.zep.c │ │ ├── subscriptionconsumer.zep.h │ │ ├── context.zep.c │ │ ├── subscriptionconsumer.zep.c │ │ ├── consumer.zep.c │ │ ├── processor.zep.c │ │ ├── consumer.zep.h │ │ ├── producer.zep.h │ │ ├── producer.zep.c │ │ ├── context.zep.h │ │ └── message.zep.c ├── php_ext.h ├── config.nice ├── interop.lo ├── install ├── interop.la ├── interop.h ├── config.w32 ├── php_interop.h ├── config.h.in ├── config.h ├── config.m4 └── autom4te.cache │ └── requests ├── .gitignore ├── interop └── queue │ ├── exception.zep │ ├── exception │ ├── exception.zep │ ├── prioritynotsupportedexception.zep │ ├── purgequeuenotsupportedexception.zep │ ├── timetolivenotsupportedexception.zep │ ├── deliverydelaynotsupportedexception.zep │ ├── temporaryqueuenotsupportedexception.zep │ ├── invalidmessageexception.zep │ ├── subscriptionconsumernotsupportedexception.zep │ └── invaliddestinationexception.zep │ ├── connectionfactory.zep │ ├── queue.zep │ ├── topic.zep │ ├── destination.zep │ ├── subscriptionconsumer.zep │ ├── processor.zep │ ├── context.zep │ ├── consumer.zep │ ├── producer.zep │ └── message.zep ├── boxfile.yml ├── LICENSE ├── README.md └── config.json /ext/missing: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ext/install-sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ext/mkinstalldirs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ext/Makefile.fragments: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ext/.libs/interop.la: -------------------------------------------------------------------------------- 1 | ../interop.la -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .zephir 2 | vendor/ 3 | compile.log 4 | compile-errors.log -------------------------------------------------------------------------------- /ext/build/shtool: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/build/shtool -------------------------------------------------------------------------------- /ext/.libs/interop.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/.libs/interop.o -------------------------------------------------------------------------------- /ext/.libs/interop.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/.libs/interop.so -------------------------------------------------------------------------------- /ext/kernel/array.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/array.h.gch -------------------------------------------------------------------------------- /ext/kernel/debug.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/debug.h.gch -------------------------------------------------------------------------------- /ext/kernel/exit.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/exit.h.gch -------------------------------------------------------------------------------- /ext/kernel/fcall.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/fcall.h.gch -------------------------------------------------------------------------------- /ext/kernel/file.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/file.h.gch -------------------------------------------------------------------------------- /ext/kernel/main.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/main.h.gch -------------------------------------------------------------------------------- /ext/kernel/math.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/math.h.gch -------------------------------------------------------------------------------- /ext/kernel/time.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/time.h.gch -------------------------------------------------------------------------------- /ext/modules/interop.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/modules/interop.so -------------------------------------------------------------------------------- /ext/kernel/.libs/array.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/array.o -------------------------------------------------------------------------------- /ext/kernel/.libs/concat.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/concat.o -------------------------------------------------------------------------------- /ext/kernel/.libs/debug.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/debug.o -------------------------------------------------------------------------------- /ext/kernel/.libs/exit.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/exit.o -------------------------------------------------------------------------------- /ext/kernel/.libs/fcall.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/fcall.o -------------------------------------------------------------------------------- /ext/kernel/.libs/file.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/file.o -------------------------------------------------------------------------------- /ext/kernel/.libs/filter.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/filter.o -------------------------------------------------------------------------------- /ext/kernel/.libs/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/main.o -------------------------------------------------------------------------------- /ext/kernel/.libs/math.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/math.o -------------------------------------------------------------------------------- /ext/kernel/.libs/memory.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/memory.o -------------------------------------------------------------------------------- /ext/kernel/.libs/object.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/object.o -------------------------------------------------------------------------------- /ext/kernel/.libs/string.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/string.o -------------------------------------------------------------------------------- /ext/kernel/.libs/time.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/time.o -------------------------------------------------------------------------------- /ext/kernel/concat.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/concat.h.gch -------------------------------------------------------------------------------- /ext/kernel/filter.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/filter.h.gch -------------------------------------------------------------------------------- /ext/kernel/globals.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/globals.h.gch -------------------------------------------------------------------------------- /ext/kernel/iterator.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/iterator.h.gch -------------------------------------------------------------------------------- /ext/kernel/memory.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/memory.h.gch -------------------------------------------------------------------------------- /ext/kernel/object.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/object.h.gch -------------------------------------------------------------------------------- /ext/kernel/require.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/require.h.gch -------------------------------------------------------------------------------- /ext/kernel/string.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/string.h.gch -------------------------------------------------------------------------------- /ext/kernel/.libs/iterator.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/iterator.o -------------------------------------------------------------------------------- /ext/kernel/.libs/require.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/require.o -------------------------------------------------------------------------------- /ext/kernel/backtrace.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/backtrace.h.gch -------------------------------------------------------------------------------- /ext/kernel/exception.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/exception.h.gch -------------------------------------------------------------------------------- /ext/kernel/operators.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/operators.h.gch -------------------------------------------------------------------------------- /ext/kernel/variables.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/variables.h.gch -------------------------------------------------------------------------------- /ext/clean: -------------------------------------------------------------------------------- 1 | find . -name \*.lo -o -name \*.o -o -name \*.gch | xargs rm -f 2 | make clean 3 | phpize --clean 4 | -------------------------------------------------------------------------------- /ext/ext_config.h: -------------------------------------------------------------------------------- 1 | /* This file was generated automatically by Zephir do not modify it! */ 2 | #include "config.h" -------------------------------------------------------------------------------- /ext/kernel/.libs/backtrace.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/backtrace.o -------------------------------------------------------------------------------- /ext/kernel/.libs/exception.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/exception.o -------------------------------------------------------------------------------- /ext/kernel/.libs/operators.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/operators.o -------------------------------------------------------------------------------- /ext/kernel/.libs/variables.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/.libs/variables.o -------------------------------------------------------------------------------- /ext/ext.h: -------------------------------------------------------------------------------- 1 | 2 | /* This file was generated automatically by Zephir do not modify it! */ 3 | 4 | #include "interop.h" -------------------------------------------------------------------------------- /ext/interop/queue/.libs/queue.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/.libs/queue.o -------------------------------------------------------------------------------- /ext/interop/queue/.libs/topic.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/.libs/topic.o -------------------------------------------------------------------------------- /ext/kernel/fcall_internal.h.gch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/kernel/fcall_internal.h.gch -------------------------------------------------------------------------------- /ext/interop/queue/.libs/consumer.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/.libs/consumer.o -------------------------------------------------------------------------------- /ext/interop/queue/.libs/context.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/.libs/context.o -------------------------------------------------------------------------------- /ext/interop/queue/.libs/exception.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/.libs/exception.o -------------------------------------------------------------------------------- /ext/interop/queue/.libs/message.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/.libs/message.o -------------------------------------------------------------------------------- /ext/interop/queue/.libs/processor.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/.libs/processor.o -------------------------------------------------------------------------------- /ext/interop/queue/.libs/producer.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/.libs/producer.o -------------------------------------------------------------------------------- /ext/php_ext.h: -------------------------------------------------------------------------------- 1 | 2 | /* This file was generated automatically by Zephir do not modify it! */ 3 | 4 | #include "php_interop.h" -------------------------------------------------------------------------------- /interop/queue/exception.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue; 3 | 4 | interface Exception extends \Throwable 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /ext/interop/queue/.libs/destination.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/.libs/destination.o -------------------------------------------------------------------------------- /ext/kernel/fcall_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef ZEPHIR_KERNEL_FCALL_INTERNAL_H 2 | #define ZEPHIR_KERNEL_FCALL_INTERNAL_H 3 | #endif 4 | -------------------------------------------------------------------------------- /ext/interop/queue/.libs/connectionfactory.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/.libs/connectionfactory.o -------------------------------------------------------------------------------- /ext/interop/queue/exception/.libs/exception.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/exception/.libs/exception.o -------------------------------------------------------------------------------- /ext/interop/queue/.libs/subscriptionconsumer.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/.libs/subscriptionconsumer.o -------------------------------------------------------------------------------- /ext/interop/queue/exception.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_exception_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception); 5 | 6 | -------------------------------------------------------------------------------- /ext/interop/queue/destination.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_destination_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Destination); 5 | 6 | -------------------------------------------------------------------------------- /interop/queue/exception/exception.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue\Exception; 3 | 4 | class Exception extends \Exception implements \Interop\Queue\Exception 5 | { 6 | } -------------------------------------------------------------------------------- /ext/interop/queue/exception/.libs/invalidmessageexception.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/exception/.libs/invalidmessageexception.o -------------------------------------------------------------------------------- /ext/interop/queue/exception/.libs/invaliddestinationexception.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/exception/.libs/invaliddestinationexception.o -------------------------------------------------------------------------------- /ext/interop/queue/exception/.libs/prioritynotsupportedexception.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/exception/.libs/prioritynotsupportedexception.o -------------------------------------------------------------------------------- /ext/interop/queue/exception/exception.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_exception_exception_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_Exception); 5 | 6 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/.libs/purgequeuenotsupportedexception.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/exception/.libs/purgequeuenotsupportedexception.o -------------------------------------------------------------------------------- /ext/interop/queue/exception/.libs/timetolivenotsupportedexception.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/exception/.libs/timetolivenotsupportedexception.o -------------------------------------------------------------------------------- /ext/interop/queue/exception/.libs/deliverydelaynotsupportedexception.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/exception/.libs/deliverydelaynotsupportedexception.o -------------------------------------------------------------------------------- /ext/interop/queue/exception/.libs/temporaryqueuenotsupportedexception.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/exception/.libs/temporaryqueuenotsupportedexception.o -------------------------------------------------------------------------------- /interop/queue/connectionfactory.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue; 3 | 4 | use Interop\Queue\Context; 5 | 6 | interface ConnectionFactory 7 | { 8 | public function createContext() -> ; 9 | } -------------------------------------------------------------------------------- /ext/interop/queue/exception/.libs/subscriptionconsumernotsupportedexception.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/queue-interop/ext/HEAD/ext/interop/queue/exception/.libs/subscriptionconsumernotsupportedexception.o -------------------------------------------------------------------------------- /ext/config.nice: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # Created by configure 4 | 5 | CFLAGS='-O2 -fvisibility=hidden -Wparentheses -flto -DZEPHIR_RELEASE=1' \ 6 | CC='gcc' \ 7 | './configure' \ 8 | '--enable-interop' \ 9 | "$@" 10 | -------------------------------------------------------------------------------- /interop/queue/queue.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue; 3 | 4 | interface Queue extends Destination 5 | { 6 | /** 7 | * Gets the name of this queue. This is a destination one consumes messages from. 8 | */ 9 | public function getQueueName() -> string; 10 | } 11 | -------------------------------------------------------------------------------- /ext/interop.lo: -------------------------------------------------------------------------------- 1 | # interop.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/interop.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/array.lo: -------------------------------------------------------------------------------- 1 | # kernel/array.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/array.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/debug.lo: -------------------------------------------------------------------------------- 1 | # kernel/debug.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/debug.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/exit.lo: -------------------------------------------------------------------------------- 1 | # kernel/exit.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/exit.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/fcall.lo: -------------------------------------------------------------------------------- 1 | # kernel/fcall.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/fcall.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/file.lo: -------------------------------------------------------------------------------- 1 | # kernel/file.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/file.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/main.lo: -------------------------------------------------------------------------------- 1 | # kernel/main.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/main.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/math.lo: -------------------------------------------------------------------------------- 1 | # kernel/math.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/math.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/time.lo: -------------------------------------------------------------------------------- 1 | # kernel/time.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/time.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/concat.lo: -------------------------------------------------------------------------------- 1 | # kernel/concat.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/concat.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/filter.lo: -------------------------------------------------------------------------------- 1 | # kernel/filter.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/filter.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/memory.lo: -------------------------------------------------------------------------------- 1 | # kernel/memory.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/memory.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/object.lo: -------------------------------------------------------------------------------- 1 | # kernel/object.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/object.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/string.lo: -------------------------------------------------------------------------------- 1 | # kernel/string.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/string.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/iterator.lo: -------------------------------------------------------------------------------- 1 | # kernel/iterator.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/iterator.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/require.lo: -------------------------------------------------------------------------------- 1 | # kernel/require.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/require.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/queue.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/queue.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/queue.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/topic.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/topic.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/topic.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/backtrace.lo: -------------------------------------------------------------------------------- 1 | # kernel/backtrace.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/backtrace.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/exception.lo: -------------------------------------------------------------------------------- 1 | # kernel/exception.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/exception.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/operators.lo: -------------------------------------------------------------------------------- 1 | # kernel/operators.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/operators.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/kernel/variables.lo: -------------------------------------------------------------------------------- 1 | # kernel/variables.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/variables.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/context.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/context.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/context.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/message.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/message.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/message.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/consumer.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/consumer.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/consumer.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/producer.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/producer.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/producer.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/exception.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/exception.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/exception.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/processor.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/processor.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/processor.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/destination.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/destination.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/destination.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/connectionfactory.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/connectionfactory.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/connectionfactory.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/exception.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/exception/exception.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/exception.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/subscriptionconsumer.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/subscriptionconsumer.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/subscriptionconsumer.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/invalidmessageexception.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/exception/invalidmessageexception.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/invalidmessageexception.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/invaliddestinationexception.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/exception/invaliddestinationexception.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/invaliddestinationexception.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/prioritynotsupportedexception.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/exception/prioritynotsupportedexception.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/prioritynotsupportedexception.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/purgequeuenotsupportedexception.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/exception/purgequeuenotsupportedexception.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/purgequeuenotsupportedexception.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/timetolivenotsupportedexception.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/exception/timetolivenotsupportedexception.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/timetolivenotsupportedexception.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export CC="gcc" 4 | export CFLAGS="-O2 -Wall -fvisibility=hidden -flto -DZEPHIR_RELEASE=1" 5 | 6 | phpize_bin=$(which phpize 2> /dev/null) 7 | 8 | if [ -z $(which sudo 2> /dev/null) ]; then 9 | alias sudo="" 10 | fi 11 | 12 | if [ -f Makefile ]; then 13 | sudo make -s clean 14 | sudo ${phpize_bin} --silent --clean 15 | fi 16 | 17 | ${phpize_bin} --silent 18 | 19 | ./configure --silent --enable-interop 20 | make -s && sudo make -s install 21 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/deliverydelaynotsupportedexception.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/exception/deliverydelaynotsupportedexception.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/deliverydelaynotsupportedexception.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/temporaryqueuenotsupportedexception.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/exception/temporaryqueuenotsupportedexception.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/temporaryqueuenotsupportedexception.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/subscriptionconsumernotsupportedexception.lo: -------------------------------------------------------------------------------- 1 | # interop/queue/exception/subscriptionconsumernotsupportedexception.lo - a libtool object file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/subscriptionconsumernotsupportedexception.o' 9 | 10 | # Name of the non-PIC object. 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /ext/interop/queue/processor.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_processor_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Processor); 5 | 6 | ZEND_BEGIN_ARG_INFO_EX(arginfo_interop_queue_processor_process, 0, 0, 2) 7 | ZEND_ARG_OBJ_INFO(0, message, Interop\\Queue\\Message, 0) 8 | ZEND_ARG_OBJ_INFO(0, context, Interop\\Queue\\Context, 0) 9 | ZEND_END_ARG_INFO() 10 | 11 | ZEPHIR_INIT_FUNCS(interop_queue_processor_method_entry) { 12 | PHP_ABSTRACT_ME(Interop_Queue_Processor, process, arginfo_interop_queue_processor_process) 13 | PHP_FE_END 14 | }; 15 | -------------------------------------------------------------------------------- /ext/build/scan_makefile_in.awk: -------------------------------------------------------------------------------- 1 | BEGIN { 2 | mode=0 3 | sources="" 4 | } 5 | 6 | mode == 0 && /^LTLIBRARY_SOURCES.*\\$/ { 7 | if (match($0, "[^=]*$")) { 8 | sources=substr($0, RSTART, RLENGTH-1) 9 | } 10 | mode=1 11 | next 12 | } 13 | 14 | mode == 0 && /^LTLIBRARY_SOURCES.*/ { 15 | if (match($0, "[^=]*$")) { 16 | sources=substr($0, RSTART, RLENGTH) 17 | } 18 | } 19 | 20 | mode == 1 && /.*\\$/ { 21 | sources=sources substr($0, 0, length - 1) 22 | next 23 | } 24 | 25 | mode == 1 { 26 | sources=sources $0 27 | mode=0 28 | } 29 | 30 | END { 31 | print sources 32 | } 33 | -------------------------------------------------------------------------------- /ext/interop/queue/exception.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../php_ext.h" 8 | #include "../../ext.h" 9 | 10 | #include 11 | 12 | #include "kernel/main.h" 13 | 14 | 15 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception) { 16 | 17 | ZEPHIR_REGISTER_INTERFACE(Interop\\Queue, Exception, interop, queue_exception, NULL); 18 | 19 | zend_class_implements(interop_queue_exception_ce TSRMLS_CC, 1, zephir_get_internal_ce(SL("throwable"))); 20 | return SUCCESS; 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /ext/interop/queue/queue.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_queue_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Queue); 5 | 6 | #if PHP_VERSION_ID >= 70200 7 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_queue_getqueuename, 0, 0, IS_STRING, 0) 8 | #else 9 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_queue_getqueuename, 0, 0, IS_STRING, NULL, 0) 10 | #endif 11 | ZEND_END_ARG_INFO() 12 | 13 | ZEPHIR_INIT_FUNCS(interop_queue_queue_method_entry) { 14 | PHP_ABSTRACT_ME(Interop_Queue_Queue, getQueueName, arginfo_interop_queue_queue_getqueuename) 15 | PHP_FE_END 16 | }; 17 | -------------------------------------------------------------------------------- /ext/interop/queue/topic.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_topic_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Topic); 5 | 6 | #if PHP_VERSION_ID >= 70200 7 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_topic_gettopicname, 0, 0, IS_STRING, 0) 8 | #else 9 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_topic_gettopicname, 0, 0, IS_STRING, NULL, 0) 10 | #endif 11 | ZEND_END_ARG_INFO() 12 | 13 | ZEPHIR_INIT_FUNCS(interop_queue_topic_method_entry) { 14 | PHP_ABSTRACT_ME(Interop_Queue_Topic, getTopicName, arginfo_interop_queue_topic_gettopicname) 15 | PHP_FE_END 16 | }; 17 | -------------------------------------------------------------------------------- /interop/queue/topic.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue; 3 | 4 | /** 5 | * A Topic object encapsulates a provider-specific topic name. 6 | * It is the way a client specifies the identity of a topic to transport methods. 7 | * For those methods that use a Destination as a parameter, a Topic object may used as an argument. 8 | * 9 | * @see https://docs.oracle.com/javaee/7/api/javax/jms/Topic.html 10 | */ 11 | interface Topic extends Destination 12 | { 13 | /** 14 | * Gets the name of this topic. This is a destination one sends messages to. 15 | */ 16 | public function getTopicName() -> string; 17 | } -------------------------------------------------------------------------------- /ext/interop/queue/connectionfactory.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../php_ext.h" 8 | #include "../../ext.h" 9 | 10 | #include 11 | 12 | #include "kernel/main.h" 13 | 14 | 15 | ZEPHIR_INIT_CLASS(Interop_Queue_ConnectionFactory) { 16 | 17 | ZEPHIR_REGISTER_INTERFACE(Interop\\Queue, ConnectionFactory, interop, queue_connectionfactory, interop_queue_connectionfactory_method_entry); 18 | 19 | return SUCCESS; 20 | 21 | } 22 | 23 | ZEPHIR_DOC_METHOD(Interop_Queue_ConnectionFactory, createContext); 24 | 25 | -------------------------------------------------------------------------------- /interop/queue/exception/prioritynotsupportedexception.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue\Exception; 3 | 4 | use Throwable; 5 | 6 | class PriorityNotSupportedException extends Exception 7 | { 8 | /** 9 | * @param int $code 10 | * @param \Throwable $previous 11 | * 12 | * @return static 13 | */ 14 | public static function providerDoestNotSupportIt(int code = 0, previous = null) -> 15 | { 16 | return new PriorityNotSupportedException( 17 | "The provider does not support priority feature", 18 | code, 19 | previous 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /interop/queue/exception/purgequeuenotsupportedexception.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue\Exception; 3 | 4 | use Throwable; 5 | 6 | class PurgeQueueNotSupportedException extends Exception 7 | { 8 | /** 9 | * @param int $code 10 | * @param \Throwable $previous 11 | * 12 | * @return static 13 | */ 14 | public static function providerDoestNotSupportIt(int code = 0, previous = null) -> 15 | { 16 | return new PurgeQueueNotSupportedException( 17 | "The provider does not support purge queue.", 18 | code, 19 | previous 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /interop/queue/exception/timetolivenotsupportedexception.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue\Exception; 3 | 4 | use Throwable; 5 | 6 | class TimeToLiveNotSupportedException extends Exception 7 | { 8 | /** 9 | * @param int $code 10 | * @param \Throwable $previous 11 | * 12 | * @return static 13 | */ 14 | public static function providerDoestNotSupportIt(int code = 0, previous = null) -> 15 | { 16 | return new TimeToLiveNotSupportedException( 17 | "The provider does not support time to live feature", 18 | code, 19 | previous 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /interop/queue/exception/deliverydelaynotsupportedexception.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue\Exception; 3 | 4 | use Throwable; 5 | 6 | class DeliveryDelayNotSupportedException extends Exception 7 | { 8 | /** 9 | * @param int $code 10 | * @param \Throwable $previous 11 | * 12 | * @return static 13 | */ 14 | public static function providerDoestNotSupportIt(int code = 0, previous = null) -> 15 | { 16 | return new DeliveryDelayNotSupportedException( 17 | "The provider does not support delivery delay feature", 18 | code, 19 | previous 20 | ); 21 | } 22 | } -------------------------------------------------------------------------------- /boxfile.yml: -------------------------------------------------------------------------------- 1 | run.config: 2 | engine: php 3 | engine.config: 4 | runtime: php-7.2 5 | extensions: 6 | - curl 7 | - dom 8 | - fileinfo 9 | - iconv 10 | - mbstring 11 | - zephir_parser 12 | - xml 13 | - xmlwriter 14 | - zip 15 | extra_packages: 16 | - autoconf 17 | - freefonts 18 | - freetype2 19 | - fontconfig 20 | - re2c 21 | extra_steps: 22 | #=========================================================================== 23 | # Get the Zephir phar 24 | - wget --no-clobber -O /data/bin/zephir https://github.com/phalcon/zephir/releases/download/0.11.12/zephir.phar 25 | - chmod +x /data/bin/zephir 26 | 27 | -------------------------------------------------------------------------------- /interop/queue/exception/temporaryqueuenotsupportedexception.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue\Exception; 3 | 4 | use Throwable; 5 | 6 | class TemporaryQueueNotSupportedException extends Exception 7 | { 8 | /** 9 | * @param int $code 10 | * @param \Throwable $previous 11 | * 12 | * @return static 13 | */ 14 | public static function providerDoestNotSupportIt(int code = 0, previous = null) -> 15 | { 16 | return new TemporaryQueueNotSupportedException( 17 | "The provider does not support temporary queue feature", 18 | code, 19 | previous 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /interop/queue/exception/invalidmessageexception.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue\Exception; 3 | 4 | class InvalidMessageException extends Exception 5 | { 6 | /** 7 | * @param Message $message 8 | * @param string $class 9 | * 10 | * @throws static 11 | */ 12 | public static function assertMessageInstanceOf(var message, string className) -> void 13 | { 14 | var name; 15 | 16 | if !(message instanceof className) { 17 | let name = get_class(message); 18 | 19 | throw new InvalidMessageException( 20 | "The message must be an instance of " . className . " but it is " . name . "." 21 | ); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /interop/queue/exception/subscriptionconsumernotsupportedexception.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue\Exception; 3 | 4 | use Throwable; 5 | 6 | class SubscriptionConsumerNotSupportedException extends Exception 7 | { 8 | /** 9 | * @param int $code 10 | * @param \Throwable $previous 11 | * 12 | * @return static 13 | */ 14 | public static function providerDoestNotSupportIt(int $code = 0, previous = null) -> 15 | { 16 | return new SubscriptionConsumerNotSupportedException( 17 | "The provider does not support subscription consumer.", 18 | code, 19 | previous 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /interop/queue/destination.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue; 3 | 4 | /** 5 | * A Destination object encapsulates a provider-specific address. 6 | * The transport API does not define a standard address syntax. 7 | * Although a standard address syntax was considered, 8 | * it was decided that the differences in address semantics between existing message-oriented middleware (MOM) 9 | * products were too wide to bridge with a single syntax. 10 | * 11 | * Since Destination is an administered object, 12 | * it may contain provider-specific configuration information in addition to its address. 13 | * 14 | * @see https://docs.oracle.com/javaee/7/api/javax/jms/Destination.html 15 | */ 16 | interface Destination 17 | { 18 | } -------------------------------------------------------------------------------- /ext/interop/queue/exception/exception.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../../php_ext.h" 8 | #include "../../../ext.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "kernel/main.h" 15 | 16 | 17 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_Exception) { 18 | 19 | ZEPHIR_REGISTER_CLASS_EX(Interop\\Queue\\Exception, Exception, interop, queue_exception_exception, zend_exception_get_default(TSRMLS_C), NULL, 0); 20 | 21 | zend_class_implements(interop_queue_exception_exception_ce TSRMLS_CC, 1, interop_queue_exception_ce); 22 | return SUCCESS; 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /ext/interop/queue/queue.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../php_ext.h" 8 | #include "../../ext.h" 9 | 10 | #include 11 | 12 | #include "kernel/main.h" 13 | 14 | 15 | ZEPHIR_INIT_CLASS(Interop_Queue_Queue) { 16 | 17 | ZEPHIR_REGISTER_INTERFACE(Interop\\Queue, Queue, interop, queue_queue, interop_queue_queue_method_entry); 18 | 19 | zend_class_implements(interop_queue_queue_ce TSRMLS_CC, 1, interop_queue_destination_ce); 20 | return SUCCESS; 21 | 22 | } 23 | 24 | /** 25 | * Gets the name of this queue. This is a destination one consumes messages from. 26 | */ 27 | ZEPHIR_DOC_METHOD(Interop_Queue_Queue, getQueueName); 28 | 29 | -------------------------------------------------------------------------------- /ext/interop/queue/connectionfactory.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_connectionfactory_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_ConnectionFactory); 5 | 6 | #if PHP_VERSION_ID >= 70200 7 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_connectionfactory_createcontext, 0, 0, Interop\\Queue\\Context, 0) 8 | #else 9 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_connectionfactory_createcontext, 0, 0, IS_OBJECT, "Interop\\Queue\\Context", 0) 10 | #endif 11 | ZEND_END_ARG_INFO() 12 | 13 | ZEPHIR_INIT_FUNCS(interop_queue_connectionfactory_method_entry) { 14 | PHP_ABSTRACT_ME(Interop_Queue_ConnectionFactory, createContext, arginfo_interop_queue_connectionfactory_createcontext) 15 | PHP_FE_END 16 | }; 17 | -------------------------------------------------------------------------------- /interop/queue/exception/invaliddestinationexception.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue\Exception; 3 | 4 | class InvalidDestinationException extends Exception 5 | { 6 | /** 7 | * @param mixed $destination 8 | * @param string $class 9 | * 10 | * @throws static 11 | */ 12 | public static function assertDestinationInstanceOf(var destination, string className) -> void 13 | { 14 | var name; 15 | 16 | if typeof destination === "object" { 17 | let name = get_class(destination); 18 | } else { 19 | let name = gettype(destination); 20 | } 21 | 22 | if !(destination instanceof className) { 23 | throw new InvalidDestinationException( 24 | "The destination must be an instance of " . className . " but got " . name . "." 25 | ); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ext/interop.la: -------------------------------------------------------------------------------- 1 | # interop.la - a libtool library file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='interop.so' 9 | 10 | # Names of this library. 11 | library_names='interop.so interop.so interop.so' 12 | 13 | # The name of the static archive. 14 | old_library='' 15 | 16 | # Libraries that this one depends upon. 17 | dependency_libs='' 18 | 19 | # Version information for interop. 20 | current=0 21 | age=0 22 | revision=0 23 | 24 | # Is this an already installed library? 25 | installed=no 26 | 27 | # Should we warn about portability when linking against -modules? 28 | shouldnotlink=yes 29 | 30 | # Files to dlopen/dlpreopen 31 | dlopen='' 32 | dlpreopen='' 33 | 34 | # Directory that this library needs to be installed in: 35 | libdir='/app/ext/modules' 36 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/invalidmessageexception.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_exception_invalidmessageexception_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_InvalidMessageException); 5 | 6 | PHP_METHOD(Interop_Queue_Exception_InvalidMessageException, assertMessageInstanceOf); 7 | 8 | ZEND_BEGIN_ARG_INFO_EX(arginfo_interop_queue_exception_invalidmessageexception_assertmessageinstanceof, 0, 0, 2) 9 | ZEND_ARG_INFO(0, message) 10 | #if PHP_VERSION_ID >= 70200 11 | ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) 12 | #else 13 | ZEND_ARG_INFO(0, className) 14 | #endif 15 | ZEND_END_ARG_INFO() 16 | 17 | ZEPHIR_INIT_FUNCS(interop_queue_exception_invalidmessageexception_method_entry) { 18 | PHP_ME(Interop_Queue_Exception_InvalidMessageException, assertMessageInstanceOf, arginfo_interop_queue_exception_invalidmessageexception_assertmessageinstanceof, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) 19 | PHP_FE_END 20 | }; 21 | -------------------------------------------------------------------------------- /ext/.libs/interop.lai: -------------------------------------------------------------------------------- 1 | # interop.la - a libtool library file 2 | # Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='interop.so' 9 | 10 | # Names of this library. 11 | library_names='interop.so interop.so interop.so' 12 | 13 | # The name of the static archive. 14 | old_library='' 15 | 16 | # Libraries that this one depends upon. 17 | dependency_libs='' 18 | 19 | # Version information for interop. 20 | current=0 21 | age=0 22 | revision=0 23 | 24 | # Is this an already installed library? 25 | installed=yes 26 | 27 | # Should we warn about portability when linking against -modules? 28 | shouldnotlink=yes 29 | 30 | # Files to dlopen/dlpreopen 31 | dlopen='' 32 | dlpreopen='' 33 | 34 | # Directory that this library needs to be installed in: 35 | libdir='/app/ext/modules' 36 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/invaliddestinationexception.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_exception_invaliddestinationexception_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_InvalidDestinationException); 5 | 6 | PHP_METHOD(Interop_Queue_Exception_InvalidDestinationException, assertDestinationInstanceOf); 7 | 8 | ZEND_BEGIN_ARG_INFO_EX(arginfo_interop_queue_exception_invaliddestinationexception_assertdestinationinstanceof, 0, 0, 2) 9 | ZEND_ARG_INFO(0, destination) 10 | #if PHP_VERSION_ID >= 70200 11 | ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) 12 | #else 13 | ZEND_ARG_INFO(0, className) 14 | #endif 15 | ZEND_END_ARG_INFO() 16 | 17 | ZEPHIR_INIT_FUNCS(interop_queue_exception_invaliddestinationexception_method_entry) { 18 | PHP_ME(Interop_Queue_Exception_InvalidDestinationException, assertDestinationInstanceOf, arginfo_interop_queue_exception_invaliddestinationexception_assertdestinationinstanceof, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) 19 | PHP_FE_END 20 | }; 21 | -------------------------------------------------------------------------------- /interop/queue/subscriptionconsumer.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue; 3 | 4 | interface SubscriptionConsumer 5 | { 6 | /** 7 | * The timeout is in milliseconds. 8 | * Set zero to consume endlessly or till a consumer returns false. 9 | */ 10 | public function consume(int timeout = 0) -> void; 11 | 12 | /** 13 | * Notify broker that the client is interested in consuming messages from this queue. 14 | * 15 | * A callback function to which the consumed message will be passed. 16 | * The function must accept at a minimum one parameter, an \Interop\Queue\Message object, 17 | * and an optional second parameter the \Interop\Queue\Consumer from which the message was 18 | * consumed. The consumer will not return the processing thread back to 19 | * the PHP script until the callback function returns FALSE. 20 | */ 21 | public function subscribe( consumer, callable callback) -> void; 22 | 23 | public function unsubscribe( consumer) -> void; 24 | 25 | public function unsubscribeAll() -> void; 26 | } -------------------------------------------------------------------------------- /ext/interop/queue/topic.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../php_ext.h" 8 | #include "../../ext.h" 9 | 10 | #include 11 | 12 | #include "kernel/main.h" 13 | 14 | 15 | /** 16 | * A Topic object encapsulates a provider-specific topic name. 17 | * It is the way a client specifies the identity of a topic to transport methods. 18 | * For those methods that use a Destination as a parameter, a Topic object may used as an argument. 19 | * 20 | * @see https://docs.oracle.com/javaee/7/api/javax/jms/Topic.html 21 | */ 22 | ZEPHIR_INIT_CLASS(Interop_Queue_Topic) { 23 | 24 | ZEPHIR_REGISTER_INTERFACE(Interop\\Queue, Topic, interop, queue_topic, interop_queue_topic_method_entry); 25 | 26 | zend_class_implements(interop_queue_topic_ce TSRMLS_CC, 1, interop_queue_destination_ce); 27 | return SUCCESS; 28 | 29 | } 30 | 31 | /** 32 | * Gets the name of this topic. This is a destination one sends messages to. 33 | */ 34 | ZEPHIR_DOC_METHOD(Interop_Queue_Topic, getTopicName); 35 | 36 | -------------------------------------------------------------------------------- /ext/interop/queue/destination.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../php_ext.h" 8 | #include "../../ext.h" 9 | 10 | #include 11 | 12 | #include "kernel/main.h" 13 | 14 | 15 | /** 16 | * A Destination object encapsulates a provider-specific address. 17 | * The transport API does not define a standard address syntax. 18 | * Although a standard address syntax was considered, 19 | * it was decided that the differences in address semantics between existing message-oriented middleware (MOM) 20 | * products were too wide to bridge with a single syntax. 21 | * 22 | * Since Destination is an administered object, 23 | * it may contain provider-specific configuration information in addition to its address. 24 | * 25 | * @see https://docs.oracle.com/javaee/7/api/javax/jms/Destination.html 26 | */ 27 | ZEPHIR_INIT_CLASS(Interop_Queue_Destination) { 28 | 29 | ZEPHIR_REGISTER_INTERFACE(Interop\\Queue, Destination, interop, queue_destination, NULL); 30 | 31 | return SUCCESS; 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 queue-interop 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /interop/queue/processor.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue; 3 | 4 | interface Processor 5 | { 6 | /** 7 | * Use this constant when the message is processed successfully and the message could be removed from the queue. 8 | */ 9 | const ACK = "enqueue.ack"; 10 | 11 | /** 12 | * Use this constant when the message is not valid or could not be processed 13 | * The message is removed from the queue. 14 | */ 15 | const REJECT = "enqueue.reject"; 16 | 17 | /** 18 | * Use this constant when the message is not valid or could not be processed right now but we can try again later 19 | * The original message is removed from the queue but a copy is published to the queue again. 20 | */ 21 | const REQUEUE = "enqueue.requeue"; 22 | 23 | /** 24 | * The method has to return either self::ACK, self::REJECT, self::REQUEUE string. 25 | * 26 | * The method also can return an object. 27 | * It must implement __toString method and the method must return one of the constants from above. 28 | * 29 | * @param Message $message 30 | * @param Context $context 31 | * 32 | * @return string|object with __toString method implemented 33 | */ 34 | public function process( message, context); 35 | } -------------------------------------------------------------------------------- /ext/kernel/require.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Zephir. 3 | * 4 | * (c) Zephir Team 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. If you did not receive 8 | * a copy of the license it is available through the world-wide-web at the 9 | * following url: https://docs.zephir-lang.com/en/latest/license 10 | */ 11 | 12 | #ifndef ZEPHIR_KERNEL_REQUIRE_H 13 | #define ZEPHIR_KERNEL_REQUIRE_H 14 | 15 | #include "php_ext.h" 16 | 17 | int zephir_require_ret(zval *return_value_ptr, const char *require_path) ZEPHIR_ATTR_NONNULL1(2); 18 | 19 | ZEPHIR_ATTR_NONNULL static inline int zephir_require(const char *require_path) 20 | { 21 | return zephir_require_ret(NULL, require_path); 22 | } 23 | 24 | ZEPHIR_ATTR_NONNULL static inline int zephir_require_zval(const zval *require_path) 25 | { 26 | return zephir_require_ret(NULL, Z_TYPE_P(require_path) == IS_STRING ? Z_STRVAL_P(require_path) : ""); 27 | } 28 | 29 | ZEPHIR_ATTR_NONNULL static inline int zephir_require_zval_ret(zval *return_value_ptr, const zval *require_path) 30 | { 31 | return zephir_require_ret(return_value_ptr, Z_TYPE_P(require_path) == IS_STRING ? Z_STRVAL_P(require_path) : ""); 32 | } 33 | 34 | #endif /* ZEPHIR_KERNEL_REQUIRE_H */ 35 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/prioritynotsupportedexception.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_exception_prioritynotsupportedexception_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_PriorityNotSupportedException); 5 | 6 | PHP_METHOD(Interop_Queue_Exception_PriorityNotSupportedException, providerDoestNotSupportIt); 7 | 8 | #if PHP_VERSION_ID >= 70200 9 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_exception_prioritynotsupportedexception_providerdoestnotsupportit, 0, 0, Interop\\Queue\\Exception\\PriorityNotSupportedException, 0) 10 | #else 11 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_exception_prioritynotsupportedexception_providerdoestnotsupportit, 0, 0, IS_OBJECT, "Interop\\Queue\\Exception\\PriorityNotSupportedException", 0) 12 | #endif 13 | #if PHP_VERSION_ID >= 70200 14 | ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) 15 | #else 16 | ZEND_ARG_INFO(0, code) 17 | #endif 18 | ZEND_ARG_OBJ_INFO(0, previous, Throwable, 1) 19 | ZEND_END_ARG_INFO() 20 | 21 | ZEPHIR_INIT_FUNCS(interop_queue_exception_prioritynotsupportedexception_method_entry) { 22 | PHP_ME(Interop_Queue_Exception_PriorityNotSupportedException, providerDoestNotSupportIt, arginfo_interop_queue_exception_prioritynotsupportedexception_providerdoestnotsupportit, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) 23 | PHP_FE_END 24 | }; 25 | -------------------------------------------------------------------------------- /ext/kernel/exit.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Song Yeung | 16 | +------------------------------------------------------------------------+ 17 | */ 18 | 19 | #ifndef ZEPHIR_KERNEL_EXIT_H 20 | #define ZEPHIR_KERNEL_EXIT_H 21 | 22 | #include 23 | 24 | void zephir_exit_empty(); 25 | void zephir_exit(zval *ptr); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /ext/interop.h: -------------------------------------------------------------------------------- 1 | 2 | /* This file was generated automatically by Zephir do not modify it! */ 3 | 4 | #ifndef ZEPHIR_CLASS_ENTRIES_H 5 | #define ZEPHIR_CLASS_ENTRIES_H 6 | 7 | #include "interop/queue/exception.zep.h" 8 | #include "interop/queue/exception/exception.zep.h" 9 | #include "interop/queue/destination.zep.h" 10 | #include "interop/queue/connectionfactory.zep.h" 11 | #include "interop/queue/consumer.zep.h" 12 | #include "interop/queue/context.zep.h" 13 | #include "interop/queue/exception/deliverydelaynotsupportedexception.zep.h" 14 | #include "interop/queue/exception/invaliddestinationexception.zep.h" 15 | #include "interop/queue/exception/invalidmessageexception.zep.h" 16 | #include "interop/queue/exception/prioritynotsupportedexception.zep.h" 17 | #include "interop/queue/exception/purgequeuenotsupportedexception.zep.h" 18 | #include "interop/queue/exception/subscriptionconsumernotsupportedexception.zep.h" 19 | #include "interop/queue/exception/temporaryqueuenotsupportedexception.zep.h" 20 | #include "interop/queue/exception/timetolivenotsupportedexception.zep.h" 21 | #include "interop/queue/message.zep.h" 22 | #include "interop/queue/processor.zep.h" 23 | #include "interop/queue/producer.zep.h" 24 | #include "interop/queue/queue.zep.h" 25 | #include "interop/queue/subscriptionconsumer.zep.h" 26 | #include "interop/queue/topic.zep.h" 27 | 28 | #endif -------------------------------------------------------------------------------- /ext/interop/queue/exception/purgequeuenotsupportedexception.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_exception_purgequeuenotsupportedexception_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_PurgeQueueNotSupportedException); 5 | 6 | PHP_METHOD(Interop_Queue_Exception_PurgeQueueNotSupportedException, providerDoestNotSupportIt); 7 | 8 | #if PHP_VERSION_ID >= 70200 9 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_exception_purgequeuenotsupportedexception_providerdoestnotsupportit, 0, 0, Interop\\Queue\\Exception\\PurgeQueueNotSupportedException, 0) 10 | #else 11 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_exception_purgequeuenotsupportedexception_providerdoestnotsupportit, 0, 0, IS_OBJECT, "Interop\\Queue\\Exception\\PurgeQueueNotSupportedException", 0) 12 | #endif 13 | #if PHP_VERSION_ID >= 70200 14 | ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) 15 | #else 16 | ZEND_ARG_INFO(0, code) 17 | #endif 18 | ZEND_ARG_OBJ_INFO(0, previous, Throwable, 1) 19 | ZEND_END_ARG_INFO() 20 | 21 | ZEPHIR_INIT_FUNCS(interop_queue_exception_purgequeuenotsupportedexception_method_entry) { 22 | PHP_ME(Interop_Queue_Exception_PurgeQueueNotSupportedException, providerDoestNotSupportIt, arginfo_interop_queue_exception_purgequeuenotsupportedexception_providerdoestnotsupportit, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) 23 | PHP_FE_END 24 | }; 25 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/timetolivenotsupportedexception.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_exception_timetolivenotsupportedexception_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_TimeToLiveNotSupportedException); 5 | 6 | PHP_METHOD(Interop_Queue_Exception_TimeToLiveNotSupportedException, providerDoestNotSupportIt); 7 | 8 | #if PHP_VERSION_ID >= 70200 9 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_exception_timetolivenotsupportedexception_providerdoestnotsupportit, 0, 0, Interop\\Queue\\Exception\\TimeToLiveNotSupportedException, 0) 10 | #else 11 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_exception_timetolivenotsupportedexception_providerdoestnotsupportit, 0, 0, IS_OBJECT, "Interop\\Queue\\Exception\\TimeToLiveNotSupportedException", 0) 12 | #endif 13 | #if PHP_VERSION_ID >= 70200 14 | ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) 15 | #else 16 | ZEND_ARG_INFO(0, code) 17 | #endif 18 | ZEND_ARG_OBJ_INFO(0, previous, Throwable, 1) 19 | ZEND_END_ARG_INFO() 20 | 21 | ZEPHIR_INIT_FUNCS(interop_queue_exception_timetolivenotsupportedexception_method_entry) { 22 | PHP_ME(Interop_Queue_Exception_TimeToLiveNotSupportedException, providerDoestNotSupportIt, arginfo_interop_queue_exception_timetolivenotsupportedexception_providerdoestnotsupportit, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) 23 | PHP_FE_END 24 | }; 25 | -------------------------------------------------------------------------------- /ext/kernel/time.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | */ 16 | 17 | #ifndef ZEPHIR_KERNEL_TIME_H 18 | #define ZEPHIR_KERNEL_TIME_H 19 | 20 | #include 21 | #include 22 | 23 | #define MICRO_IN_SEC 1000000.00 24 | 25 | void zephir_time(zval *return_value); 26 | #ifdef HAVE_GETTIMEOFDAY 27 | void zephir_microtime(zval *return_value, zval *get_as_float); 28 | #endif 29 | 30 | #endif /* ZEPHIR_KERNEL_TIME_H */ 31 | -------------------------------------------------------------------------------- /ext/interop/queue/subscriptionconsumer.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_subscriptionconsumer_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_SubscriptionConsumer); 5 | 6 | ZEND_BEGIN_ARG_INFO_EX(arginfo_interop_queue_subscriptionconsumer_consume, 0, 0, 0) 7 | #if PHP_VERSION_ID >= 70200 8 | ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0) 9 | #else 10 | ZEND_ARG_INFO(0, timeout) 11 | #endif 12 | ZEND_END_ARG_INFO() 13 | 14 | ZEND_BEGIN_ARG_INFO_EX(arginfo_interop_queue_subscriptionconsumer_subscribe, 0, 0, 2) 15 | ZEND_ARG_OBJ_INFO(0, consumer, Interop\\Queue\\Consumer, 0) 16 | ZEND_ARG_INFO(0, callback) 17 | ZEND_END_ARG_INFO() 18 | 19 | ZEND_BEGIN_ARG_INFO_EX(arginfo_interop_queue_subscriptionconsumer_unsubscribe, 0, 0, 1) 20 | ZEND_ARG_OBJ_INFO(0, consumer, Interop\\Queue\\Consumer, 0) 21 | ZEND_END_ARG_INFO() 22 | 23 | ZEPHIR_INIT_FUNCS(interop_queue_subscriptionconsumer_method_entry) { 24 | PHP_ABSTRACT_ME(Interop_Queue_SubscriptionConsumer, consume, arginfo_interop_queue_subscriptionconsumer_consume) 25 | PHP_ABSTRACT_ME(Interop_Queue_SubscriptionConsumer, subscribe, arginfo_interop_queue_subscriptionconsumer_subscribe) 26 | PHP_ABSTRACT_ME(Interop_Queue_SubscriptionConsumer, unsubscribe, arginfo_interop_queue_subscriptionconsumer_unsubscribe) 27 | PHP_ABSTRACT_ME(Interop_Queue_SubscriptionConsumer, unsubscribeAll, NULL) 28 | PHP_FE_END 29 | }; 30 | -------------------------------------------------------------------------------- /interop/queue/context.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue; 3 | 4 | use Interop\Queue\Exception\PurgeQueueNotSupportedException; 5 | use Interop\Queue\Exception\SubscriptionConsumerNotSupportedException; 6 | use Interop\Queue\Exception\TemporaryQueueNotSupportedException; 7 | 8 | interface Context 9 | { 10 | public function createMessage(string body = "", array properties = [], array headers = []) -> ; 11 | 12 | public function createTopic(string topicName) -> ; 13 | 14 | public function createQueue(string queueName) -> ; 15 | 16 | /** 17 | * Create temporary queue. 18 | * The queue is visible by this connection only. 19 | * It will be deleted once the connection is closed. 20 | * 21 | * @throws TemporaryQueueNotSupportedException 22 | */ 23 | public function createTemporaryQueue() -> ; 24 | 25 | public function createProducer() -> ; 26 | 27 | public function createConsumer( destination) -> ; 28 | 29 | /** 30 | * @throws SubscriptionConsumerNotSupportedException 31 | */ 32 | public function createSubscriptionConsumer() -> ; 33 | 34 | /** 35 | * @throws PurgeQueueNotSupportedException 36 | */ 37 | public function purgeQueue( queue) -> void; 38 | 39 | public function close() -> void; 40 | } -------------------------------------------------------------------------------- /ext/interop/queue/exception/deliverydelaynotsupportedexception.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_exception_deliverydelaynotsupportedexception_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_DeliveryDelayNotSupportedException); 5 | 6 | PHP_METHOD(Interop_Queue_Exception_DeliveryDelayNotSupportedException, providerDoestNotSupportIt); 7 | 8 | #if PHP_VERSION_ID >= 70200 9 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_exception_deliverydelaynotsupportedexception_providerdoestnotsupportit, 0, 0, Interop\\Queue\\Exception\\DeliveryDelayNotSupportedException, 0) 10 | #else 11 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_exception_deliverydelaynotsupportedexception_providerdoestnotsupportit, 0, 0, IS_OBJECT, "Interop\\Queue\\Exception\\DeliveryDelayNotSupportedException", 0) 12 | #endif 13 | #if PHP_VERSION_ID >= 70200 14 | ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) 15 | #else 16 | ZEND_ARG_INFO(0, code) 17 | #endif 18 | ZEND_ARG_OBJ_INFO(0, previous, Throwable, 1) 19 | ZEND_END_ARG_INFO() 20 | 21 | ZEPHIR_INIT_FUNCS(interop_queue_exception_deliverydelaynotsupportedexception_method_entry) { 22 | PHP_ME(Interop_Queue_Exception_DeliveryDelayNotSupportedException, providerDoestNotSupportIt, arginfo_interop_queue_exception_deliverydelaynotsupportedexception_providerdoestnotsupportit, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) 23 | PHP_FE_END 24 | }; 25 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/temporaryqueuenotsupportedexception.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_exception_temporaryqueuenotsupportedexception_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_TemporaryQueueNotSupportedException); 5 | 6 | PHP_METHOD(Interop_Queue_Exception_TemporaryQueueNotSupportedException, providerDoestNotSupportIt); 7 | 8 | #if PHP_VERSION_ID >= 70200 9 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_exception_temporaryqueuenotsupportedexception_providerdoestnotsupportit, 0, 0, Interop\\Queue\\Exception\\TemporaryQueueNotSupportedException, 0) 10 | #else 11 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_exception_temporaryqueuenotsupportedexception_providerdoestnotsupportit, 0, 0, IS_OBJECT, "Interop\\Queue\\Exception\\TemporaryQueueNotSupportedException", 0) 12 | #endif 13 | #if PHP_VERSION_ID >= 70200 14 | ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) 15 | #else 16 | ZEND_ARG_INFO(0, code) 17 | #endif 18 | ZEND_ARG_OBJ_INFO(0, previous, Throwable, 1) 19 | ZEND_END_ARG_INFO() 20 | 21 | ZEPHIR_INIT_FUNCS(interop_queue_exception_temporaryqueuenotsupportedexception_method_entry) { 22 | PHP_ME(Interop_Queue_Exception_TemporaryQueueNotSupportedException, providerDoestNotSupportIt, arginfo_interop_queue_exception_temporaryqueuenotsupportedexception_providerdoestnotsupportit, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) 23 | PHP_FE_END 24 | }; 25 | -------------------------------------------------------------------------------- /ext/interop/queue/context.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../php_ext.h" 8 | #include "../../ext.h" 9 | 10 | #include 11 | 12 | #include "kernel/main.h" 13 | 14 | 15 | ZEPHIR_INIT_CLASS(Interop_Queue_Context) { 16 | 17 | ZEPHIR_REGISTER_INTERFACE(Interop\\Queue, Context, interop, queue_context, interop_queue_context_method_entry); 18 | 19 | return SUCCESS; 20 | 21 | } 22 | 23 | ZEPHIR_DOC_METHOD(Interop_Queue_Context, createMessage); 24 | 25 | ZEPHIR_DOC_METHOD(Interop_Queue_Context, createTopic); 26 | 27 | ZEPHIR_DOC_METHOD(Interop_Queue_Context, createQueue); 28 | 29 | /** 30 | * Create temporary queue. 31 | * The queue is visible by this connection only. 32 | * It will be deleted once the connection is closed. 33 | * 34 | * @throws TemporaryQueueNotSupportedException 35 | */ 36 | ZEPHIR_DOC_METHOD(Interop_Queue_Context, createTemporaryQueue); 37 | 38 | ZEPHIR_DOC_METHOD(Interop_Queue_Context, createProducer); 39 | 40 | ZEPHIR_DOC_METHOD(Interop_Queue_Context, createConsumer); 41 | 42 | /** 43 | * @throws SubscriptionConsumerNotSupportedException 44 | */ 45 | ZEPHIR_DOC_METHOD(Interop_Queue_Context, createSubscriptionConsumer); 46 | 47 | /** 48 | * @throws PurgeQueueNotSupportedException 49 | */ 50 | ZEPHIR_DOC_METHOD(Interop_Queue_Context, purgeQueue); 51 | 52 | ZEPHIR_DOC_METHOD(Interop_Queue_Context, close); 53 | 54 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/subscriptionconsumernotsupportedexception.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_exception_subscriptionconsumernotsupportedexception_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_SubscriptionConsumerNotSupportedException); 5 | 6 | PHP_METHOD(Interop_Queue_Exception_SubscriptionConsumerNotSupportedException, providerDoestNotSupportIt); 7 | 8 | #if PHP_VERSION_ID >= 70200 9 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_exception_subscriptionconsumernotsupportedexception_providerdoestnotsupportit, 0, 0, Interop\\Queue\\Exception\\SubscriptionConsumerNotSupportedException, 0) 10 | #else 11 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_exception_subscriptionconsumernotsupportedexception_providerdoestnotsupportit, 0, 0, IS_OBJECT, "Interop\\Queue\\Exception\\SubscriptionConsumerNotSupportedException", 0) 12 | #endif 13 | #if PHP_VERSION_ID >= 70200 14 | ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) 15 | #else 16 | ZEND_ARG_INFO(0, code) 17 | #endif 18 | ZEND_ARG_OBJ_INFO(0, previous, Throwable, 1) 19 | ZEND_END_ARG_INFO() 20 | 21 | ZEPHIR_INIT_FUNCS(interop_queue_exception_subscriptionconsumernotsupportedexception_method_entry) { 22 | PHP_ME(Interop_Queue_Exception_SubscriptionConsumerNotSupportedException, providerDoestNotSupportIt, arginfo_interop_queue_exception_subscriptionconsumernotsupportedexception_providerdoestnotsupportit, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) 23 | PHP_FE_END 24 | }; 25 | -------------------------------------------------------------------------------- /ext/kernel/README.md: -------------------------------------------------------------------------------- 1 | Zephir Kernel 2 | ============== 3 | 4 | Zephir Kernel is a meta-framework on top of the Zend API helping to create PHP extensions in an easier way 5 | for a PHP developer. 6 | 7 | In order to build a fast and stable framework, we have created the Zephir Kernel. The use of 8 | this API helps us to write C code in a PHP style. We have developed a number of functions to help the 9 | programmer to write code more interoperable with PHP in a easier way. 10 | 11 | Zephir Kernel API is based on the Zend API, but we have added more features to facilitate us the work. 12 | Zephir is a very large project, frameworks need to be developed and improved every day, Zephir Kernel API 13 | helps us to write C code that is more stable and familiar to PHP developers. 14 | 15 | If you’re a PHP developer maybe you don’t know C or you don’t want to learn C, but after read this guide 16 | you will find the Zephir API very familiar to your knowledge. 17 | 18 | Zephir Kernel provides you: 19 | 20 | * Manipulate arrays/objects 21 | * Call functions/methods in the PHP userland 22 | * Automatic memory management 23 | * Require and execute PHP plain files 24 | * Simplification of common operations like concatenation 25 | * Read superglobals and update the active symbol table 26 | * Register classes in namespaces 27 | * Throw exceptions 28 | * And more 29 | 30 | License 31 | ------- 32 | Zephir is open-sourced software licensed under the New MIT License. See the LICENSE file for more information. 33 | -------------------------------------------------------------------------------- /ext/interop/queue/subscriptionconsumer.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../php_ext.h" 8 | #include "../../ext.h" 9 | 10 | #include 11 | 12 | #include "kernel/main.h" 13 | 14 | 15 | ZEPHIR_INIT_CLASS(Interop_Queue_SubscriptionConsumer) { 16 | 17 | ZEPHIR_REGISTER_INTERFACE(Interop\\Queue, SubscriptionConsumer, interop, queue_subscriptionconsumer, interop_queue_subscriptionconsumer_method_entry); 18 | 19 | return SUCCESS; 20 | 21 | } 22 | 23 | /** 24 | * The timeout is in milliseconds. 25 | * Set zero to consume endlessly or till a consumer returns false. 26 | */ 27 | ZEPHIR_DOC_METHOD(Interop_Queue_SubscriptionConsumer, consume); 28 | 29 | /** 30 | * Notify broker that the client is interested in consuming messages from this queue. 31 | * 32 | * A callback function to which the consumed message will be passed. 33 | * The function must accept at a minimum one parameter, an \Interop\Queue\Message object, 34 | * and an optional second parameter the \Interop\Queue\Consumer from which the message was 35 | * consumed. The consumer will not return the processing thread back to 36 | * the PHP script until the callback function returns FALSE. 37 | */ 38 | ZEPHIR_DOC_METHOD(Interop_Queue_SubscriptionConsumer, subscribe); 39 | 40 | ZEPHIR_DOC_METHOD(Interop_Queue_SubscriptionConsumer, unsubscribe); 41 | 42 | ZEPHIR_DOC_METHOD(Interop_Queue_SubscriptionConsumer, unsubscribeAll); 43 | 44 | -------------------------------------------------------------------------------- /interop/queue/consumer.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue; 3 | 4 | use Interop\Queue\Queue; 5 | use Interop\Queue\Message; 6 | 7 | /** 8 | * A client uses a MessageConsumer object to receive messages from a destination. 9 | * A MessageConsumer object is created by passing a Destination object 10 | * to a message-consumer creation method supplied by a session. 11 | * 12 | * @see https://docs.oracle.com/javaee/7/api/javax/jms/MessageConsumer.html 13 | */ 14 | interface Consumer 15 | { 16 | /** 17 | * Gets the Queue associated with this queue receiver. 18 | */ 19 | public function getQueue() -> ; 20 | 21 | /** 22 | * Receives the next message that arrives within the specified timeout interval. 23 | * This call blocks until a message arrives, the timeout expires, or this message consumer is closed. 24 | * A timeout of zero never expires, and the call blocks indefinitely. 25 | * 26 | * Timeout is in milliseconds 27 | */ 28 | public function receive(int timeout = 0) -> | null; 29 | 30 | /** 31 | * Receives the next message if one is immediately available. 32 | */ 33 | public function receiveNoWait() -> | null; 34 | 35 | /** 36 | * Tell the MQ broker that the message was processed successfully. 37 | */ 38 | public function acknowledge( message) -> void; 39 | 40 | /** 41 | * Tell the MQ broker that the message was rejected. 42 | */ 43 | public function reject( message, bool requeue = false) -> void; 44 | } -------------------------------------------------------------------------------- /ext/config.w32: -------------------------------------------------------------------------------- 1 | ARG_ENABLE("interop", "enable interop", "no"); 2 | 3 | if (PHP_INTEROP != "no") { 4 | EXTENSION("interop", "interop.c", null, "-I"+configure_module_dirname); 5 | ADD_SOURCES(configure_module_dirname + "/kernel", "main.c memory.c exception.c debug.c backtrace.c object.c array.c string.c fcall.c require.c file.c operators.c math.c concat.c variables.c filter.c iterator.c exit.c time.c", "interop"); 6 | /* PCRE is always included on WIN32 */ 7 | AC_DEFINE("ZEPHIR_USE_PHP_PCRE", 1, "Whether PHP pcre extension is present at compile time"); 8 | if (PHP_JSON != "no") { 9 | ADD_EXTENSION_DEP("interop", "json"); 10 | AC_DEFINE("ZEPHIR_USE_PHP_JSON", 1, "Whether PHP json extension is present at compile time"); 11 | } 12 | 13 | ADD_SOURCES(configure_module_dirname + "/interop/queue", "exception.zep.c destination.zep.c connectionfactory.zep.c consumer.zep.c context.zep.c message.zep.c processor.zep.c producer.zep.c queue.zep.c subscriptionconsumer.zep.c topic.zep.c", "interop"); 14 | ADD_SOURCES(configure_module_dirname + "/interop/queue/exception", "exception.zep.c deliverydelaynotsupportedexception.zep.c invaliddestinationexception.zep.c invalidmessageexception.zep.c prioritynotsupportedexception.zep.c purgequeuenotsupportedexception.zep.c subscriptionconsumernotsupportedexception.zep.c temporaryqueuenotsupportedexception.zep.c timetolivenotsupportedexception.zep.c", "interop"); 15 | ADD_FLAG("CFLAGS_INTEROP", "/D ZEPHIR_RELEASE /Oi /Ot /Oy /Ob2 /Gs /GF /Gy /GL"); 16 | ADD_FLAG("CFLAGS", "/D ZEPHIR_RELEASE /Oi /Ot /Oy /Ob2 /Gs /GF /Gy /GL"); 17 | ADD_FLAG("LDFLAGS", "/LTCG"); 18 | } 19 | -------------------------------------------------------------------------------- /ext/kernel/exit.c: -------------------------------------------------------------------------------- 1 | /* 2 | +------------------------------------------------------------------------+ 3 | | Zephir Language | 4 | +------------------------------------------------------------------------+ 5 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 6 | +------------------------------------------------------------------------+ 7 | | This source file is subject to the New BSD License that is bundled | 8 | | with this package in the file docs/LICENSE.txt. | 9 | | | 10 | | If you did not receive a copy of the license and are unable to | 11 | | obtain it through the world-wide-web, please send an email | 12 | | to license@zephir-lang.com so we can send you a copy immediately. | 13 | +------------------------------------------------------------------------+ 14 | | Authors: Song Yeung | 15 | +------------------------------------------------------------------------+ 16 | */ 17 | 18 | #ifdef HAVE_CONFIG_H 19 | #include "config.h" 20 | #endif 21 | 22 | #include "php.h" 23 | #include "php_ext.h" 24 | #include "php_main.h" 25 | 26 | #include "kernel/main.h" 27 | #include "kernel/exit.h" 28 | 29 | void zephir_exit_empty() 30 | { 31 | zend_bailout(); 32 | } 33 | 34 | void zephir_exit(zval *ptr) 35 | { 36 | if (Z_TYPE_P(ptr) == IS_LONG) { 37 | EG(exit_status) = Z_LVAL_P(ptr); 38 | } else { 39 | zend_print_variable(ptr); 40 | } 41 | zephir_exit_empty(); 42 | } 43 | -------------------------------------------------------------------------------- /ext/kernel/backtrace.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | | Vladimir Kolesnikov | 18 | +------------------------------------------------------------------------+ 19 | */ 20 | 21 | #ifndef ZEPHIR_KERNEL_BACKTRACE_H 22 | #define ZEPHIR_KERNEL_BACKTRACE_H 23 | 24 | #ifndef ZEPHIR_RELEASE 25 | 26 | void zephir_print_backtrace(void); 27 | 28 | #else 29 | 30 | #ifndef zephir_print_backtrace 31 | #define zephir_print_backtrace() 32 | #endif 33 | 34 | #endif 35 | #endif /* ZEPHIR_KERNEL_BACKTRACE_H */ 36 | -------------------------------------------------------------------------------- /ext/kernel/variables.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | | Rack Lin | 18 | +------------------------------------------------------------------------+ 19 | */ 20 | 21 | #ifndef ZEPHIR_KERNEL_VARIABLES_H 22 | #define ZEPHIR_KERNEL_VARIABLES_H 23 | 24 | #include 25 | #include 26 | 27 | void zephir_var_dump(zval *var); 28 | 29 | void zephir_var_export(zval *var); 30 | void zephir_var_export_ex(zval *return_value, zval *var); 31 | 32 | void zephir_get_defined_vars(zval *return_value); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /ext/kernel/concat.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ZEPHIR_KERNEL_CONCAT_H 3 | #define ZEPHIR_KERNEL_CONCAT_H 4 | #include 5 | #include 6 | #include "kernel/main.h" 7 | #define ZEPHIR_CONCAT_SV(result, op1, op2) \ 8 | zephir_concat_sv(result, op1, sizeof(op1)-1, op2, 0); 9 | #define ZEPHIR_SCONCAT_SV(result, op1, op2) \ 10 | zephir_concat_sv(result, op1, sizeof(op1)-1, op2, 1); 11 | 12 | #define ZEPHIR_CONCAT_SVSVS(result, op1, op2, op3, op4, op5) \ 13 | zephir_concat_svsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, 0); 14 | #define ZEPHIR_SCONCAT_SVSVS(result, op1, op2, op3, op4, op5) \ 15 | zephir_concat_svsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, 1); 16 | 17 | #define ZEPHIR_CONCAT_VS(result, op1, op2) \ 18 | zephir_concat_vs(result, op1, op2, sizeof(op2)-1, 0); 19 | #define ZEPHIR_SCONCAT_VS(result, op1, op2) \ 20 | zephir_concat_vs(result, op1, op2, sizeof(op2)-1, 1); 21 | 22 | #define ZEPHIR_CONCAT_VV(result, op1, op2) \ 23 | zephir_concat_vv(result, op1, op2, 0); 24 | #define ZEPHIR_SCONCAT_VV(result, op1, op2) \ 25 | zephir_concat_vv(result, op1, op2, 1); 26 | 27 | 28 | void zephir_concat_sv(zval *result, const char *op1, zend_uint op1_len, zval *op2, int self_var); 29 | void zephir_concat_svsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, int self_var); 30 | void zephir_concat_vs(zval *result, zval *op1, const char *op2, zend_uint op2_len, int self_var); 31 | void zephir_concat_vv(zval *result, zval *op1, zval *op2, int self_var); 32 | void zephir_concat_function(zval *result, zval *op1, zval *op2); 33 | #endif /* ZEPHIR_KERNEL_CONCAT_H */ 34 | -------------------------------------------------------------------------------- /ext/kernel/filter.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | +------------------------------------------------------------------------+ 18 | */ 19 | 20 | #ifndef ZEPHIR_KERNEL_FILTER_H 21 | #define ZEPHIR_KERNEL_FILTER_H 22 | 23 | #include 24 | 25 | void zephir_filter_alphanum(zval *return_value, zval *param); 26 | void zephir_is_basic_charset(zval *return_value, const zval *param); 27 | void zephir_escape_multi(zval *return_value, zval *param, const char *escape_char, unsigned int escape_length, char escape_extra, int use_whitelist); 28 | void zephir_escape_js(zval *return_value, zval *param); 29 | void zephir_escape_css(zval *return_value, zval *param); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /ext/interop/queue/consumer.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../php_ext.h" 8 | #include "../../ext.h" 9 | 10 | #include 11 | 12 | #include "kernel/main.h" 13 | 14 | 15 | /** 16 | * A client uses a MessageConsumer object to receive messages from a destination. 17 | * A MessageConsumer object is created by passing a Destination object 18 | * to a message-consumer creation method supplied by a session. 19 | * 20 | * @see https://docs.oracle.com/javaee/7/api/javax/jms/MessageConsumer.html 21 | */ 22 | ZEPHIR_INIT_CLASS(Interop_Queue_Consumer) { 23 | 24 | ZEPHIR_REGISTER_INTERFACE(Interop\\Queue, Consumer, interop, queue_consumer, interop_queue_consumer_method_entry); 25 | 26 | return SUCCESS; 27 | 28 | } 29 | 30 | /** 31 | * Gets the Queue associated with this queue receiver. 32 | */ 33 | ZEPHIR_DOC_METHOD(Interop_Queue_Consumer, getQueue); 34 | 35 | /** 36 | * Receives the next message that arrives within the specified timeout interval. 37 | * This call blocks until a message arrives, the timeout expires, or this message consumer is closed. 38 | * A timeout of zero never expires, and the call blocks indefinitely. 39 | * 40 | * Timeout is in milliseconds 41 | */ 42 | ZEPHIR_DOC_METHOD(Interop_Queue_Consumer, receive); 43 | 44 | /** 45 | * Receives the next message if one is immediately available. 46 | */ 47 | ZEPHIR_DOC_METHOD(Interop_Queue_Consumer, receiveNoWait); 48 | 49 | /** 50 | * Tell the MQ broker that the message was processed successfully. 51 | */ 52 | ZEPHIR_DOC_METHOD(Interop_Queue_Consumer, acknowledge); 53 | 54 | /** 55 | * Tell the MQ broker that the message was rejected. 56 | */ 57 | ZEPHIR_DOC_METHOD(Interop_Queue_Consumer, reject); 58 | 59 | -------------------------------------------------------------------------------- /ext/interop/queue/processor.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../php_ext.h" 8 | #include "../../ext.h" 9 | 10 | #include 11 | 12 | #include "kernel/main.h" 13 | 14 | 15 | ZEPHIR_INIT_CLASS(Interop_Queue_Processor) { 16 | 17 | ZEPHIR_REGISTER_INTERFACE(Interop\\Queue, Processor, interop, queue_processor, interop_queue_processor_method_entry); 18 | 19 | /** 20 | * Use this constant when the message is processed successfully and the message could be removed from the queue. 21 | */ 22 | zephir_declare_class_constant_string(interop_queue_processor_ce, SL("ACK"), "enqueue.ack"); 23 | 24 | /** 25 | * Use this constant when the message is not valid or could not be processed 26 | * The message is removed from the queue. 27 | */ 28 | zephir_declare_class_constant_string(interop_queue_processor_ce, SL("REJECT"), "enqueue.reject"); 29 | 30 | /** 31 | * Use this constant when the message is not valid or could not be processed right now but we can try again later 32 | * The original message is removed from the queue but a copy is published to the queue again. 33 | */ 34 | zephir_declare_class_constant_string(interop_queue_processor_ce, SL("REQUEUE"), "enqueue.requeue"); 35 | 36 | return SUCCESS; 37 | 38 | } 39 | 40 | /** 41 | * The method has to return either self::ACK, self::REJECT, self::REQUEUE string. 42 | * 43 | * The method also can return an object. 44 | * It must implement __toString method and the method must return one of the constants from above. 45 | * 46 | * @param Message $message 47 | * @param Context $context 48 | * 49 | * @return string|object with __toString method implemented 50 | */ 51 | ZEPHIR_DOC_METHOD(Interop_Queue_Processor, process); 52 | 53 | -------------------------------------------------------------------------------- /ext/kernel/math.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | +------------------------------------------------------------------------+ 18 | */ 19 | 20 | #ifndef ZEPHIR_KERNEL_MATH_H 21 | #define ZEPHIR_KERNEL_MATH_H 22 | 23 | #include 24 | #include 25 | 26 | double zephir_sin(zval *op1); 27 | double zephir_asin(zval *op1); 28 | double zephir_tan(zval *op1); 29 | double zephir_cos(zval *op1); 30 | double zephir_acos(zval *op1); 31 | double zephir_sqrt(zval *op1); 32 | 33 | double zephir_floor(zval *op1); 34 | zend_long zephir_mt_rand(zend_long min, zend_long max); 35 | double zephir_ceil(zval *op1); 36 | void zephir_round(zval *return_value, zval *op1, zval *op2, zval *op3); 37 | 38 | double zephir_ldexp(zval *value, zval *expval); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /ext/kernel/iterator.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | | Vladimir Kolesnikov | 18 | +------------------------------------------------------------------------+ 19 | */ 20 | 21 | #ifndef ZEPHIR_KERNEL_ITERATOR_H 22 | #define ZEPHIR_KERNEL_ITERATOR_H 23 | 24 | #include 25 | #include 26 | 27 | zend_object_iterator *zephir_get_iterator(zval *iterator); 28 | 29 | #define ZEPHIR_ITERATOR_COPY(var, it) \ 30 | { \ 31 | zval *ZEPHIR_TMP_ITERATOR_PTR; \ 32 | ZEPHIR_TMP_ITERATOR_PTR = it->funcs->get_current_data(it); \ 33 | if (UNEXPECTED(EG(exception) != NULL)) { \ 34 | return; \ 35 | } \ 36 | ZEPHIR_INIT_NVAR(var); \ 37 | if (Z_ISREF_P(var)) { \ 38 | ZVAL_DUP(var, Z_REFVAL_P(var)); \ 39 | } else { \ 40 | ZVAL_COPY(var, ZEPHIR_TMP_ITERATOR_PTR); \ 41 | } \ 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /ext/kernel/time.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | */ 16 | 17 | #ifdef HAVE_CONFIG_H 18 | #include "config.h" 19 | #endif 20 | 21 | #ifdef PHP_WIN32 22 | #include "win32/time.h" 23 | #elif defined(NETWARE) 24 | #include 25 | #include 26 | #else 27 | #include 28 | #endif 29 | 30 | #include 31 | 32 | #include "php.h" 33 | #include "php_ext.h" 34 | 35 | #include "kernel/main.h" 36 | #include "kernel/time.h" 37 | #include "kernel/operators.h" 38 | 39 | void zephir_time(zval *return_value) 40 | { 41 | RETURN_LONG(time(NULL)); 42 | } 43 | 44 | void zephir_microtime(zval *return_value, zval *get_as_float) 45 | { 46 | struct timeval tp = {0}; 47 | char ret[100]; 48 | 49 | if (gettimeofday(&tp, NULL)) { 50 | RETURN_FALSE; 51 | } 52 | 53 | if (get_as_float && ZEPHIR_IS_TRUE(get_as_float)) { 54 | RETURN_DOUBLE((double)(tp.tv_sec + tp.tv_usec / MICRO_IN_SEC)); 55 | } 56 | 57 | snprintf(ret, 100, "%.8F %ld", tp.tv_usec / MICRO_IN_SEC, tp.tv_sec); 58 | RETURN_STRING(ret); 59 | } 60 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/prioritynotsupportedexception.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../../php_ext.h" 8 | #include "../../../ext.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "kernel/main.h" 15 | #include "kernel/fcall.h" 16 | #include "kernel/memory.h" 17 | #include "kernel/operators.h" 18 | 19 | 20 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_PriorityNotSupportedException) { 21 | 22 | ZEPHIR_REGISTER_CLASS_EX(Interop\\Queue\\Exception, PriorityNotSupportedException, interop, queue_exception_prioritynotsupportedexception, interop_queue_exception_exception_ce, interop_queue_exception_prioritynotsupportedexception_method_entry, 0); 23 | 24 | return SUCCESS; 25 | 26 | } 27 | 28 | /** 29 | * @param int $code 30 | * @param \Throwable $previous 31 | * 32 | * @return static 33 | */ 34 | PHP_METHOD(Interop_Queue_Exception_PriorityNotSupportedException, providerDoestNotSupportIt) { 35 | 36 | zval *code_param = NULL, *previous = NULL, previous_sub, __$null, _0, _1; 37 | zend_long code, ZEPHIR_LAST_CALL_STATUS; 38 | zval *this_ptr = getThis(); 39 | 40 | ZVAL_UNDEF(&previous_sub); 41 | ZVAL_NULL(&__$null); 42 | ZVAL_UNDEF(&_0); 43 | ZVAL_UNDEF(&_1); 44 | 45 | ZEPHIR_MM_GROW(); 46 | zephir_fetch_params(1, 0, 2, &code_param, &previous); 47 | 48 | if (!code_param) { 49 | code = 0; 50 | } else { 51 | code = zephir_get_intval(code_param); 52 | } 53 | if (!previous) { 54 | previous = &previous_sub; 55 | previous = &__$null; 56 | } 57 | 58 | 59 | object_init_ex(return_value, interop_queue_exception_prioritynotsupportedexception_ce); 60 | ZEPHIR_INIT_VAR(&_0); 61 | ZVAL_STRING(&_0, "The provider does not support priority feature"); 62 | ZVAL_LONG(&_1, code); 63 | ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 1, &_0, &_1, previous); 64 | zephir_check_call_status(); 65 | RETURN_MM(); 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/purgequeuenotsupportedexception.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../../php_ext.h" 8 | #include "../../../ext.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "kernel/main.h" 15 | #include "kernel/fcall.h" 16 | #include "kernel/memory.h" 17 | #include "kernel/operators.h" 18 | 19 | 20 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_PurgeQueueNotSupportedException) { 21 | 22 | ZEPHIR_REGISTER_CLASS_EX(Interop\\Queue\\Exception, PurgeQueueNotSupportedException, interop, queue_exception_purgequeuenotsupportedexception, interop_queue_exception_exception_ce, interop_queue_exception_purgequeuenotsupportedexception_method_entry, 0); 23 | 24 | return SUCCESS; 25 | 26 | } 27 | 28 | /** 29 | * @param int $code 30 | * @param \Throwable $previous 31 | * 32 | * @return static 33 | */ 34 | PHP_METHOD(Interop_Queue_Exception_PurgeQueueNotSupportedException, providerDoestNotSupportIt) { 35 | 36 | zval *code_param = NULL, *previous = NULL, previous_sub, __$null, _0, _1; 37 | zend_long code, ZEPHIR_LAST_CALL_STATUS; 38 | zval *this_ptr = getThis(); 39 | 40 | ZVAL_UNDEF(&previous_sub); 41 | ZVAL_NULL(&__$null); 42 | ZVAL_UNDEF(&_0); 43 | ZVAL_UNDEF(&_1); 44 | 45 | ZEPHIR_MM_GROW(); 46 | zephir_fetch_params(1, 0, 2, &code_param, &previous); 47 | 48 | if (!code_param) { 49 | code = 0; 50 | } else { 51 | code = zephir_get_intval(code_param); 52 | } 53 | if (!previous) { 54 | previous = &previous_sub; 55 | previous = &__$null; 56 | } 57 | 58 | 59 | object_init_ex(return_value, interop_queue_exception_purgequeuenotsupportedexception_ce); 60 | ZEPHIR_INIT_VAR(&_0); 61 | ZVAL_STRING(&_0, "The provider does not support purge queue."); 62 | ZVAL_LONG(&_1, code); 63 | ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 1, &_0, &_1, previous); 64 | zephir_check_call_status(); 65 | RETURN_MM(); 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/timetolivenotsupportedexception.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../../php_ext.h" 8 | #include "../../../ext.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "kernel/main.h" 15 | #include "kernel/fcall.h" 16 | #include "kernel/memory.h" 17 | #include "kernel/operators.h" 18 | 19 | 20 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_TimeToLiveNotSupportedException) { 21 | 22 | ZEPHIR_REGISTER_CLASS_EX(Interop\\Queue\\Exception, TimeToLiveNotSupportedException, interop, queue_exception_timetolivenotsupportedexception, interop_queue_exception_exception_ce, interop_queue_exception_timetolivenotsupportedexception_method_entry, 0); 23 | 24 | return SUCCESS; 25 | 26 | } 27 | 28 | /** 29 | * @param int $code 30 | * @param \Throwable $previous 31 | * 32 | * @return static 33 | */ 34 | PHP_METHOD(Interop_Queue_Exception_TimeToLiveNotSupportedException, providerDoestNotSupportIt) { 35 | 36 | zval *code_param = NULL, *previous = NULL, previous_sub, __$null, _0, _1; 37 | zend_long code, ZEPHIR_LAST_CALL_STATUS; 38 | zval *this_ptr = getThis(); 39 | 40 | ZVAL_UNDEF(&previous_sub); 41 | ZVAL_NULL(&__$null); 42 | ZVAL_UNDEF(&_0); 43 | ZVAL_UNDEF(&_1); 44 | 45 | ZEPHIR_MM_GROW(); 46 | zephir_fetch_params(1, 0, 2, &code_param, &previous); 47 | 48 | if (!code_param) { 49 | code = 0; 50 | } else { 51 | code = zephir_get_intval(code_param); 52 | } 53 | if (!previous) { 54 | previous = &previous_sub; 55 | previous = &__$null; 56 | } 57 | 58 | 59 | object_init_ex(return_value, interop_queue_exception_timetolivenotsupportedexception_ce); 60 | ZEPHIR_INIT_VAR(&_0); 61 | ZVAL_STRING(&_0, "The provider does not support time to live feature"); 62 | ZVAL_LONG(&_1, code); 63 | ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 1, &_0, &_1, previous); 64 | zephir_check_call_status(); 65 | RETURN_MM(); 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /ext/php_interop.h: -------------------------------------------------------------------------------- 1 | 2 | /* This file was generated automatically by Zephir do not modify it! */ 3 | 4 | #ifndef PHP_INTEROP_H 5 | #define PHP_INTEROP_H 1 6 | 7 | #ifdef PHP_WIN32 8 | #define ZEPHIR_RELEASE 1 9 | #endif 10 | 11 | #include "kernel/globals.h" 12 | 13 | #define PHP_INTEROP_NAME "interop" 14 | #define PHP_INTEROP_VERSION "0.0.1" 15 | #define PHP_INTEROP_EXTNAME "interop" 16 | #define PHP_INTEROP_AUTHOR "" 17 | #define PHP_INTEROP_ZEPVERSION "0.11.12-1e3bafd" 18 | #define PHP_INTEROP_DESCRIPTION "" 19 | 20 | 21 | 22 | ZEND_BEGIN_MODULE_GLOBALS(interop) 23 | 24 | int initialized; 25 | 26 | /* Memory */ 27 | zephir_memory_entry *start_memory; /**< The first preallocated frame */ 28 | zephir_memory_entry *end_memory; /**< The last preallocate frame */ 29 | zephir_memory_entry *active_memory; /**< The current memory frame */ 30 | 31 | /* Virtual Symbol Tables */ 32 | zephir_symbol_table *active_symbol_table; 33 | 34 | /** Function cache */ 35 | HashTable *fcache; 36 | 37 | zephir_fcall_cache_entry *scache[ZEPHIR_MAX_CACHE_SLOTS]; 38 | 39 | /* Cache enabled */ 40 | unsigned int cache_enabled; 41 | 42 | /* Max recursion control */ 43 | unsigned int recursive_lock; 44 | 45 | 46 | ZEND_END_MODULE_GLOBALS(interop) 47 | 48 | #ifdef ZTS 49 | #include "TSRM.h" 50 | #endif 51 | 52 | ZEND_EXTERN_MODULE_GLOBALS(interop) 53 | 54 | #ifdef ZTS 55 | #define ZEPHIR_GLOBAL(v) ZEND_MODULE_GLOBALS_ACCESSOR(interop, v) 56 | #else 57 | #define ZEPHIR_GLOBAL(v) (interop_globals.v) 58 | #endif 59 | 60 | #ifdef ZTS 61 | void ***tsrm_ls; 62 | #define ZEPHIR_VGLOBAL ((zend_interop_globals *) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(interop_globals_id)]) 63 | #else 64 | #define ZEPHIR_VGLOBAL &(interop_globals) 65 | #endif 66 | 67 | #define ZEPHIR_API ZEND_API 68 | 69 | #define zephir_globals_def interop_globals 70 | #define zend_zephir_globals_def zend_interop_globals 71 | 72 | extern zend_module_entry interop_module_entry; 73 | #define phpext_interop_ptr &interop_module_entry 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/deliverydelaynotsupportedexception.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../../php_ext.h" 8 | #include "../../../ext.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "kernel/main.h" 15 | #include "kernel/fcall.h" 16 | #include "kernel/memory.h" 17 | #include "kernel/operators.h" 18 | 19 | 20 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_DeliveryDelayNotSupportedException) { 21 | 22 | ZEPHIR_REGISTER_CLASS_EX(Interop\\Queue\\Exception, DeliveryDelayNotSupportedException, interop, queue_exception_deliverydelaynotsupportedexception, interop_queue_exception_exception_ce, interop_queue_exception_deliverydelaynotsupportedexception_method_entry, 0); 23 | 24 | return SUCCESS; 25 | 26 | } 27 | 28 | /** 29 | * @param int $code 30 | * @param \Throwable $previous 31 | * 32 | * @return static 33 | */ 34 | PHP_METHOD(Interop_Queue_Exception_DeliveryDelayNotSupportedException, providerDoestNotSupportIt) { 35 | 36 | zval *code_param = NULL, *previous = NULL, previous_sub, __$null, _0, _1; 37 | zend_long code, ZEPHIR_LAST_CALL_STATUS; 38 | zval *this_ptr = getThis(); 39 | 40 | ZVAL_UNDEF(&previous_sub); 41 | ZVAL_NULL(&__$null); 42 | ZVAL_UNDEF(&_0); 43 | ZVAL_UNDEF(&_1); 44 | 45 | ZEPHIR_MM_GROW(); 46 | zephir_fetch_params(1, 0, 2, &code_param, &previous); 47 | 48 | if (!code_param) { 49 | code = 0; 50 | } else { 51 | code = zephir_get_intval(code_param); 52 | } 53 | if (!previous) { 54 | previous = &previous_sub; 55 | previous = &__$null; 56 | } 57 | 58 | 59 | object_init_ex(return_value, interop_queue_exception_deliverydelaynotsupportedexception_ce); 60 | ZEPHIR_INIT_VAR(&_0); 61 | ZVAL_STRING(&_0, "The provider does not support delivery delay feature"); 62 | ZVAL_LONG(&_1, code); 63 | ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 1, &_0, &_1, previous); 64 | zephir_check_call_status(); 65 | RETURN_MM(); 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/temporaryqueuenotsupportedexception.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../../php_ext.h" 8 | #include "../../../ext.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "kernel/main.h" 15 | #include "kernel/fcall.h" 16 | #include "kernel/memory.h" 17 | #include "kernel/operators.h" 18 | 19 | 20 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_TemporaryQueueNotSupportedException) { 21 | 22 | ZEPHIR_REGISTER_CLASS_EX(Interop\\Queue\\Exception, TemporaryQueueNotSupportedException, interop, queue_exception_temporaryqueuenotsupportedexception, interop_queue_exception_exception_ce, interop_queue_exception_temporaryqueuenotsupportedexception_method_entry, 0); 23 | 24 | return SUCCESS; 25 | 26 | } 27 | 28 | /** 29 | * @param int $code 30 | * @param \Throwable $previous 31 | * 32 | * @return static 33 | */ 34 | PHP_METHOD(Interop_Queue_Exception_TemporaryQueueNotSupportedException, providerDoestNotSupportIt) { 35 | 36 | zval *code_param = NULL, *previous = NULL, previous_sub, __$null, _0, _1; 37 | zend_long code, ZEPHIR_LAST_CALL_STATUS; 38 | zval *this_ptr = getThis(); 39 | 40 | ZVAL_UNDEF(&previous_sub); 41 | ZVAL_NULL(&__$null); 42 | ZVAL_UNDEF(&_0); 43 | ZVAL_UNDEF(&_1); 44 | 45 | ZEPHIR_MM_GROW(); 46 | zephir_fetch_params(1, 0, 2, &code_param, &previous); 47 | 48 | if (!code_param) { 49 | code = 0; 50 | } else { 51 | code = zephir_get_intval(code_param); 52 | } 53 | if (!previous) { 54 | previous = &previous_sub; 55 | previous = &__$null; 56 | } 57 | 58 | 59 | object_init_ex(return_value, interop_queue_exception_temporaryqueuenotsupportedexception_ce); 60 | ZEPHIR_INIT_VAR(&_0); 61 | ZVAL_STRING(&_0, "The provider does not support temporary queue feature"); 62 | ZVAL_LONG(&_1, code); 63 | ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 1, &_0, &_1, previous); 64 | zephir_check_call_status(); 65 | RETURN_MM(); 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/subscriptionconsumernotsupportedexception.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../../php_ext.h" 8 | #include "../../../ext.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "kernel/main.h" 15 | #include "kernel/fcall.h" 16 | #include "kernel/memory.h" 17 | #include "kernel/operators.h" 18 | 19 | 20 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_SubscriptionConsumerNotSupportedException) { 21 | 22 | ZEPHIR_REGISTER_CLASS_EX(Interop\\Queue\\Exception, SubscriptionConsumerNotSupportedException, interop, queue_exception_subscriptionconsumernotsupportedexception, interop_queue_exception_exception_ce, interop_queue_exception_subscriptionconsumernotsupportedexception_method_entry, 0); 23 | 24 | return SUCCESS; 25 | 26 | } 27 | 28 | /** 29 | * @param int $code 30 | * @param \Throwable $previous 31 | * 32 | * @return static 33 | */ 34 | PHP_METHOD(Interop_Queue_Exception_SubscriptionConsumerNotSupportedException, providerDoestNotSupportIt) { 35 | 36 | zval *code_param = NULL, *previous = NULL, previous_sub, __$null, _0, _1; 37 | zend_long code, ZEPHIR_LAST_CALL_STATUS; 38 | zval *this_ptr = getThis(); 39 | 40 | ZVAL_UNDEF(&previous_sub); 41 | ZVAL_NULL(&__$null); 42 | ZVAL_UNDEF(&_0); 43 | ZVAL_UNDEF(&_1); 44 | 45 | ZEPHIR_MM_GROW(); 46 | zephir_fetch_params(1, 0, 2, &code_param, &previous); 47 | 48 | if (!code_param) { 49 | code = 0; 50 | } else { 51 | code = zephir_get_intval(code_param); 52 | } 53 | if (!previous) { 54 | previous = &previous_sub; 55 | previous = &__$null; 56 | } 57 | 58 | 59 | object_init_ex(return_value, interop_queue_exception_subscriptionconsumernotsupportedexception_ce); 60 | ZEPHIR_INIT_VAR(&_0); 61 | ZVAL_STRING(&_0, "The provider does not support subscription consumer."); 62 | ZVAL_LONG(&_1, code); 63 | ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 1, &_0, &_1, previous); 64 | zephir_check_call_status(); 65 | RETURN_MM(); 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /ext/kernel/iterator.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | | Vladimir Kolesnikov | 18 | +------------------------------------------------------------------------+ 19 | */ 20 | 21 | #ifdef HAVE_CONFIG_H 22 | #include "config.h" 23 | #endif 24 | 25 | #include "php.h" 26 | #include "php_ext.h" 27 | 28 | #include "kernel/main.h" 29 | #include "kernel/memory.h" 30 | 31 | /** 32 | * Returns an iterator from the object 33 | */ 34 | zend_object_iterator *zephir_get_iterator(zval *iterator) 35 | { 36 | zend_class_entry *ce; 37 | zend_object_iterator *it; 38 | 39 | if (UNEXPECTED(Z_TYPE_P(iterator) != IS_OBJECT)) { 40 | return NULL; 41 | } 42 | 43 | ce = Z_OBJCE_P(iterator); 44 | it = ce->get_iterator(ce, iterator, 0); 45 | if (UNEXPECTED(!it || EG(exception))) { 46 | return NULL; 47 | } 48 | 49 | if (UNEXPECTED(it->funcs->get_current_key == NULL)) { 50 | return NULL; 51 | } 52 | 53 | if (UNEXPECTED(it->funcs->rewind == NULL)) { 54 | return NULL; 55 | } 56 | 57 | return it; 58 | } 59 | -------------------------------------------------------------------------------- /ext/kernel/file.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | +------------------------------------------------------------------------+ 18 | */ 19 | 20 | #ifndef ZEPHIR_KERNEL_FILE_H 21 | #define ZEPHIR_KERNEL_FILE_H 22 | 23 | #include 24 | 25 | int zephir_file_exists(zval *filename); 26 | 27 | void zephir_fwrite(zval *return_value, zval *stream_zval, zval *data); 28 | int zephir_feof(zval *stream_zval); 29 | int zephir_fclose(zval *stream_zval); 30 | void zephir_file_get_contents(zval *return_value, zval *filename); 31 | void zephir_file_put_contents(zval *return_value, zval *filename, zval *data); 32 | 33 | void zephir_basename(zval *return_value, zval *path); 34 | void zephir_filemtime(zval *return_value, zval *path); 35 | int zephir_compare_mtime(zval *filename1, zval *filename2); 36 | void zephir_prepare_virtual_path(zval *return_value, zval *path, zval *virtual_separator); 37 | void zephir_unique_path_key(zval *return_value, zval *path); 38 | 39 | #ifdef TSRM_WIN32 40 | #define ZEPHIR_DIRECTORY_SEPARATOR "\\" 41 | #else 42 | #define ZEPHIR_DIRECTORY_SEPARATOR "/" 43 | #endif 44 | 45 | #endif /* ZEPHIR_KERNEL_FILE_H */ 46 | -------------------------------------------------------------------------------- /ext/kernel/debug.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | +------------------------------------------------------------------------+ 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include "config.h" 22 | #endif 23 | 24 | #include 25 | #include "php_ext.h" 26 | #include "kernel/debug.h" 27 | #include "kernel/main.h" 28 | #include "kernel/string.h" 29 | 30 | #ifndef ZEPHIR_RELEASE 31 | 32 | void zephir_vdump(zval *var, const char *func) 33 | { 34 | if (Z_TYPE_P(var) > IS_CALLABLE) { 35 | fprintf(stderr, "%s: (%p) has invalid type %u\n", func, var, Z_TYPE_P(var)); 36 | } 37 | 38 | if (!Z_REFCOUNTED_P(var)) { 39 | fprintf(stderr, "%s: (%p) is not reference-counted, type=%d\n", func, var, Z_TYPE_P(var)); 40 | return; 41 | } 42 | 43 | if (Z_REFCOUNT_P(var) == 0) { 44 | fprintf(stderr, "%s: (%p) has 0 references, type=%d\n", func, var, Z_TYPE_P(var)); 45 | } else { 46 | if (Z_REFCOUNT_P(var) >= 1000000) { 47 | fprintf(stderr, "%s: (%p) has too many references (%u), type=%d\n", func, var, Z_REFCOUNT_P(var), Z_TYPE_P(var)); 48 | } 49 | } 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Queue Interoperability 2 | 3 | [![Latest Stable Version](https://poser.pugx.org/queue-interop/queue-interop/v/stable.png)](https://packagist.org/packages/queue-interop/queue-interop) 4 | [![Monthly Downloads](https://poser.pugx.org/queue-interop/queue-interop/d/monthly)](https://packagist.org/packages/queue-interop/queue-interop) 5 | [![Total Downloads](https://poser.pugx.org/queue-interop/queue-interop/d/total.png)](https://packagist.org/packages/queue-interop/queue-interop) 6 | [![License](https://poser.pugx.org/queue-interop/queue-interop/license)](https://packagist.org/packages/queue-interop/queue-interop) 7 | 8 | ## About 9 | 10 | This repository is used to build the extension for *queue-interop*, so that it can be loaded as a module on your web server. 11 | 12 | The extension has been written with [Zephir](https://zephir-lang.com). 13 | 14 | ## Installation (Linux/Mac) 15 | 16 | - PHP must be installed already in your system 17 | - Download the latest Zephir.phar from [this](https://github.com/phalcon/zephir/releases) page. 18 | - Clone this repository 19 | - Build the extension 20 | 21 | ```bash 22 | $ php -v 23 | PHP 7.2.17-0ubuntu0.18.04.1 (cli) (built: Apr 18 2019 14:12:38) ( NTS ) 24 | Copyright (c) 1997-2018 The PHP Group 25 | Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies 26 | with Zend OPcache v7.2.17-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies 27 | 28 | $ wget --no-clobber -O ./zephir https://github.com/phalcon/zephir/releases/download/0.11.12/zephir.phar 29 | $ chmod +x ./zephir 30 | $ git clone https://github.com/queue-interop/ext 31 | $ cd ext/ 32 | $ ../zephir fullclean 33 | $ ../zephir build 34 | ``` 35 | 36 | You will need to add `extension=queue.so` in your `php.ini` and restart your webserver. 37 | 38 | ### Sources 39 | 40 | The recommended installation method is using [Zephir](https://zephir-lang.com), but you can install the extension directly from the `ext/` folder. You will need the php development sources to be installed in your system as well as make tools (`automake`, `make` etc.) and `re2c`. 41 | 42 | ```bash 43 | $ git clone https://github.com/queue-interop/ext 44 | $ cd ext/ext/ 45 | $ ./install 46 | ``` 47 | 48 | ## License 49 | 50 | [MIT license](LICENSE) 51 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "stubs": { 3 | "path": "ide\/%version%\/%namespace%\/", 4 | "stubs-run-after-generate": false 5 | }, 6 | "api": { 7 | "path": "doc\/%version%", 8 | "theme": { 9 | "name": "zephir", 10 | "options": { 11 | "github": null, 12 | "analytics": null, 13 | "main_color": "#3E6496", 14 | "link_color": "#3E6496", 15 | "link_hover_color": "#5F9AE7" 16 | } 17 | } 18 | }, 19 | "warnings": { 20 | "unused-variable": true, 21 | "unused-variable-external": false, 22 | "possible-wrong-parameter": true, 23 | "possible-wrong-parameter-undefined": false, 24 | "nonexistent-function": true, 25 | "nonexistent-class": true, 26 | "non-valid-isset": true, 27 | "non-array-update": true, 28 | "non-valid-objectupdate": true, 29 | "non-valid-fetch": true, 30 | "invalid-array-index": true, 31 | "non-array-append": true, 32 | "invalid-return-type": true, 33 | "unreachable-code": true, 34 | "nonexistent-constant": true, 35 | "not-supported-magic-constant": true, 36 | "non-valid-decrement": true, 37 | "non-valid-increment": true, 38 | "non-valid-clone": true, 39 | "non-valid-new": true, 40 | "non-array-access": true, 41 | "invalid-reference": true, 42 | "invalid-typeof-comparison": true, 43 | "conditional-initialization": true 44 | }, 45 | "optimizations": { 46 | "static-type-inference": true, 47 | "static-type-inference-second-pass": true, 48 | "local-context-pass": true, 49 | "constant-folding": true, 50 | "static-constant-class-folding": true, 51 | "call-gatherer-pass": true, 52 | "check-invalid-reads": false, 53 | "internal-call-transformation": false 54 | }, 55 | "extra": { 56 | "indent": "spaces", 57 | "export-classes": false 58 | }, 59 | "namespace": "interop", 60 | "name": "interop", 61 | "description": "", 62 | "author": "", 63 | "version": "0.0.1", 64 | "verbose": false, 65 | "requires": { 66 | "extensions": [] 67 | } 68 | } -------------------------------------------------------------------------------- /ext/interop/queue/consumer.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_consumer_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Consumer); 5 | 6 | #if PHP_VERSION_ID >= 70200 7 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_consumer_getqueue, 0, 0, Interop\\Queue\\Queue, 0) 8 | #else 9 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_consumer_getqueue, 0, 0, IS_OBJECT, "Interop\\Queue\\Queue", 0) 10 | #endif 11 | ZEND_END_ARG_INFO() 12 | 13 | #if PHP_VERSION_ID >= 70200 14 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_consumer_receive, 0, 0, Interop\\Queue\\Message, 1) 15 | #else 16 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_consumer_receive, 0, 0, IS_OBJECT, "Interop\\Queue\\Message", 1) 17 | #endif 18 | #if PHP_VERSION_ID >= 70200 19 | ZEND_ARG_TYPE_INFO(0, timeout, IS_LONG, 0) 20 | #else 21 | ZEND_ARG_INFO(0, timeout) 22 | #endif 23 | ZEND_END_ARG_INFO() 24 | 25 | #if PHP_VERSION_ID >= 70200 26 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_consumer_receivenowait, 0, 0, Interop\\Queue\\Message, 1) 27 | #else 28 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_consumer_receivenowait, 0, 0, IS_OBJECT, "Interop\\Queue\\Message", 1) 29 | #endif 30 | ZEND_END_ARG_INFO() 31 | 32 | ZEND_BEGIN_ARG_INFO_EX(arginfo_interop_queue_consumer_acknowledge, 0, 0, 1) 33 | ZEND_ARG_OBJ_INFO(0, message, Interop\\Queue\\Message, 0) 34 | ZEND_END_ARG_INFO() 35 | 36 | ZEND_BEGIN_ARG_INFO_EX(arginfo_interop_queue_consumer_reject, 0, 0, 1) 37 | ZEND_ARG_OBJ_INFO(0, message, Interop\\Queue\\Message, 0) 38 | #if PHP_VERSION_ID >= 70200 39 | ZEND_ARG_TYPE_INFO(0, requeue, _IS_BOOL, 0) 40 | #else 41 | ZEND_ARG_INFO(0, requeue) 42 | #endif 43 | ZEND_END_ARG_INFO() 44 | 45 | ZEPHIR_INIT_FUNCS(interop_queue_consumer_method_entry) { 46 | PHP_ABSTRACT_ME(Interop_Queue_Consumer, getQueue, arginfo_interop_queue_consumer_getqueue) 47 | PHP_ABSTRACT_ME(Interop_Queue_Consumer, receive, arginfo_interop_queue_consumer_receive) 48 | PHP_ABSTRACT_ME(Interop_Queue_Consumer, receiveNoWait, arginfo_interop_queue_consumer_receivenowait) 49 | PHP_ABSTRACT_ME(Interop_Queue_Consumer, acknowledge, arginfo_interop_queue_consumer_acknowledge) 50 | PHP_ABSTRACT_ME(Interop_Queue_Consumer, reject, arginfo_interop_queue_consumer_reject) 51 | PHP_FE_END 52 | }; 53 | -------------------------------------------------------------------------------- /ext/config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Whether to build interop as dynamic module */ 4 | #undef COMPILE_DL_INTEROP 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_DLFCN_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_EXT_JSON_PHP_JSON_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_EXT_PCRE_PHP_PCRE_H 14 | 15 | /* Whether you have Interop */ 16 | #undef HAVE_INTEROP 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_INTTYPES_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_MEMORY_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STDINT_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_STDLIB_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_STRINGS_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_STRING_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_SYS_STAT_H 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #undef HAVE_SYS_TYPES_H 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_UNISTD_H 44 | 45 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ 46 | #undef NO_MINUS_C_MINUS_O 47 | 48 | /* Define to the address where bug reports for this package should be sent. */ 49 | #undef PACKAGE_BUGREPORT 50 | 51 | /* Define to the full name of this package. */ 52 | #undef PACKAGE_NAME 53 | 54 | /* Define to the full name and version of this package. */ 55 | #undef PACKAGE_STRING 56 | 57 | /* Define to the one symbol short name of this package. */ 58 | #undef PACKAGE_TARNAME 59 | 60 | /* Define to the home page for this package. */ 61 | #undef PACKAGE_URL 62 | 63 | /* Define to the version of this package. */ 64 | #undef PACKAGE_VERSION 65 | 66 | /* Define to 1 if you have the ANSI C header files. */ 67 | #undef STDC_HEADERS 68 | 69 | /* Whether PHP json extension is present at compile time */ 70 | #undef ZEPHIR_USE_PHP_JSON 71 | 72 | /* Whether PHP pcre extension is present at compile time */ 73 | #undef ZEPHIR_USE_PHP_PCRE 74 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/invalidmessageexception.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../../php_ext.h" 8 | #include "../../../ext.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "kernel/main.h" 15 | #include "kernel/object.h" 16 | #include "kernel/memory.h" 17 | #include "kernel/exception.h" 18 | #include "kernel/fcall.h" 19 | #include "kernel/concat.h" 20 | #include "kernel/operators.h" 21 | 22 | 23 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_InvalidMessageException) { 24 | 25 | ZEPHIR_REGISTER_CLASS_EX(Interop\\Queue\\Exception, InvalidMessageException, interop, queue_exception_invalidmessageexception, interop_queue_exception_exception_ce, interop_queue_exception_invalidmessageexception_method_entry, 0); 26 | 27 | return SUCCESS; 28 | 29 | } 30 | 31 | /** 32 | * @param Message $message 33 | * @param string $class 34 | * 35 | * @throws static 36 | */ 37 | PHP_METHOD(Interop_Queue_Exception_InvalidMessageException, assertMessageInstanceOf) { 38 | 39 | zend_long ZEPHIR_LAST_CALL_STATUS; 40 | zval className; 41 | zval *message, message_sub, *className_param = NULL, name, _0$$3, _1$$3; 42 | zval *this_ptr = getThis(); 43 | 44 | ZVAL_UNDEF(&message_sub); 45 | ZVAL_UNDEF(&name); 46 | ZVAL_UNDEF(&_0$$3); 47 | ZVAL_UNDEF(&_1$$3); 48 | ZVAL_UNDEF(&className); 49 | 50 | ZEPHIR_MM_GROW(); 51 | zephir_fetch_params(1, 2, 0, &message, &className_param); 52 | 53 | zephir_get_strval(&className, className_param); 54 | 55 | 56 | if (!(zephir_is_instance_of(message, Z_STRVAL_P(&className), Z_STRLEN_P(&className) TSRMLS_CC))) { 57 | ZEPHIR_INIT_VAR(&name); 58 | zephir_get_class(&name, message, 0 TSRMLS_CC); 59 | ZEPHIR_INIT_VAR(&_0$$3); 60 | object_init_ex(&_0$$3, interop_queue_exception_invalidmessageexception_ce); 61 | ZEPHIR_INIT_VAR(&_1$$3); 62 | ZEPHIR_CONCAT_SVSVS(&_1$$3, "The message must be an instance of ", &className, " but it is ", &name, "."); 63 | ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 1, &_1$$3); 64 | zephir_check_call_status(); 65 | zephir_throw_exception_debug(&_0$$3, "interop/queue/exception/invalidmessageexception.zep", 21 TSRMLS_CC); 66 | ZEPHIR_MM_RESTORE(); 67 | return; 68 | } 69 | ZEPHIR_MM_RESTORE(); 70 | 71 | } 72 | 73 | -------------------------------------------------------------------------------- /ext/config.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated from config.h.in by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Whether to build interop as dynamic module */ 5 | #define COMPILE_DL_INTEROP 1 6 | 7 | /* Define to 1 if you have the header file. */ 8 | #define HAVE_DLFCN_H 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | /* #undef HAVE_EXT_JSON_PHP_JSON_H */ 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_EXT_PCRE_PHP_PCRE_H 1 15 | 16 | /* Whether you have Interop */ 17 | #define HAVE_INTEROP 1 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #define HAVE_INTTYPES_H 1 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_MEMORY_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #define HAVE_STDINT_H 1 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STDLIB_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_STRINGS_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_STRING_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | #define HAVE_SYS_STAT_H 1 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #define HAVE_SYS_TYPES_H 1 42 | 43 | /* Define to 1 if you have the header file. */ 44 | #define HAVE_UNISTD_H 1 45 | 46 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ 47 | /* #undef NO_MINUS_C_MINUS_O */ 48 | 49 | /* Define to the address where bug reports for this package should be sent. */ 50 | #define PACKAGE_BUGREPORT "" 51 | 52 | /* Define to the full name of this package. */ 53 | #define PACKAGE_NAME "" 54 | 55 | /* Define to the full name and version of this package. */ 56 | #define PACKAGE_STRING "" 57 | 58 | /* Define to the one symbol short name of this package. */ 59 | #define PACKAGE_TARNAME "" 60 | 61 | /* Define to the home page for this package. */ 62 | #define PACKAGE_URL "" 63 | 64 | /* Define to the version of this package. */ 65 | #define PACKAGE_VERSION "" 66 | 67 | /* Define to 1 if you have the ANSI C header files. */ 68 | #define STDC_HEADERS 1 69 | 70 | /* Whether PHP json extension is present at compile time */ 71 | /* #undef ZEPHIR_USE_PHP_JSON */ 72 | 73 | /* Whether PHP pcre extension is present at compile time */ 74 | #define ZEPHIR_USE_PHP_PCRE 1 75 | -------------------------------------------------------------------------------- /ext/build/mkdep.awk: -------------------------------------------------------------------------------- 1 | # +----------------------------------------------------------------------+ 2 | # | PHP Version 7 | 3 | # +----------------------------------------------------------------------+ 4 | # | Copyright (c) 2000-2006 The PHP Group | 5 | # +----------------------------------------------------------------------+ 6 | # | This source file is subject to version 3.01 of the PHP license, | 7 | # | that is bundled with this package in the file LICENSE, and is | 8 | # | available through the world-wide-web at the following url: | 9 | # | http://www.php.net/license/3_01.txt | 10 | # | If you did not receive a copy of the PHP license and are unable to | 11 | # | obtain it through the world-wide-web, please send a note to | 12 | # | license@php.net so we can mail you a copy immediately. | 13 | # +----------------------------------------------------------------------+ 14 | # | Author: Sascha Schumann | 15 | # +----------------------------------------------------------------------+ 16 | # 17 | # $Id$ 18 | # 19 | # Usage: 20 | # 21 | # echo top_srcdir top_builddir srcdir CPP [CPP-ARGS] filenames | \ 22 | # awk -f mkdep.awk > dependencies 23 | 24 | 25 | { 26 | top_srcdir=$1 27 | top_builddir=$2 28 | srcdir=$3 29 | cmd=$4 30 | 31 | for (i = 5; i <= NF; i++) { 32 | if (match($i, "^-[A-Z]") == 0) 33 | break; 34 | cmd=cmd " " $i 35 | } 36 | 37 | dif=i-1 38 | 39 | for (; i <= NF; i++) 40 | filenames[i-dif]=$i 41 | 42 | no_files=NF-dif 43 | 44 | for(i = 1; i <= no_files; i++) { 45 | if (system("test -r " filenames[i]) != 0) 46 | continue 47 | 48 | target=filenames[i] 49 | sub(srcdir "/", "", target) 50 | target2=target 51 | sub("\.(c|cpp)$", ".lo", target); 52 | sub("\.(c|cpp)$", ".slo", target2); 53 | 54 | for (e in used) 55 | delete used[e] 56 | 57 | cmdx=cmd " " filenames[i] 58 | done=0 59 | while ((cmdx | getline) > 0) { 60 | if (match($0, "^# [0-9]* \".*\.h\"") != 0) { 61 | if (sub(top_srcdir, "$(top_srcdir)", $3) == 0) 62 | sub(top_builddir, "$(top_builddir)", $3) 63 | if (substr($3,2,1) != "/" && used[$3] != 1) { 64 | if (done == 0) 65 | printf(target " " target2 ":") 66 | done=1 67 | printf(" \\\n\t" substr($3,2,length($3)-2)) 68 | used[$3] = 1; 69 | } 70 | } 71 | } 72 | if (done == 1) 73 | print "\n" 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /ext/kernel/backtrace.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | | Vladimir Kolesnikov | 18 | +------------------------------------------------------------------------+ 19 | */ 20 | 21 | #ifndef ZEPHIR_RELEASE 22 | #if defined(linux) || defined(DARWIN) || defined(__APPLE__) 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | /** 30 | * A buffer for backtrace. It is better to have it allocated statically 31 | * in order not to face out of memory conditions later 32 | */ 33 | void *backtrace_buf[4096]; 34 | 35 | void zephir_print_backtrace(void) 36 | { 37 | int i; 38 | int stack_size = backtrace(backtrace_buf, sizeof(backtrace_buf) / sizeof(void*)); 39 | char **stack_symbols = backtrace_symbols(backtrace_buf, stack_size); 40 | char buf[50]; 41 | smart_str s = {0}; 42 | 43 | for (i = 0; i < stack_size; ++i) { 44 | snprintf(buf, sizeof(buf), "#%d %p [", i, backtrace_buf[i]); 45 | smart_str_appends(&s, buf); 46 | smart_str_appends(&s, stack_symbols[i]); 47 | smart_str_appends(&s, "]\n"); 48 | } 49 | 50 | smart_str_0(&s); 51 | 52 | fprintf(stderr, "%s\n", ZSTR_VAL(s.s)); 53 | smart_str_free(&s); 54 | } 55 | 56 | #else 57 | 58 | void zephir_print_backtrace(void) 59 | { 60 | /** 61 | * Not implemented yet for anything other than Linux 62 | */ 63 | } 64 | 65 | #endif 66 | #endif /* ZEPHIR_RELEASE */ 67 | -------------------------------------------------------------------------------- /ext/interop/queue/exception/invaliddestinationexception.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../../php_ext.h" 8 | #include "../../../ext.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "kernel/main.h" 15 | #include "kernel/object.h" 16 | #include "kernel/memory.h" 17 | #include "kernel/exception.h" 18 | #include "kernel/fcall.h" 19 | #include "kernel/concat.h" 20 | #include "kernel/operators.h" 21 | 22 | 23 | ZEPHIR_INIT_CLASS(Interop_Queue_Exception_InvalidDestinationException) { 24 | 25 | ZEPHIR_REGISTER_CLASS_EX(Interop\\Queue\\Exception, InvalidDestinationException, interop, queue_exception_invaliddestinationexception, interop_queue_exception_exception_ce, interop_queue_exception_invaliddestinationexception_method_entry, 0); 26 | 27 | return SUCCESS; 28 | 29 | } 30 | 31 | /** 32 | * @param mixed $destination 33 | * @param string $class 34 | * 35 | * @throws static 36 | */ 37 | PHP_METHOD(Interop_Queue_Exception_InvalidDestinationException, assertDestinationInstanceOf) { 38 | 39 | zend_long ZEPHIR_LAST_CALL_STATUS; 40 | zval className; 41 | zval *destination, destination_sub, *className_param = NULL, name, _0$$5, _1$$5; 42 | zval *this_ptr = getThis(); 43 | 44 | ZVAL_UNDEF(&destination_sub); 45 | ZVAL_UNDEF(&name); 46 | ZVAL_UNDEF(&_0$$5); 47 | ZVAL_UNDEF(&_1$$5); 48 | ZVAL_UNDEF(&className); 49 | 50 | ZEPHIR_MM_GROW(); 51 | zephir_fetch_params(1, 2, 0, &destination, &className_param); 52 | 53 | zephir_get_strval(&className, className_param); 54 | 55 | 56 | if (Z_TYPE_P(destination) == IS_OBJECT) { 57 | ZEPHIR_INIT_VAR(&name); 58 | zephir_get_class(&name, destination, 0 TSRMLS_CC); 59 | } else { 60 | ZEPHIR_INIT_NVAR(&name); 61 | zephir_gettype(&name, destination TSRMLS_CC); 62 | } 63 | if (!(zephir_is_instance_of(destination, Z_STRVAL_P(&className), Z_STRLEN_P(&className) TSRMLS_CC))) { 64 | ZEPHIR_INIT_VAR(&_0$$5); 65 | object_init_ex(&_0$$5, interop_queue_exception_invaliddestinationexception_ce); 66 | ZEPHIR_INIT_VAR(&_1$$5); 67 | ZEPHIR_CONCAT_SVSVS(&_1$$5, "The destination must be an instance of ", &className, " but got ", &name, "."); 68 | ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 1, &_1$$5); 69 | zephir_check_call_status(); 70 | zephir_throw_exception_debug(&_0$$5, "interop/queue/exception/invaliddestinationexception.zep", 25 TSRMLS_CC); 71 | ZEPHIR_MM_RESTORE(); 72 | return; 73 | } 74 | ZEPHIR_MM_RESTORE(); 75 | 76 | } 77 | 78 | -------------------------------------------------------------------------------- /ext/kernel/variables.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | | Rack Lin | 18 | +------------------------------------------------------------------------+ 19 | */ 20 | 21 | #ifdef HAVE_CONFIG_H 22 | #include "config.h" 23 | #endif 24 | 25 | #include "php.h" 26 | #include "php_ext.h" 27 | 28 | #include "ext/standard/php_smart_string.h" 29 | #include "ext/standard/php_var.h" 30 | 31 | static zend_always_inline void zephir_smart_str_0(smart_str *str) 32 | { 33 | if (str->s) { 34 | ZSTR_VAL(str->s)[ZSTR_LEN(str->s)] = '\0'; 35 | } 36 | } 37 | 38 | /** 39 | * var_dump outputs php variables without using the PHP userland 40 | */ 41 | void zephir_var_dump(zval *var) 42 | { 43 | php_var_dump(var, 1); 44 | } 45 | 46 | /** 47 | * var_export outputs php variables without using the PHP userland 48 | */ 49 | void zephir_var_export(zval *var) 50 | { 51 | php_var_export(var, 1); 52 | } 53 | 54 | /** 55 | * var_export returns php variables without using the PHP userland 56 | */ 57 | void zephir_var_export_ex(zval *return_value, zval *var) 58 | { 59 | smart_str buf = { 0 }; 60 | 61 | php_var_export_ex(var, 1, &buf); 62 | zephir_smart_str_0(&buf); 63 | ZVAL_STR(return_value, buf.s); 64 | } 65 | 66 | void zephir_get_defined_vars(zval *return_value) 67 | { 68 | zend_array *symtable = zend_rebuild_symbol_table(); 69 | if (EXPECTED(symtable != NULL)) { 70 | RETURN_ARR(zend_array_dup(symtable)); 71 | } 72 | 73 | RETURN_NULL(); 74 | } 75 | -------------------------------------------------------------------------------- /ext/config.m4: -------------------------------------------------------------------------------- 1 | PHP_ARG_ENABLE(interop, whether to enable interop, [ --enable-interop Enable Interop]) 2 | 3 | if test "$PHP_INTEROP" = "yes"; then 4 | 5 | 6 | 7 | if ! test "x" = "x"; then 8 | PHP_EVAL_LIBLINE(, INTEROP_SHARED_LIBADD) 9 | fi 10 | 11 | AC_DEFINE(HAVE_INTEROP, 1, [Whether you have Interop]) 12 | interop_sources="interop.c kernel/main.c kernel/memory.c kernel/exception.c kernel/debug.c kernel/backtrace.c kernel/object.c kernel/array.c kernel/string.c kernel/fcall.c kernel/require.c kernel/file.c kernel/operators.c kernel/math.c kernel/concat.c kernel/variables.c kernel/filter.c kernel/iterator.c kernel/time.c kernel/exit.c interop/queue/exception.zep.c 13 | interop/queue/exception/exception.zep.c 14 | interop/queue/destination.zep.c 15 | interop/queue/connectionfactory.zep.c 16 | interop/queue/consumer.zep.c 17 | interop/queue/context.zep.c 18 | interop/queue/exception/deliverydelaynotsupportedexception.zep.c 19 | interop/queue/exception/invaliddestinationexception.zep.c 20 | interop/queue/exception/invalidmessageexception.zep.c 21 | interop/queue/exception/prioritynotsupportedexception.zep.c 22 | interop/queue/exception/purgequeuenotsupportedexception.zep.c 23 | interop/queue/exception/subscriptionconsumernotsupportedexception.zep.c 24 | interop/queue/exception/temporaryqueuenotsupportedexception.zep.c 25 | interop/queue/exception/timetolivenotsupportedexception.zep.c 26 | interop/queue/message.zep.c 27 | interop/queue/processor.zep.c 28 | interop/queue/producer.zep.c 29 | interop/queue/queue.zep.c 30 | interop/queue/subscriptionconsumer.zep.c 31 | interop/queue/topic.zep.c " 32 | PHP_NEW_EXTENSION(interop, $interop_sources, $ext_shared,, ) 33 | PHP_SUBST(INTEROP_SHARED_LIBADD) 34 | 35 | old_CPPFLAGS=$CPPFLAGS 36 | CPPFLAGS="$CPPFLAGS $INCLUDES" 37 | 38 | AC_CHECK_DECL( 39 | [HAVE_BUNDLED_PCRE], 40 | [ 41 | AC_CHECK_HEADERS( 42 | [ext/pcre/php_pcre.h], 43 | [ 44 | PHP_ADD_EXTENSION_DEP([interop], [pcre]) 45 | AC_DEFINE([ZEPHIR_USE_PHP_PCRE], [1], [Whether PHP pcre extension is present at compile time]) 46 | ], 47 | , 48 | [[#include "main/php.h"]] 49 | ) 50 | ], 51 | , 52 | [[#include "php_config.h"]] 53 | ) 54 | 55 | AC_CHECK_DECL( 56 | [HAVE_JSON], 57 | [ 58 | AC_CHECK_HEADERS( 59 | [ext/json/php_json.h], 60 | [ 61 | PHP_ADD_EXTENSION_DEP([interop], [json]) 62 | AC_DEFINE([ZEPHIR_USE_PHP_JSON], [1], [Whether PHP json extension is present at compile time]) 63 | ], 64 | , 65 | [[#include "main/php.h"]] 66 | ) 67 | ], 68 | , 69 | [[#include "php_config.h"]] 70 | ) 71 | 72 | CPPFLAGS=$old_CPPFLAGS 73 | 74 | PHP_INSTALL_HEADERS([ext/interop], [php_INTEROP.h]) 75 | 76 | fi 77 | -------------------------------------------------------------------------------- /ext/kernel/require.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Zephir. 3 | * 4 | * (c) Zephir Team 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. If you did not receive 8 | * a copy of the license it is available through the world-wide-web at the 9 | * following url: https://docs.zephir-lang.com/en/latest/license 10 | */ 11 | 12 | #ifdef HAVE_CONFIG_H 13 | #include "config.h" 14 | #endif 15 | 16 | #include "php.h" 17 | #include "php_ext.h" 18 | #include "kernel/require.h" 19 | #include "kernel/backtrace.h" 20 | 21 | #include
22 | #include 23 | 24 | #ifndef ENFORCE_SAFE_MODE 25 | #define ENFORCE_SAFE_MODE 0 26 | #endif 27 | 28 | /** 29 | * Do an internal require to a plain php file taking care of the value returned by the file 30 | */ 31 | int zephir_require_ret(zval *return_value_ptr, const char *require_path) 32 | { 33 | zend_file_handle file_handle; 34 | zend_op_array *new_op_array; 35 | zval dummy, local_retval; 36 | int ret; 37 | 38 | ZVAL_UNDEF(&local_retval); 39 | 40 | #ifndef ZEPHIR_RELEASE 41 | if (return_value_ptr != NULL && Z_TYPE_P(return_value_ptr) > IS_NULL) { 42 | fprintf(stderr, "%s: *return_value_ptr is expected to be NULL", __func__); 43 | zephir_print_backtrace(); 44 | abort(); 45 | } 46 | #endif 47 | 48 | file_handle.filename = require_path; 49 | file_handle.free_filename = 0; 50 | file_handle.type = ZEND_HANDLE_FILENAME; 51 | file_handle.opened_path = NULL; 52 | file_handle.handle.fp = NULL; 53 | 54 | new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE); 55 | if (new_op_array) { 56 | 57 | if (file_handle.handle.stream.handle) { 58 | ZVAL_NULL(&dummy); 59 | if (!file_handle.opened_path) { 60 | file_handle.opened_path = zend_string_init(require_path, strlen(require_path), 0); 61 | } 62 | 63 | zend_hash_add(&EG(included_files), file_handle.opened_path, &dummy); 64 | zend_destroy_file_handle(&file_handle); 65 | } 66 | 67 | #if PHP_VERSION_ID >= 70100 68 | new_op_array->scope = EG(fake_scope) ? EG(fake_scope) : zend_get_executed_scope(); 69 | #else 70 | new_op_array->scope = EG(scope); 71 | #endif 72 | zend_execute(new_op_array, &local_retval); 73 | 74 | if (return_value_ptr) { 75 | zval_ptr_dtor(return_value_ptr); 76 | ZVAL_COPY_VALUE(return_value_ptr, &local_retval); 77 | } else { 78 | zval_ptr_dtor(&local_retval); 79 | } 80 | 81 | destroy_op_array(new_op_array); 82 | efree_size(new_op_array, sizeof(zend_op_array)); 83 | 84 | if (EG(exception)) { 85 | ret = FAILURE; 86 | } else { 87 | ret = SUCCESS; 88 | } 89 | 90 | return ret; 91 | } else { 92 | zend_destroy_file_handle(&file_handle); 93 | } 94 | 95 | return FAILURE; 96 | } 97 | -------------------------------------------------------------------------------- /ext/kernel/debug.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | +------------------------------------------------------------------------+ 18 | */ 19 | 20 | #ifndef ZEPHIR_KERNEL_DEBUG_H 21 | #define ZEPHIR_KERNEL_DEBUG_H 22 | 23 | #ifndef ZEPHIR_RELEASE 24 | 25 | #include 26 | 27 | void zephir_vdump(zval *var, const char *func); 28 | 29 | #define PHV(v) zephir_vdump(zval *var, const char *func) 30 | #define PHPR(v) zephir_print_r(v) 31 | 32 | typedef struct _zephir_debug_entry { 33 | struct _zephir_debug_entry *prev; 34 | struct _zephir_debug_entry *next; 35 | char *class_name; 36 | char *method_name; 37 | int lineno; 38 | } zephir_debug_entry; 39 | 40 | /** The zval's reference count dump */ 41 | #define RC_DUMP(zv) \ 42 | do { \ 43 | char *_n = (strrchr((#zv), '&') ? strrchr((#zv), '&') + 1 : (#zv)); \ 44 | char *_f = (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__); \ 45 | zval *_z = (zv); \ 46 | if (Z_REFCOUNTED_P(_z)) { \ 47 | fprintf(stderr, "[DUMP]: %s:%d %s (%p) refcount=%d, type=%d\n", _f, __LINE__, _n, _z, Z_REFCOUNT_P(_z), Z_TYPE_P(_z)); \ 48 | } else { \ 49 | fprintf(stderr, "[DUMP]: %s:%d %s (%p) is not reference-counted, type=%d\n", _f, __LINE__, _n, _z, Z_TYPE_P(_z)); \ 50 | } \ 51 | } while (0) 52 | 53 | 54 | #else 55 | 56 | #define RC_DUMP(zv) 57 | 58 | #endif /* ZEPHIR_RELEASE */ 59 | #endif /* ZEPHIR_KERNEL_DEBUG_H */ 60 | -------------------------------------------------------------------------------- /ext/kernel/exception.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | | Vladimir Kolesnikov | 18 | +------------------------------------------------------------------------+ 19 | */ 20 | 21 | #ifndef ZEPHIR_KERNEL_EXCEPTIONS_H 22 | #define ZEPHIR_KERNEL_EXCEPTIONS_H 23 | 24 | #include 25 | #include "kernel/main.h" 26 | 27 | /** Exceptions */ 28 | #define ZEPHIR_THROW_EXCEPTION_STR(class_entry, message) \ 29 | do { \ 30 | zephir_throw_exception_string(class_entry, message, strlen(message)); \ 31 | ZEPHIR_MM_RESTORE(); \ 32 | } while (0) 33 | 34 | #define ZEPHIR_THROW_EXCEPTION_DEBUG_STR(class_entry, message, file, line) \ 35 | do { \ 36 | zephir_throw_exception_string_debug(class_entry, message, strlen(message), file, line); \ 37 | ZEPHIR_MM_RESTORE(); \ 38 | } while (0) 39 | 40 | #define ZEPHIR_THROW_EXCEPTION_ZVAL(class_entry, message) \ 41 | do { \ 42 | zephir_throw_exception_zval(class_entry, message); \ 43 | ZEPHIR_MM_RESTORE(); \ 44 | } while (0) 45 | 46 | #define ZEPHIR_THROW_EXCEPTION_DEBUG_ZVAL(class_entry, message, file, line) \ 47 | do { \ 48 | zephir_throw_exception_zval(class_entry, message, file, line); \ 49 | ZEPHIR_MM_RESTORE(); \ 50 | } while (0) 51 | 52 | 53 | #define ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(class_entry, message, file, line) zephir_throw_exception_string_debug(class_entry, message, strlen(message), file, line) 54 | #define ZEPHIR_THROW_EXCEPTION_STRW(class_entry, message) zephir_throw_exception_string(class_entry, message, strlen(message)) 55 | #define ZEPHIR_THROW_EXCEPTION_ZVALW(class_entry, message) zephir_throw_exception_zval(class_entry, message) 56 | #define ZEPHIR_THROW_EXCEPTION_DEBUG_ZVALW(class_entry, message, file, line) zephir_throw_exception_zval_debug(class_entry, message, file, line) 57 | 58 | /** Throw Exceptions */ 59 | void zephir_throw_exception_string(zend_class_entry *ce, const char *message, zend_uint message_len); 60 | void zephir_throw_exception_debug(zval *object, const char *file, zend_uint line); 61 | void zephir_throw_exception_format(zend_class_entry *ce, const char *format, ...); 62 | void zephir_throw_exception_string_debug(zend_class_entry *ce, const char *message, zend_uint message_len, const char *file, zend_uint line); 63 | 64 | #endif /* ZEPHIR_KERNEL_EXCEPTIONS_H */ 65 | -------------------------------------------------------------------------------- /ext/interop/queue/producer.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_producer_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Producer); 5 | 6 | ZEND_BEGIN_ARG_INFO_EX(arginfo_interop_queue_producer_send, 0, 0, 2) 7 | ZEND_ARG_OBJ_INFO(0, destination, Interop\\Queue\\Destination, 0) 8 | ZEND_ARG_OBJ_INFO(0, message, Interop\\Queue\\Message, 0) 9 | ZEND_END_ARG_INFO() 10 | 11 | #if PHP_VERSION_ID >= 70200 12 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_producer_setdeliverydelay, 0, 0, Interop\\Queue\\Producer, 0) 13 | #else 14 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_producer_setdeliverydelay, 0, 0, IS_OBJECT, "Interop\\Queue\\Producer", 0) 15 | #endif 16 | #if PHP_VERSION_ID >= 70200 17 | ZEND_ARG_TYPE_INFO(0, deliveryDelay, IS_LONG, 1) 18 | #else 19 | ZEND_ARG_INFO(0, deliveryDelay) 20 | #endif 21 | ZEND_END_ARG_INFO() 22 | 23 | #if PHP_VERSION_ID >= 70200 24 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_producer_getdeliverydelay, 0, 0, IS_LONG, 1) 25 | #else 26 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_producer_getdeliverydelay, 0, 0, IS_LONG, NULL, 1) 27 | #endif 28 | ZEND_END_ARG_INFO() 29 | 30 | #if PHP_VERSION_ID >= 70200 31 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_producer_setpriority, 0, 0, Interop\\Queue\\Producer, 0) 32 | #else 33 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_producer_setpriority, 0, 0, IS_OBJECT, "Interop\\Queue\\Producer", 0) 34 | #endif 35 | #if PHP_VERSION_ID >= 70200 36 | ZEND_ARG_TYPE_INFO(0, priority, IS_LONG, 1) 37 | #else 38 | ZEND_ARG_INFO(0, priority) 39 | #endif 40 | ZEND_END_ARG_INFO() 41 | 42 | #if PHP_VERSION_ID >= 70200 43 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_producer_getpriority, 0, 0, IS_LONG, 1) 44 | #else 45 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_producer_getpriority, 0, 0, IS_LONG, NULL, 1) 46 | #endif 47 | ZEND_END_ARG_INFO() 48 | 49 | #if PHP_VERSION_ID >= 70200 50 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_producer_settimetolive, 0, 0, Interop\\Queue\\Producer, 0) 51 | #else 52 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_producer_settimetolive, 0, 0, IS_OBJECT, "Interop\\Queue\\Producer", 0) 53 | #endif 54 | #if PHP_VERSION_ID >= 70200 55 | ZEND_ARG_TYPE_INFO(0, timeToLive, IS_LONG, 1) 56 | #else 57 | ZEND_ARG_INFO(0, timeToLive) 58 | #endif 59 | ZEND_END_ARG_INFO() 60 | 61 | #if PHP_VERSION_ID >= 70200 62 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_producer_gettimetolive, 0, 0, IS_LONG, 1) 63 | #else 64 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_producer_gettimetolive, 0, 0, IS_LONG, NULL, 1) 65 | #endif 66 | ZEND_END_ARG_INFO() 67 | 68 | ZEPHIR_INIT_FUNCS(interop_queue_producer_method_entry) { 69 | PHP_ABSTRACT_ME(Interop_Queue_Producer, send, arginfo_interop_queue_producer_send) 70 | PHP_ABSTRACT_ME(Interop_Queue_Producer, setDeliveryDelay, arginfo_interop_queue_producer_setdeliverydelay) 71 | PHP_ABSTRACT_ME(Interop_Queue_Producer, getDeliveryDelay, arginfo_interop_queue_producer_getdeliverydelay) 72 | PHP_ABSTRACT_ME(Interop_Queue_Producer, setPriority, arginfo_interop_queue_producer_setpriority) 73 | PHP_ABSTRACT_ME(Interop_Queue_Producer, getPriority, arginfo_interop_queue_producer_getpriority) 74 | PHP_ABSTRACT_ME(Interop_Queue_Producer, setTimeToLive, arginfo_interop_queue_producer_settimetolive) 75 | PHP_ABSTRACT_ME(Interop_Queue_Producer, getTimeToLive, arginfo_interop_queue_producer_gettimetolive) 76 | PHP_FE_END 77 | }; 78 | -------------------------------------------------------------------------------- /ext/autom4te.cache/requests: -------------------------------------------------------------------------------- 1 | # This file was generated. 2 | # It contains the lists of macros which have been traced. 3 | # It can be safely removed. 4 | 5 | @request = ( 6 | bless( [ 7 | '0', 8 | 1, 9 | [ 10 | '/data/share/autoconf' 11 | ], 12 | [ 13 | '/data/share/autoconf/autoconf/autoconf.m4f', 14 | 'aclocal.m4', 15 | 'configure.ac' 16 | ], 17 | { 18 | 'AC_CANONICAL_TARGET' => 1, 19 | 'AC_CANONICAL_BUILD' => 1, 20 | '_AM_SUBST_NOTMAKE' => 1, 21 | 'AC_CONFIG_FILES' => 1, 22 | 'AC_FC_PP_SRCEXT' => 1, 23 | 'AC_SUBST_TRACE' => 1, 24 | '_AM_MAKEFILE_INCLUDE' => 1, 25 | 'AM_GNU_GETTEXT' => 1, 26 | 'AM_POT_TOOLS' => 1, 27 | 'AC_CONFIG_SUBDIRS' => 1, 28 | 'AM_MAKEFILE_INCLUDE' => 1, 29 | 'AM_MAINTAINER_MODE' => 1, 30 | 'AC_DEFINE_TRACE_LITERAL' => 1, 31 | 'AM_XGETTEXT_OPTION' => 1, 32 | 'AH_OUTPUT' => 1, 33 | 'LT_CONFIG_LTDL_DIR' => 1, 34 | 'AC_INIT' => 1, 35 | '_AM_COND_ELSE' => 1, 36 | 'AC_CONFIG_HEADERS' => 1, 37 | 'AC_REQUIRE_AUX_FILE' => 1, 38 | 'AM_PROG_CC_C_O' => 1, 39 | 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, 40 | 'AC_SUBST' => 1, 41 | 'm4_pattern_forbid' => 1, 42 | 'AM_ENABLE_MULTILIB' => 1, 43 | 'AC_PROG_LIBTOOL' => 1, 44 | 'sinclude' => 1, 45 | 'AC_CONFIG_LIBOBJ_DIR' => 1, 46 | 'AC_CONFIG_LINKS' => 1, 47 | 'LT_INIT' => 1, 48 | 'm4_include' => 1, 49 | 'm4_sinclude' => 1, 50 | 'AM_PROG_AR' => 1, 51 | 'AM_INIT_AUTOMAKE' => 1, 52 | 'AM_PROG_CXX_C_O' => 1, 53 | '_AM_COND_IF' => 1, 54 | 'AM_PATH_GUILE' => 1, 55 | '_m4_warn' => 1, 56 | '_LT_AC_TAGCONFIG' => 1, 57 | 'AC_LIBSOURCE' => 1, 58 | 'AM_CONDITIONAL' => 1, 59 | 'AM_PROG_F77_C_O' => 1, 60 | 'AC_FC_FREEFORM' => 1, 61 | 'LT_SUPPORTED_TAG' => 1, 62 | 'AC_FC_SRCEXT' => 1, 63 | 'AC_CONFIG_AUX_DIR' => 1, 64 | 'AC_CANONICAL_SYSTEM' => 1, 65 | 'AM_PROG_MOC' => 1, 66 | 'm4_pattern_allow' => 1, 67 | 'AM_SILENT_RULES' => 1, 68 | 'AM_NLS' => 1, 69 | 'AM_AUTOMAKE_VERSION' => 1, 70 | 'AM_PROG_FC_C_O' => 1, 71 | 'AC_CANONICAL_HOST' => 1, 72 | '_AM_COND_ENDIF' => 1, 73 | 'AC_FC_PP_DEFINE' => 1, 74 | 'include' => 1 75 | } 76 | ], 'Autom4te::Request' ) 77 | ); 78 | 79 | -------------------------------------------------------------------------------- /ext/build/ax_check_compile_flag.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Check whether the given FLAG works with the current language's compiler 12 | # or gives an error. (Warnings, however, are ignored) 13 | # 14 | # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on 15 | # success/failure. 16 | # 17 | # If EXTRA-FLAGS is defined, it is added to the current language's default 18 | # flags (e.g. CFLAGS) when the check is done. The check is thus made with 19 | # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to 20 | # force the compiler to issue an error when a bad flag is given. 21 | # 22 | # INPUT gives an alternative input source to AC_COMPILE_IFELSE. 23 | # 24 | # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this 25 | # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. 26 | # 27 | # LICENSE 28 | # 29 | # Copyright (c) 2008 Guido U. Draheim 30 | # Copyright (c) 2011 Maarten Bosmans 31 | # 32 | # This program is free software: you can redistribute it and/or modify it 33 | # under the terms of the GNU General Public License as published by the 34 | # Free Software Foundation, either version 3 of the License, or (at your 35 | # option) any later version. 36 | # 37 | # This program is distributed in the hope that it will be useful, but 38 | # WITHOUT ANY WARRANTY; without even the implied warranty of 39 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 40 | # Public License for more details. 41 | # 42 | # You should have received a copy of the GNU General Public License along 43 | # with this program. If not, see . 44 | # 45 | # As a special exception, the respective Autoconf Macro's copyright owner 46 | # gives unlimited permission to copy, distribute and modify the configure 47 | # scripts that are the output of Autoconf when processing the Macro. You 48 | # need not follow the terms of the GNU General Public License when using 49 | # or distributing such scripts, even though portions of the text of the 50 | # Macro appear in them. The GNU General Public License (GPL) does govern 51 | # all other use of the material that constitutes the Autoconf Macro. 52 | # 53 | # This special exception to the GPL applies to versions of the Autoconf 54 | # Macro released by the Autoconf Archive. When you make and distribute a 55 | # modified version of the Autoconf Macro, you may extend this special 56 | # exception to the GPL to apply to your modified version as well. 57 | 58 | #serial 4 59 | 60 | AC_DEFUN([AX_CHECK_COMPILE_FLAG], 61 | [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF 62 | AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl 63 | AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ 64 | ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS 65 | _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" 66 | AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], 67 | [AS_VAR_SET(CACHEVAR,[yes])], 68 | [AS_VAR_SET(CACHEVAR,[no])]) 69 | _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) 70 | AS_VAR_IF(CACHEVAR,yes, 71 | [m4_default([$2], :)], 72 | [m4_default([$3], :)]) 73 | AS_VAR_POPDEF([CACHEVAR])dnl 74 | ])dnl AX_CHECK_COMPILE_FLAGS 75 | -------------------------------------------------------------------------------- /ext/interop/queue/producer.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../php_ext.h" 8 | #include "../../ext.h" 9 | 10 | #include 11 | 12 | #include "kernel/main.h" 13 | 14 | 15 | ZEPHIR_INIT_CLASS(Interop_Queue_Producer) { 16 | 17 | ZEPHIR_REGISTER_INTERFACE(Interop\\Queue, Producer, interop, queue_producer, interop_queue_producer_method_entry); 18 | 19 | return SUCCESS; 20 | 21 | } 22 | 23 | /** 24 | * @throws Exception if the provider fails to send the message due to some internal error 25 | * @throws InvalidDestinationException if a client uses this method with an invalid destination 26 | * @throws InvalidMessageException if an invalid message is specified 27 | */ 28 | ZEPHIR_DOC_METHOD(Interop_Queue_Producer, send); 29 | 30 | /** 31 | * Sets the minimum length of time in milliseconds that must elapse after a message is sent before the provider may deliver the message to a consumer. 32 | * deliveryDelay is set to null default. 33 | * 34 | * The delivery delay is in milliseconds. Use null to unset delivery delay and use transport's mode 35 | * 36 | * @throws DeliveryDelayNotSupportedException if producer does not support delivery delay feature 37 | */ 38 | ZEPHIR_DOC_METHOD(Interop_Queue_Producer, setDeliveryDelay); 39 | 40 | /** 41 | * Gets the minimum length of time in milliseconds that must elapse after a message is sent before the provider may deliver the message to a consumer. 42 | * 43 | * @return int|null the delivery delay in milliseconds. 44 | */ 45 | ZEPHIR_DOC_METHOD(Interop_Queue_Producer, getDeliveryDelay); 46 | 47 | /** 48 | * Specifies the priority of messages that are sent using this Producer 49 | * The API defines ten levels of priority value, with 0 as the lowest priority and 9 as the highest. 50 | * Clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority. 51 | * Priority is set to null by default. 52 | * 53 | * Use null to unset priority and use transport's mode 54 | * 55 | * @throws PriorityNotSupportedException if producer does not support priority feature 56 | */ 57 | ZEPHIR_DOC_METHOD(Interop_Queue_Producer, setPriority); 58 | 59 | /** 60 | * Return the priority of messages that are sent using this Producer 61 | */ 62 | ZEPHIR_DOC_METHOD(Interop_Queue_Producer, getPriority); 63 | 64 | /** 65 | * Specifies the time to live of messages that are sent using this Producer. 66 | * This is used to determine the expiration time of a message. 67 | * The expiration time of a message is the sum of the message's time to live and the time it is sent. 68 | * Clients should not receive messages that have expired; however, This interop does not guarantee that this will not happen. 69 | * A provider should do its best to accurately expire messages; however, it does not define the accuracy provided. 70 | * It is not acceptable to simply ignore time-to-live. 71 | * timeToLive is set to null default. 72 | * 73 | * The message time to live to be used, in milliseconds; a value of zero means that a message never expires. Use null to unset time to live and use transport's mode 74 | * 75 | * @throws TimeToLiveNotSupportedException if producer does not support time to live feature 76 | */ 77 | ZEPHIR_DOC_METHOD(Interop_Queue_Producer, setTimeToLive); 78 | 79 | /** 80 | * Returns the time to live of messages that are sent using this JMSProducer. 81 | * 82 | * @return int|null the message time to live in milliseconds; a value of zero means that a message never expires. 83 | */ 84 | ZEPHIR_DOC_METHOD(Interop_Queue_Producer, getTimeToLive); 85 | 86 | -------------------------------------------------------------------------------- /interop/queue/producer.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue; 3 | 4 | use Interop\Queue\Exception\DeliveryDelayNotSupportedException; 5 | use Interop\Queue\Exception\InvalidDestinationException; 6 | use Interop\Queue\Exception\InvalidMessageException; 7 | use Interop\Queue\Exception\PriorityNotSupportedException; 8 | use Interop\Queue\Exception\TimeToLiveNotSupportedException; 9 | 10 | interface Producer 11 | { 12 | /** 13 | * @throws Exception if the provider fails to send the message due to some internal error 14 | * @throws InvalidDestinationException if a client uses this method with an invalid destination 15 | * @throws InvalidMessageException if an invalid message is specified 16 | */ 17 | public function send( destination, message) -> void; 18 | 19 | /** 20 | * Sets the minimum length of time in milliseconds that must elapse after a message is sent before the provider may deliver the message to a consumer. 21 | * deliveryDelay is set to null default. 22 | * 23 | * The delivery delay is in milliseconds. Use null to unset delivery delay and use transport's mode 24 | * 25 | * @throws DeliveryDelayNotSupportedException if producer does not support delivery delay feature 26 | */ 27 | public function setDeliveryDelay(int deliveryDelay = null) -> ; 28 | 29 | /** 30 | * Gets the minimum length of time in milliseconds that must elapse after a message is sent before the provider may deliver the message to a consumer. 31 | * 32 | * @return int|null the delivery delay in milliseconds. 33 | */ 34 | public function getDeliveryDelay() -> int | null; 35 | 36 | /** 37 | * Specifies the priority of messages that are sent using this Producer 38 | * The API defines ten levels of priority value, with 0 as the lowest priority and 9 as the highest. 39 | * Clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority. 40 | * Priority is set to null by default. 41 | * 42 | * Use null to unset priority and use transport's mode 43 | * 44 | * @throws PriorityNotSupportedException if producer does not support priority feature 45 | */ 46 | public function setPriority(int priority = null) -> ; 47 | 48 | /** 49 | * Return the priority of messages that are sent using this Producer 50 | */ 51 | public function getPriority() -> int | null; 52 | 53 | /** 54 | * Specifies the time to live of messages that are sent using this Producer. 55 | * This is used to determine the expiration time of a message. 56 | * The expiration time of a message is the sum of the message's time to live and the time it is sent. 57 | * Clients should not receive messages that have expired; however, This interop does not guarantee that this will not happen. 58 | * A provider should do its best to accurately expire messages; however, it does not define the accuracy provided. 59 | * It is not acceptable to simply ignore time-to-live. 60 | * timeToLive is set to null default. 61 | * 62 | * The message time to live to be used, in milliseconds; a value of zero means that a message never expires. Use null to unset time to live and use transport's mode 63 | * 64 | * @throws TimeToLiveNotSupportedException if producer does not support time to live feature 65 | */ 66 | public function setTimeToLive(int timeToLive = null) -> ; 67 | 68 | /** 69 | * Returns the time to live of messages that are sent using this JMSProducer. 70 | * 71 | * @return int|null the message time to live in milliseconds; a value of zero means that a message never expires. 72 | */ 73 | public function getTimeToLive() -> int | null; 74 | } -------------------------------------------------------------------------------- /ext/interop/queue/context.zep.h: -------------------------------------------------------------------------------- 1 | 2 | extern zend_class_entry *interop_queue_context_ce; 3 | 4 | ZEPHIR_INIT_CLASS(Interop_Queue_Context); 5 | 6 | #if PHP_VERSION_ID >= 70200 7 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_context_createmessage, 0, 0, Interop\\Queue\\Message, 0) 8 | #else 9 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_context_createmessage, 0, 0, IS_OBJECT, "Interop\\Queue\\Message", 0) 10 | #endif 11 | #if PHP_VERSION_ID >= 70200 12 | ZEND_ARG_TYPE_INFO(0, body, IS_STRING, 0) 13 | #else 14 | ZEND_ARG_INFO(0, body) 15 | #endif 16 | ZEND_ARG_ARRAY_INFO(0, properties, 0) 17 | ZEND_ARG_ARRAY_INFO(0, headers, 0) 18 | ZEND_END_ARG_INFO() 19 | 20 | #if PHP_VERSION_ID >= 70200 21 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_context_createtopic, 0, 1, Interop\\Queue\\Topic, 0) 22 | #else 23 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_context_createtopic, 0, 1, IS_OBJECT, "Interop\\Queue\\Topic", 0) 24 | #endif 25 | #if PHP_VERSION_ID >= 70200 26 | ZEND_ARG_TYPE_INFO(0, topicName, IS_STRING, 0) 27 | #else 28 | ZEND_ARG_INFO(0, topicName) 29 | #endif 30 | ZEND_END_ARG_INFO() 31 | 32 | #if PHP_VERSION_ID >= 70200 33 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_context_createqueue, 0, 1, Interop\\Queue\\Queue, 0) 34 | #else 35 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_context_createqueue, 0, 1, IS_OBJECT, "Interop\\Queue\\Queue", 0) 36 | #endif 37 | #if PHP_VERSION_ID >= 70200 38 | ZEND_ARG_TYPE_INFO(0, queueName, IS_STRING, 0) 39 | #else 40 | ZEND_ARG_INFO(0, queueName) 41 | #endif 42 | ZEND_END_ARG_INFO() 43 | 44 | #if PHP_VERSION_ID >= 70200 45 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_context_createtemporaryqueue, 0, 0, Interop\\Queue\\Queue, 0) 46 | #else 47 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_context_createtemporaryqueue, 0, 0, IS_OBJECT, "Interop\\Queue\\Queue", 0) 48 | #endif 49 | ZEND_END_ARG_INFO() 50 | 51 | #if PHP_VERSION_ID >= 70200 52 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_context_createproducer, 0, 0, Interop\\Queue\\Producer, 0) 53 | #else 54 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_context_createproducer, 0, 0, IS_OBJECT, "Interop\\Queue\\Producer", 0) 55 | #endif 56 | ZEND_END_ARG_INFO() 57 | 58 | #if PHP_VERSION_ID >= 70200 59 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_context_createconsumer, 0, 1, Interop\\Queue\\Consumer, 0) 60 | #else 61 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_context_createconsumer, 0, 1, IS_OBJECT, "Interop\\Queue\\Consumer", 0) 62 | #endif 63 | ZEND_ARG_OBJ_INFO(0, destination, Interop\\Queue\\Destination, 0) 64 | ZEND_END_ARG_INFO() 65 | 66 | #if PHP_VERSION_ID >= 70200 67 | ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_interop_queue_context_createsubscriptionconsumer, 0, 0, Interop\\Queue\\SubscriptionConsumer, 0) 68 | #else 69 | ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_interop_queue_context_createsubscriptionconsumer, 0, 0, IS_OBJECT, "Interop\\Queue\\SubscriptionConsumer", 0) 70 | #endif 71 | ZEND_END_ARG_INFO() 72 | 73 | ZEND_BEGIN_ARG_INFO_EX(arginfo_interop_queue_context_purgequeue, 0, 0, 1) 74 | ZEND_ARG_OBJ_INFO(0, queue, Interop\\Queue\\Queue, 0) 75 | ZEND_END_ARG_INFO() 76 | 77 | ZEPHIR_INIT_FUNCS(interop_queue_context_method_entry) { 78 | PHP_ABSTRACT_ME(Interop_Queue_Context, createMessage, arginfo_interop_queue_context_createmessage) 79 | PHP_ABSTRACT_ME(Interop_Queue_Context, createTopic, arginfo_interop_queue_context_createtopic) 80 | PHP_ABSTRACT_ME(Interop_Queue_Context, createQueue, arginfo_interop_queue_context_createqueue) 81 | PHP_ABSTRACT_ME(Interop_Queue_Context, createTemporaryQueue, arginfo_interop_queue_context_createtemporaryqueue) 82 | PHP_ABSTRACT_ME(Interop_Queue_Context, createProducer, arginfo_interop_queue_context_createproducer) 83 | PHP_ABSTRACT_ME(Interop_Queue_Context, createConsumer, arginfo_interop_queue_context_createconsumer) 84 | PHP_ABSTRACT_ME(Interop_Queue_Context, createSubscriptionConsumer, arginfo_interop_queue_context_createsubscriptionconsumer) 85 | PHP_ABSTRACT_ME(Interop_Queue_Context, purgeQueue, arginfo_interop_queue_context_purgequeue) 86 | PHP_ABSTRACT_ME(Interop_Queue_Context, close, NULL) 87 | PHP_FE_END 88 | }; 89 | -------------------------------------------------------------------------------- /ext/kernel/array.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | | Vladimir Kolesnikov | 18 | +------------------------------------------------------------------------+ 19 | */ 20 | 21 | #ifndef ZEPHIR_KERNEL_ARRAY_H 22 | #define ZEPHIR_KERNEL_ARRAY_H 23 | #define ZEPHIR_MAX_ARRAY_LEVELS 16 24 | 25 | #include 26 | #include 27 | #include "kernel/globals.h" 28 | #include "kernel/main.h" 29 | 30 | void ZEPHIR_FASTCALL zephir_create_array(zval *return_value, uint size, int initialize); 31 | 32 | /** 33 | * Simple convenience function which ensures that you are dealing with an array and you can 34 | * eliminate noise from your code. 35 | */ 36 | void ZEPHIR_FASTCALL zephir_ensure_array(zval *probable_array); 37 | 38 | /** Combined isset/fetch */ 39 | int zephir_array_isset_fetch(zval *fetched, const zval *arr, zval *index, int readonly); 40 | int zephir_array_isset_string_fetch(zval *fetched, const zval *arr, char *index, uint index_length, int readonly); 41 | int zephir_array_isset_long_fetch(zval *fetched, const zval *arr, unsigned long index, int readonly); 42 | 43 | /** Check for index existence */ 44 | int ZEPHIR_FASTCALL zephir_array_isset(const zval *arr, zval *index); 45 | int ZEPHIR_FASTCALL zephir_array_isset_long(const zval *arr, unsigned long index); 46 | int ZEPHIR_FASTCALL zephir_array_isset_string(const zval *arr, const char *index, uint index_length); 47 | 48 | /** Unset existing indexes */ 49 | int ZEPHIR_FASTCALL zephir_array_unset(zval *arr, zval *index, int flags); 50 | int ZEPHIR_FASTCALL zephir_array_unset_long(zval *arr, unsigned long index, int flags); 51 | int ZEPHIR_FASTCALL zephir_array_unset_string(zval *arr, const char *index, uint index_length, int flags); 52 | 53 | /** Fetch items from arrays */ 54 | int zephir_array_fetch(zval *return_value, zval *arr, zval *index, int flags ZEPHIR_DEBUG_PARAMS); 55 | int zephir_array_fetch_string(zval *return_value, zval *arr, const char *index, uint index_length, int flags ZEPHIR_DEBUG_PARAMS); 56 | int zephir_array_fetch_long(zval *return_value, zval *arr, unsigned long index, int flags ZEPHIR_DEBUG_PARAMS); 57 | 58 | /** Append elements to arrays */ 59 | int zephir_array_append(zval *arr, zval *value, int separate ZEPHIR_DEBUG_PARAMS); 60 | void zephir_merge_append(zval *left, zval *values); 61 | 62 | /** Modify array */ 63 | int zephir_array_update_zval(zval *arr, zval *index, zval *value, int flags); 64 | int zephir_array_update_string(zval *arr, const char *index, uint index_length, zval *value, int flags); 65 | int zephir_array_update_long(zval *arr, unsigned long index, zval *value, int flags ZEPHIR_DEBUG_PARAMS); 66 | 67 | void zephir_array_keys(zval *return_value, zval *arr); 68 | int zephir_array_key_exists(zval *arr, zval *key); 69 | 70 | /* Update array using multiple keys */ 71 | void zephir_array_update_multi_ex(zval *arr, zval *value, const char *types, int types_length, int types_count, va_list ap); 72 | int zephir_array_update_multi(zval *arr, zval *value, const char *types, int types_length, int types_count, ...); 73 | 74 | /** Fast Array Merge */ 75 | void zephir_fast_array_merge(zval *return_value, zval *array1, zval *array2); 76 | 77 | /* In Array */ 78 | int zephir_fast_in_array(zval *needle, zval *haystack); 79 | 80 | #define zephir_array_fast_append(arr, value) \ 81 | do { \ 82 | Z_TRY_ADDREF_P(value); \ 83 | zend_hash_next_index_insert(Z_ARRVAL_P(arr), value); \ 84 | } while (0) 85 | 86 | #endif /* ZEPHIR_KERNEL_ARRAY_H */ 87 | -------------------------------------------------------------------------------- /ext/kernel/globals.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | | Vladimir Kolesnikov | 18 | +------------------------------------------------------------------------+ 19 | */ 20 | 21 | #ifndef ZEPHIR_KERNEL_GLOBALS_H 22 | #define ZEPHIR_KERNEL_GLOBALS_H 23 | 24 | #include 25 | 26 | #define ZEPHIR_MAX_MEMORY_STACK 48 27 | #define ZEPHIR_MAX_CACHE_SLOTS 512 28 | 29 | /** Memory frame */ 30 | typedef struct _zephir_memory_entry { 31 | size_t pointer; 32 | size_t capacity; 33 | zval **addresses; 34 | size_t hash_pointer; 35 | size_t hash_capacity; 36 | zval **hash_addresses; 37 | struct _zephir_memory_entry *prev; 38 | struct _zephir_memory_entry *next; 39 | #ifndef ZEPHIR_RELEASE 40 | int permanent; 41 | const char *func; 42 | #endif 43 | } zephir_memory_entry; 44 | 45 | /** Virtual Symbol Table */ 46 | typedef struct _zephir_symbol_table { 47 | struct _zephir_memory_entry *scope; 48 | zend_array *symbol_table; 49 | struct _zephir_symbol_table *prev; 50 | } zephir_symbol_table; 51 | 52 | typedef struct _zephir_function_cache { 53 | zend_class_entry *ce; 54 | zend_function *func; 55 | } zephir_function_cache; 56 | 57 | typedef zend_function zephir_fcall_cache_entry; 58 | 59 | #define ZEPHIR_INIT_FUNCS(class_functions) static const zend_function_entry class_functions[] = 60 | 61 | /** Define FASTCALL */ 62 | #if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__) 63 | # define ZEPHIR_FASTCALL __attribute__((fastcall)) 64 | #elif defined(_MSC_VER) && defined(_M_IX86) 65 | # define ZEPHIR_FASTCALL __fastcall 66 | #else 67 | # define ZEPHIR_FASTCALL 68 | #endif 69 | 70 | #define ZEPHIR_INIT_CLASS(name) \ 71 | int zephir_ ##name## _init(INIT_FUNC_ARGS) 72 | 73 | #define ZEPHIR_INIT(name) \ 74 | if (zephir_ ##name## _init(INIT_FUNC_ARGS_PASSTHRU) == FAILURE) { \ 75 | return FAILURE; \ 76 | } 77 | 78 | #if defined(__GNUC__) && (defined(__clang__) || ((__GNUC__ * 100 + __GNUC_MINOR__) >= 405)) 79 | # define UNREACHABLE() __builtin_unreachable() 80 | # define ASSUME(x) if (x) {} else __builtin_unreachable() 81 | #else 82 | # define UNREACHABLE() assert(0) 83 | # define ASSUME(x) assert(!!(x)); 84 | #endif 85 | 86 | #if defined(__GNUC__) || defined(__clang__) 87 | # define ZEPHIR_ATTR_NONNULL __attribute__((nonnull)) 88 | # define ZEPHIR_ATTR_NONNULL1(x) __attribute__((nonnull (x))) 89 | # define ZEPHIR_ATTR_NONNULL2(x, y) __attribute__((nonnull (x, y))) 90 | # define ZEPHIR_ATTR_NONNULL3(x, y, z) __attribute__((nonnull (x, y, z))) 91 | # define ZEPHIR_ATTR_PURE __attribute__((pure)) 92 | # define ZEPHIR_ATTR_CONST __attribute__((const)) 93 | # define ZEPHIR_ATTR_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 94 | #else 95 | # define ZEPHIR_ATTR_NONNULL 96 | # define ZEPHIR_ATTR_NONNULL1(x) 97 | # define ZEPHIR_ATTR_NONNULL2(x, y) 98 | # define ZEPHIR_ATTR_NONNULL3(x, y, z) 99 | # define ZEPHIR_ATTR_PURE 100 | # define ZEPHIR_ATTR_CONST 101 | # define ZEPHIR_ATTR_WARN_UNUSED_RESULT 102 | #endif 103 | 104 | #if !defined(__GNUC__) && !(defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) 105 | # define __builtin_constant_p(s) (0) 106 | #endif 107 | 108 | #ifndef __func__ 109 | # define __func__ __FUNCTION__ 110 | #endif 111 | 112 | #if defined(__GNUC__) 113 | # define ZEPHIR_NO_OPT __attribute__((optimize("O0"))) 114 | #else 115 | # define ZEPHIR_NO_OPT 116 | #endif 117 | 118 | #define likely(x) EXPECTED(x) 119 | #define unlikely(x) UNEXPECTED(x) 120 | 121 | #endif 122 | -------------------------------------------------------------------------------- /ext/kernel/string.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | | Vladimir Kolesnikov | 18 | +------------------------------------------------------------------------+ 19 | */ 20 | 21 | #ifndef ZEPHIR_KERNEL_STRING_H 22 | #define ZEPHIR_KERNEL_STRING_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include "kernel/main.h" 28 | 29 | #define ZEPHIR_TRIM_LEFT 1 30 | #define ZEPHIR_TRIM_RIGHT 2 31 | #define ZEPHIR_TRIM_BOTH 3 32 | #define ZEPHIR_SUBSTR_NO_LENGTH 1 33 | 34 | /** Fast char position */ 35 | int zephir_memnstr(const zval *haystack, const zval *needle ZEPHIR_DEBUG_PARAMS); 36 | int zephir_memnstr_str(const zval *haystack, char *needle, unsigned int needle_length ZEPHIR_DEBUG_PARAMS); 37 | 38 | int zephir_fast_strlen_ev(zval *str); 39 | void zephir_fast_strtolower(zval *return_value, zval *str); 40 | void zephir_fast_strtoupper(zval *return_value, zval *str); 41 | void zephir_fast_join(zval *result, zval *glue, zval *pieces); 42 | void zephir_fast_join_str(zval *result, char *glue, unsigned int glue_length, zval *pieces); 43 | void zephir_fast_explode(zval *result, zval *delimiter, zval *str, long limit); 44 | void zephir_fast_explode_str(zval *result, const char *delimiter, int delimiter_length, zval *str, long limit); 45 | void zephir_fast_strpos(zval *return_value, const zval *haystack, const zval *needle, unsigned int offset); 46 | void zephir_fast_strpos_str(zval *return_value, const zval *haystack, char *needle, unsigned int needle_length); 47 | void zephir_fast_trim(zval *return_value, zval *str, zval *charlist, int where); 48 | void zephir_fast_str_replace(zval *return_value, zval *search, zval *replace, zval *subject); 49 | 50 | void zephir_camelize(zval *return_value, const zval *str, const zval *delimiter); 51 | void zephir_uncamelize(zval *return_value, const zval *str, const zval *delimiter); 52 | 53 | /** Starts/Ends with */ 54 | int zephir_start_with(const zval *str, const zval *compared, zval *case_sensitive); 55 | int zephir_start_with_str(const zval *str, char *compared, unsigned int compared_length); 56 | int zephir_start_with_str_str(char *str, unsigned int str_length, char *compared, unsigned int compared_length); 57 | 58 | int zephir_end_with(const zval *str, const zval *compared, zval *case_sensitive); 59 | int zephir_end_with_str(const zval *str, char *compared, unsigned int compared_length); 60 | 61 | /** spprintf */ 62 | int zephir_spprintf(char **message, int max_len, char *format, ...); 63 | 64 | /** JSON */ 65 | int zephir_json_encode(zval *return_value, zval *v, int opts); 66 | int zephir_json_decode(zval *return_value, zval *v, zend_bool assoc); 67 | 68 | /* Substr */ 69 | void zephir_substr(zval *return_value, zval *str, long from, long length, int flags); 70 | 71 | /** Preg-Match */ 72 | void zephir_preg_match(zval *return_value, zval *regex, zval *subject, zval *matches, int global, long flags, long offset); 73 | 74 | /** Hash */ 75 | void zephir_md5(zval *return_value, zval *str); 76 | void zephir_crc32(zval *return_value, zval *str); 77 | 78 | /** */ 79 | void zephir_ucfirst(zval *return_value, zval *s); 80 | void zephir_addslashes(zval *return_value, zval *str); 81 | void zephir_stripslashes(zval *return_value, zval *str); 82 | void zephir_stripcslashes(zval *return_value, zval *str); 83 | void zephir_unique_key(zval *return_value, const zval *prefix, zval *value); 84 | 85 | void zephir_append_printable_array(smart_str *implstr, const zval *value); 86 | 87 | int zephir_hash_equals(const zval *known_zval, const zval *user_zval); 88 | 89 | void zephir_string_to_hex(zval *return_value, zval *var); 90 | 91 | #endif /* ZEPHIR_KERNEL_STRING_H */ 92 | -------------------------------------------------------------------------------- /interop/queue/message.zep: -------------------------------------------------------------------------------- 1 | 2 | namespace Interop\Queue; 3 | 4 | /** 5 | * The Message interface is the root interface of all transport messages. 6 | * Most message-oriented middleware (MOM) products 7 | * treat messages as lightweight entities that consist of a header and a payload. 8 | * The header contains fields used for message routing and identification; 9 | * the payload contains the application data being sent. 10 | * 11 | * Within this general form, the definition of a message varies significantly across products. 12 | * 13 | * @see https://docs.oracle.com/javaee/7/api/javax/jms/Message.html 14 | */ 15 | interface Message 16 | { 17 | public function getBody() -> string; 18 | 19 | public function setBody(string body) -> void; 20 | 21 | public function setProperties(array properties) -> void; 22 | 23 | /** 24 | * Returns [name => value, ...] 25 | */ 26 | public function getProperties() -> array; 27 | 28 | public function setProperty(string name, var value) -> void; 29 | 30 | public function getProperty(string name, var defaultValue = null) -> var; 31 | 32 | public function setHeaders(array headers) -> void; 33 | 34 | /** 35 | * Returns [name => value, ...] 36 | */ 37 | public function getHeaders() -> array; 38 | 39 | public function setHeader(string name, var value) -> void; 40 | 41 | public function getHeader(string name, var defaultValue = null) -> var; 42 | 43 | public function setRedelivered(bool redelivered) -> void; 44 | 45 | /** 46 | * Gets an indication of whether this message is being redelivered. 47 | * The message is considered as redelivered, 48 | * when it was sent by a broker to consumer but consumer does not ACK or REJECT it. 49 | * The broker brings the message back to the queue and mark it as redelivered. 50 | */ 51 | public function isRedelivered() -> bool; 52 | 53 | /** 54 | * Sets the correlation ID for the message. 55 | * A client can use the correlation header field to link one message with another. 56 | * A typical use is to link a response message with its request message. 57 | */ 58 | public function setCorrelationId(string correlationId = null) -> void; 59 | 60 | /** 61 | * Gets the correlation ID for the message. 62 | * This method is used to return correlation ID values that are either provider-specific message IDs 63 | * or application-specific String values. 64 | */ 65 | public function getCorrelationId() -> string | null; 66 | 67 | /** 68 | * Sets the message ID. 69 | * Providers set this field when a message is sent. 70 | * This method can be used to change the value for a message that has been received. 71 | */ 72 | public function setMessageId(string messageId = null) -> void; 73 | 74 | /** 75 | * Gets the message Id. 76 | * The MessageId header field contains a value that uniquely identifies each message sent by a provider. 77 | * 78 | * When a message is sent, MessageId can be ignored. 79 | */ 80 | public function getMessageId() -> string | null; 81 | 82 | /** 83 | * Gets the message timestamp. 84 | * The timestamp header field contains the time a message was handed off to a provider to be sent. 85 | * It is not the time the message was actually transmitted, 86 | * because the actual send may occur later due to transactions or other client-side queueing of messages. 87 | */ 88 | public function getTimestamp() -> int | null; 89 | 90 | /** 91 | * Sets the message timestamp. 92 | * Providers set this field when a message is sent. 93 | * This method can be used to change the value for a message that has been received. 94 | */ 95 | public function setTimestamp(int timestamp = null) -> void; 96 | 97 | /** 98 | * Sets the destination to which a reply to this message should be sent. 99 | * The ReplyTo header field contains the destination where a reply to the current message should be sent. If it is null, no reply is expected. 100 | * The destination may be a Queue only. A topic is not supported at the moment. 101 | * Messages sent with a null ReplyTo value may be a notification of some event, or they may just be some data the sender thinks is of interest. 102 | * Messages with a ReplyTo value typically expect a response. 103 | * A response is optional; it is up to the client to decide. These messages are called requests. 104 | * A message sent in response to a request is called a reply. 105 | * In some cases a client may wish to match a request it sent earlier with a reply it has just received. 106 | * The client can use the CorrelationID header field for this purpose. 107 | 108 | */ 109 | public function setReplyTo(string replyTo = null) -> void; 110 | 111 | /** 112 | * Gets the destination to which a reply to this message should be sent. 113 | */ 114 | public function getReplyTo() -> string | null; 115 | } -------------------------------------------------------------------------------- /ext/interop/queue/message.zep.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef HAVE_CONFIG_H 3 | #include "../../ext_config.h" 4 | #endif 5 | 6 | #include 7 | #include "../../php_ext.h" 8 | #include "../../ext.h" 9 | 10 | #include 11 | 12 | #include "kernel/main.h" 13 | 14 | 15 | /** 16 | * The Message interface is the root interface of all transport messages. 17 | * Most message-oriented middleware (MOM) products 18 | * treat messages as lightweight entities that consist of a header and a payload. 19 | * The header contains fields used for message routing and identification; 20 | * the payload contains the application data being sent. 21 | * 22 | * Within this general form, the definition of a message varies significantly across products. 23 | * 24 | * @see https://docs.oracle.com/javaee/7/api/javax/jms/Message.html 25 | */ 26 | ZEPHIR_INIT_CLASS(Interop_Queue_Message) { 27 | 28 | ZEPHIR_REGISTER_INTERFACE(Interop\\Queue, Message, interop, queue_message, interop_queue_message_method_entry); 29 | 30 | return SUCCESS; 31 | 32 | } 33 | 34 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, getBody); 35 | 36 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, setBody); 37 | 38 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, setProperties); 39 | 40 | /** 41 | * Returns [name => value, ...] 42 | */ 43 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, getProperties); 44 | 45 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, setProperty); 46 | 47 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, getProperty); 48 | 49 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, setHeaders); 50 | 51 | /** 52 | * Returns [name => value, ...] 53 | */ 54 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, getHeaders); 55 | 56 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, setHeader); 57 | 58 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, getHeader); 59 | 60 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, setRedelivered); 61 | 62 | /** 63 | * Gets an indication of whether this message is being redelivered. 64 | * The message is considered as redelivered, 65 | * when it was sent by a broker to consumer but consumer does not ACK or REJECT it. 66 | * The broker brings the message back to the queue and mark it as redelivered. 67 | */ 68 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, isRedelivered); 69 | 70 | /** 71 | * Sets the correlation ID for the message. 72 | * A client can use the correlation header field to link one message with another. 73 | * A typical use is to link a response message with its request message. 74 | */ 75 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, setCorrelationId); 76 | 77 | /** 78 | * Gets the correlation ID for the message. 79 | * This method is used to return correlation ID values that are either provider-specific message IDs 80 | * or application-specific String values. 81 | */ 82 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, getCorrelationId); 83 | 84 | /** 85 | * Sets the message ID. 86 | * Providers set this field when a message is sent. 87 | * This method can be used to change the value for a message that has been received. 88 | */ 89 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, setMessageId); 90 | 91 | /** 92 | * Gets the message Id. 93 | * The MessageId header field contains a value that uniquely identifies each message sent by a provider. 94 | * 95 | * When a message is sent, MessageId can be ignored. 96 | */ 97 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, getMessageId); 98 | 99 | /** 100 | * Gets the message timestamp. 101 | * The timestamp header field contains the time a message was handed off to a provider to be sent. 102 | * It is not the time the message was actually transmitted, 103 | * because the actual send may occur later due to transactions or other client-side queueing of messages. 104 | */ 105 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, getTimestamp); 106 | 107 | /** 108 | * Sets the message timestamp. 109 | * Providers set this field when a message is sent. 110 | * This method can be used to change the value for a message that has been received. 111 | */ 112 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, setTimestamp); 113 | 114 | /** 115 | * Sets the destination to which a reply to this message should be sent. 116 | * The ReplyTo header field contains the destination where a reply to the current message should be sent. If it is null, no reply is expected. 117 | * The destination may be a Queue only. A topic is not supported at the moment. 118 | * Messages sent with a null ReplyTo value may be a notification of some event, or they may just be some data the sender thinks is of interest. 119 | * Messages with a ReplyTo value typically expect a response. 120 | * A response is optional; it is up to the client to decide. These messages are called requests. 121 | * A message sent in response to a request is called a reply. 122 | * In some cases a client may wish to match a request it sent earlier with a reply it has just received. 123 | * The client can use the CorrelationID header field for this purpose. 124 | 125 | */ 126 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, setReplyTo); 127 | 128 | /** 129 | * Gets the destination to which a reply to this message should be sent. 130 | */ 131 | ZEPHIR_DOC_METHOD(Interop_Queue_Message, getReplyTo); 132 | 133 | -------------------------------------------------------------------------------- /ext/kernel/exception.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | +------------------------------------------------------------------------+ 4 | | Zephir Language | 5 | +------------------------------------------------------------------------+ 6 | | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | 7 | +------------------------------------------------------------------------+ 8 | | This source file is subject to the New BSD License that is bundled | 9 | | with this package in the file docs/LICENSE.txt. | 10 | | | 11 | | If you did not receive a copy of the license and are unable to | 12 | | obtain it through the world-wide-web, please send an email | 13 | | to license@zephir-lang.com so we can send you a copy immediately. | 14 | +------------------------------------------------------------------------+ 15 | | Authors: Andres Gutierrez | 16 | | Eduar Carvajal | 17 | | Vladimir Kolesnikov | 18 | +------------------------------------------------------------------------+ 19 | */ 20 | 21 | #ifdef HAVE_CONFIG_H 22 | #include "config.h" 23 | #endif 24 | 25 | #include "php.h" 26 | #include "php_ext.h" 27 | #include "php_main.h" 28 | #include "ext/standard/php_string.h" 29 | 30 | #include "kernel/main.h" 31 | #include "kernel/memory.h" 32 | #include "kernel/fcall.h" 33 | #include "kernel/operators.h" 34 | 35 | #include "Zend/zend_exceptions.h" 36 | 37 | /** 38 | * Throws a zval object as exception 39 | */ 40 | void zephir_throw_exception_debug(zval *object, const char *file, zend_uint line) 41 | { 42 | zend_class_entry *default_exception_ce; 43 | int ZEPHIR_LAST_CALL_STATUS = 0; 44 | zval curline; 45 | zval object_copy; 46 | 47 | ZVAL_UNDEF(&curline); 48 | 49 | ZEPHIR_MM_GROW(); 50 | 51 | if (Z_TYPE_P(object) != IS_OBJECT) { 52 | ZVAL_COPY_VALUE(&object_copy, object); 53 | object_init_ex(object, zend_exception_get_default()); 54 | ZEPHIR_CALL_METHOD(NULL, object, "__construct", NULL, 0, &object_copy); 55 | zval_ptr_dtor(&object_copy); 56 | } 57 | 58 | Z_ADDREF_P(object); 59 | 60 | if (line > 0) { 61 | ZEPHIR_CALL_METHOD(&curline, object, "getline", NULL, 0); 62 | zephir_check_call_status(); 63 | if (ZEPHIR_IS_LONG(&curline, 0)) { 64 | default_exception_ce = zend_exception_get_default(); 65 | zend_update_property_string(default_exception_ce, object, SL("file"), file); 66 | zend_update_property_long(default_exception_ce, object, SL("line"), line); 67 | } 68 | } 69 | 70 | if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { 71 | zend_throw_exception_object(object); 72 | } 73 | ZEPHIR_MM_RESTORE(); 74 | } 75 | 76 | /** 77 | * Throws an exception with a single string parameter + debug info 78 | */ 79 | void zephir_throw_exception_string_debug(zend_class_entry *ce, const char *message, zend_uint message_len, const char *file, zend_uint line) 80 | { 81 | zval object, msg; 82 | int ZEPHIR_LAST_CALL_STATUS = 0; 83 | zend_class_entry *default_exception_ce; 84 | 85 | object_init_ex(&object, ce); 86 | 87 | ZVAL_STRINGL(&msg, message, message_len); 88 | 89 | ZEPHIR_CALL_METHOD(NULL, &object, "__construct", NULL, 0, &msg); 90 | 91 | if (line > 0) { 92 | default_exception_ce = zend_exception_get_default(); 93 | zend_update_property_string(default_exception_ce, &object, "file", sizeof("file")-1, file); 94 | zend_update_property_long(default_exception_ce, &object, "line", sizeof("line")-1, line); 95 | } 96 | 97 | if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { 98 | zend_throw_exception_object(&object); 99 | } 100 | 101 | zval_ptr_dtor(&msg); 102 | } 103 | 104 | /** 105 | * Throws an exception with a single string parameter 106 | */ 107 | void zephir_throw_exception_string(zend_class_entry *ce, const char *message, zend_uint message_len) 108 | { 109 | zval object, msg; 110 | int ZEPHIR_LAST_CALL_STATUS = 0; 111 | 112 | object_init_ex(&object, ce); 113 | 114 | ZVAL_STRINGL(&msg, message, message_len); 115 | 116 | ZEPHIR_CALL_METHOD(NULL, &object, "__construct", NULL, 0, &msg); 117 | 118 | if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { 119 | zend_throw_exception_object(&object); 120 | } 121 | 122 | zval_ptr_dtor(&msg); 123 | } 124 | 125 | /** 126 | * Throws an exception with a string format as parameter 127 | */ 128 | void zephir_throw_exception_format(zend_class_entry *ce, const char *format, ...) 129 | { 130 | zval object, msg; 131 | int ZEPHIR_LAST_CALL_STATUS = 0, len; 132 | char *buffer; 133 | va_list args; 134 | 135 | object_init_ex(&object, ce); 136 | 137 | va_start(args, format); 138 | len = vspprintf(&buffer, 0, format, args); 139 | va_end(args); 140 | 141 | ZVAL_STRINGL(&msg, buffer, len); 142 | efree(buffer); 143 | 144 | ZEPHIR_CALL_METHOD(NULL, &object, "__construct", NULL, 0, &msg); 145 | 146 | if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { 147 | zend_throw_exception_object(&object); 148 | } 149 | 150 | zval_ptr_dtor(&msg); 151 | } 152 | --------------------------------------------------------------------------------