ESL.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <?php
  2. /* ----------------------------------------------------------------------------
  3. * This file was automatically generated by SWIG (http://www.swig.org).
  4. * Version 3.0.12
  5. *
  6. * This file is not intended to be easily readable and contains a number of
  7. * coding conventions designed to improve portability and efficiency. Do not make
  8. * changes to this file unless you know what you are doing--modify the SWIG
  9. * interface file instead.
  10. * ----------------------------------------------------------------------------- */
  11. // Try to load our extension if it's not already loaded.
  12. if (!extension_loaded('ESL')) {
  13. if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
  14. if (!dl('php_ESL.dll')) return;
  15. } else {
  16. // PHP_SHLIB_SUFFIX gives 'dylib' on MacOS X but modules are 'so'.
  17. if (PHP_SHLIB_SUFFIX === 'dylib') {
  18. if (!dl('ESL.so')) return;
  19. } else {
  20. if (!dl('ESL.'.PHP_SHLIB_SUFFIX)) return;
  21. }
  22. }
  23. }
  24. abstract class ESL {
  25. static function eslSetLogLevel($level) {
  26. eslSetLogLevel($level);
  27. }
  28. }
  29. /* PHP Proxy Classes */
  30. class ESLevent {
  31. public $_cPtr=null;
  32. protected $_pData=array();
  33. function __set($var,$value) {
  34. $func = 'ESLevent_'.$var.'_set';
  35. if (function_exists($func)) return call_user_func($func,$this->_cPtr,$value);
  36. if ($var === 'thisown') return swig_ESL_alter_newobject($this->_cPtr,$value);
  37. $this->_pData[$var] = $value;
  38. }
  39. function __get($var) {
  40. $func = 'ESLevent_'.$var.'_get';
  41. if (function_exists($func)) return call_user_func($func,$this->_cPtr);
  42. if ($var === 'thisown') return swig_ESL_get_newobject($this->_cPtr);
  43. return $this->_pData[$var];
  44. }
  45. function __isset($var) {
  46. if (function_exists('ESLevent_'.$var.'_get')) return true;
  47. if ($var === 'thisown') return true;
  48. return array_key_exists($var, $this->_pData);
  49. }
  50. function __construct($type_or_wrap_me_or_me,$subclass_name_or_free_me=null) {
  51. if (is_resource($type_or_wrap_me_or_me) && get_resource_type($type_or_wrap_me_or_me) === '_p_ESLevent') {
  52. $this->_cPtr=$type_or_wrap_me_or_me;
  53. return;
  54. }
  55. switch (func_num_args()) {
  56. case 1: $this->_cPtr=new_ESLevent($type_or_wrap_me_or_me); break;
  57. default: $this->_cPtr=new_ESLevent($type_or_wrap_me_or_me,$subclass_name_or_free_me);
  58. }
  59. }
  60. function serialize($format=null) {
  61. switch (func_num_args()) {
  62. case 0: $r=ESLevent_serialize($this->_cPtr); break;
  63. default: $r=ESLevent_serialize($this->_cPtr,$format);
  64. }
  65. return $r;
  66. }
  67. function setPriority($priority=null) {
  68. switch (func_num_args()) {
  69. case 0: $r=ESLevent_setPriority($this->_cPtr); break;
  70. default: $r=ESLevent_setPriority($this->_cPtr,$priority);
  71. }
  72. return $r;
  73. }
  74. function getHeader($header_name,$idx=-1) {
  75. return ESLevent_getHeader($this->_cPtr,$header_name,$idx);
  76. }
  77. function getBody() {
  78. return ESLevent_getBody($this->_cPtr);
  79. }
  80. function getType() {
  81. return ESLevent_getType($this->_cPtr);
  82. }
  83. function addBody($value) {
  84. return ESLevent_addBody($this->_cPtr,$value);
  85. }
  86. function addHeader($header_name,$value) {
  87. return ESLevent_addHeader($this->_cPtr,$header_name,$value);
  88. }
  89. function pushHeader($header_name,$value) {
  90. return ESLevent_pushHeader($this->_cPtr,$header_name,$value);
  91. }
  92. function unshiftHeader($header_name,$value) {
  93. return ESLevent_unshiftHeader($this->_cPtr,$header_name,$value);
  94. }
  95. function delHeader($header_name) {
  96. return ESLevent_delHeader($this->_cPtr,$header_name);
  97. }
  98. function firstHeader() {
  99. return ESLevent_firstHeader($this->_cPtr);
  100. }
  101. function nextHeader() {
  102. return ESLevent_nextHeader($this->_cPtr);
  103. }
  104. }
  105. class ESLconnection {
  106. public $_cPtr=null;
  107. protected $_pData=array();
  108. function __set($var,$value) {
  109. if ($var === 'thisown') return swig_ESL_alter_newobject($this->_cPtr,$value);
  110. $this->_pData[$var] = $value;
  111. }
  112. function __get($var) {
  113. if ($var === 'thisown') return swig_ESL_get_newobject($this->_cPtr);
  114. return $this->_pData[$var];
  115. }
  116. function __isset($var) {
  117. if ($var === 'thisown') return true;
  118. return array_key_exists($var, $this->_pData);
  119. }
  120. function __construct($host_or_socket,$port=null,$user_or_password=null,$password=null) {
  121. if (is_resource($host_or_socket) && get_resource_type($host_or_socket) === '_p_ESLconnection') {
  122. $this->_cPtr=$host_or_socket;
  123. return;
  124. }
  125. switch (func_num_args()) {
  126. case 1: $this->_cPtr=new_ESLconnection($host_or_socket); break;
  127. case 2: $this->_cPtr=new_ESLconnection($host_or_socket,$port); break;
  128. case 3: $this->_cPtr=new_ESLconnection($host_or_socket,$port,$user_or_password); break;
  129. default: $this->_cPtr=new_ESLconnection($host_or_socket,$port,$user_or_password,$password);
  130. }
  131. }
  132. function socketDescriptor() {
  133. return ESLconnection_socketDescriptor($this->_cPtr);
  134. }
  135. function connected() {
  136. return ESLconnection_connected($this->_cPtr);
  137. }
  138. function getInfo() {
  139. $r=ESLconnection_getInfo($this->_cPtr);
  140. if (is_resource($r)) {
  141. $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
  142. if (class_exists($c)) return new $c($r);
  143. return new ESLevent($r);
  144. }
  145. return $r;
  146. }
  147. function send($cmd) {
  148. return ESLconnection_send($this->_cPtr,$cmd);
  149. }
  150. function sendRecv($cmd) {
  151. $r=ESLconnection_sendRecv($this->_cPtr,$cmd);
  152. if (is_resource($r)) {
  153. $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
  154. if (class_exists($c)) return new $c($r);
  155. return new ESLevent($r);
  156. }
  157. return $r;
  158. }
  159. function api($cmd,$arg=null) {
  160. switch (func_num_args()) {
  161. case 1: $r=ESLconnection_api($this->_cPtr,$cmd); break;
  162. default: $r=ESLconnection_api($this->_cPtr,$cmd,$arg);
  163. }
  164. if (is_resource($r)) {
  165. $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
  166. if (class_exists($c)) return new $c($r);
  167. return new ESLevent($r);
  168. }
  169. return $r;
  170. }
  171. function bgapi($cmd,$arg=null,$job_uuid=null) {
  172. switch (func_num_args()) {
  173. case 1: $r=ESLconnection_bgapi($this->_cPtr,$cmd); break;
  174. case 2: $r=ESLconnection_bgapi($this->_cPtr,$cmd,$arg); break;
  175. default: $r=ESLconnection_bgapi($this->_cPtr,$cmd,$arg,$job_uuid);
  176. }
  177. if (is_resource($r)) {
  178. $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
  179. if (class_exists($c)) return new $c($r);
  180. return new ESLevent($r);
  181. }
  182. return $r;
  183. }
  184. function sendEvent($send_me) {
  185. $r=ESLconnection_sendEvent($this->_cPtr,$send_me);
  186. if (is_resource($r)) {
  187. $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
  188. if (class_exists($c)) return new $c($r);
  189. return new ESLevent($r);
  190. }
  191. return $r;
  192. }
  193. function sendMSG($send_me,$uuid=null) {
  194. switch (func_num_args()) {
  195. case 1: $r=ESLconnection_sendMSG($this->_cPtr,$send_me); break;
  196. default: $r=ESLconnection_sendMSG($this->_cPtr,$send_me,$uuid);
  197. }
  198. return $r;
  199. }
  200. function recvEvent() {
  201. $r=ESLconnection_recvEvent($this->_cPtr);
  202. if (is_resource($r)) {
  203. $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
  204. if (class_exists($c)) return new $c($r);
  205. return new ESLevent($r);
  206. }
  207. return $r;
  208. }
  209. function recvEventTimed($ms) {
  210. $r=ESLconnection_recvEventTimed($this->_cPtr,$ms);
  211. if (is_resource($r)) {
  212. $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
  213. if (class_exists($c)) return new $c($r);
  214. return new ESLevent($r);
  215. }
  216. return $r;
  217. }
  218. function filter($header,$value) {
  219. $r=ESLconnection_filter($this->_cPtr,$header,$value);
  220. if (is_resource($r)) {
  221. $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
  222. if (class_exists($c)) return new $c($r);
  223. return new ESLevent($r);
  224. }
  225. return $r;
  226. }
  227. function events($etype,$value) {
  228. return ESLconnection_events($this->_cPtr,$etype,$value);
  229. }
  230. function execute($app,$arg=null,$uuid=null) {
  231. switch (func_num_args()) {
  232. case 1: $r=ESLconnection_execute($this->_cPtr,$app); break;
  233. case 2: $r=ESLconnection_execute($this->_cPtr,$app,$arg); break;
  234. default: $r=ESLconnection_execute($this->_cPtr,$app,$arg,$uuid);
  235. }
  236. if (is_resource($r)) {
  237. $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
  238. if (class_exists($c)) return new $c($r);
  239. return new ESLevent($r);
  240. }
  241. return $r;
  242. }
  243. function executeAsync($app,$arg=null,$uuid=null) {
  244. switch (func_num_args()) {
  245. case 1: $r=ESLconnection_executeAsync($this->_cPtr,$app); break;
  246. case 2: $r=ESLconnection_executeAsync($this->_cPtr,$app,$arg); break;
  247. default: $r=ESLconnection_executeAsync($this->_cPtr,$app,$arg,$uuid);
  248. }
  249. if (is_resource($r)) {
  250. $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
  251. if (class_exists($c)) return new $c($r);
  252. return new ESLevent($r);
  253. }
  254. return $r;
  255. }
  256. function setAsyncExecute($val) {
  257. return ESLconnection_setAsyncExecute($this->_cPtr,$val);
  258. }
  259. function setEventLock($val) {
  260. return ESLconnection_setEventLock($this->_cPtr,$val);
  261. }
  262. function disconnect() {
  263. return ESLconnection_disconnect($this->_cPtr);
  264. }
  265. }
  266. ?>