Global.hx 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455
  1. package php;
  2. import haxe.extern.*;
  3. import haxe.Constraints;
  4. /**
  5. This class contains externs for native PHP functions defined in global namespace.
  6. For native PHP constants in global namespace see `php.Const`.
  7. **/
  8. @:phpGlobal
  9. extern class Global {
  10. /**
  11. @see http://php.net/manual/en/function.exit.php
  12. **/
  13. static function exit(status:EitherType<String, Int>):Void;
  14. /**
  15. @see http://php.net/manual/en/function.exit.php
  16. **/
  17. static function die(status:EitherType<String, Int>):Void;
  18. /**
  19. @see http://php.net/manual/en/function.error-reporting.php
  20. **/
  21. static function error_reporting(?level:Int):Int;
  22. /**
  23. @see http://php.net/manual/en/function.set-error-handler.php
  24. **/
  25. @:overload(function(error_handler:Int->String->Bool, ?error_types:Int):Dynamic {})
  26. @:overload(function(error_handler:Int->String->String->Bool, ?error_types:Int):Dynamic {})
  27. @:overload(function(error_handler:Int->String->String->Int->Bool, ?error_types:Int):Dynamic {})
  28. static function set_error_handler(?error_handler:Int->String->String->Int->Array<Dynamic>->Bool, ?error_types:Int):Dynamic;
  29. /**
  30. @see http://php.net/manual/en/function.restore-error-handler.php
  31. **/
  32. static function restore_error_handler():Bool;
  33. /**
  34. @see http://php.net/manual/en/function.set-exception-handler.php
  35. **/
  36. static function set_exception_handler(exception_handler:Throwable->Void):Dynamic;
  37. /**
  38. @see http://php.net/manual/en/function.restore-exception-handler.php
  39. **/
  40. static function restore_exception_handler():Bool;
  41. /**
  42. @see http://php.net/manual/en/function.is-int.php
  43. **/
  44. static function is_int(value:Dynamic):Bool;
  45. /**
  46. @see http://php.net/manual/en/function.is-float.php
  47. **/
  48. static function is_float(value:Dynamic):Bool;
  49. /**
  50. @see http://php.net/manual/en/function.is-string.php
  51. **/
  52. static function is_string(value:Dynamic):Bool;
  53. /**
  54. @see http://php.net/manual/en/function.is-numeric.php
  55. **/
  56. static function is_numeric(value:Dynamic):Bool;
  57. /**
  58. @see http://php.net/manual/en/function.is-bool.php
  59. **/
  60. static function is_bool(value:Dynamic):Bool;
  61. /**
  62. Checks if `values` is `php.NativeArray`
  63. @see http://php.net/manual/en/function.is-array.php
  64. **/
  65. static function is_array(value:Dynamic):Bool;
  66. /**
  67. @see http://php.net/manual/en/function.is-object.php
  68. **/
  69. static function is_object(value:Dynamic):Bool;
  70. /**
  71. @see http://php.net/manual/en/function.is-null.php
  72. **/
  73. static function is_null(value:Dynamic):Bool;
  74. /**
  75. @see http://php.net/manual/en/function.is-subclass-of.php
  76. **/
  77. static function is_subclass_of(value:Dynamic, className:String, allow_string:Bool = true):Bool;
  78. /**
  79. @see http://php.net/manual/en/function.class-exists.php
  80. **/
  81. static function class_exists(class_name:String, autoload:Bool = true):Bool;
  82. /**
  83. @see http://php.net/manual/en/function.interface-exists.php
  84. **/
  85. static function interface_exists(interface_name:String, autoload:Bool = true):Bool;
  86. /**
  87. @see http://php.net/manual/en/function.intval.php
  88. **/
  89. static function intval(value:Dynamic, base:Int = 10):Int;
  90. /**
  91. @see http://php.net/manual/en/function.floatval.php
  92. **/
  93. static function floatval(value:Dynamic):Float;
  94. /**
  95. @see http://php.net/manual/en/function.boolval.php
  96. **/
  97. static function boolval(value:Dynamic):Bool;
  98. /**
  99. @see http://php.net/manual/en/function.strval.php
  100. **/
  101. static function strval(value:Dynamic):String;
  102. /**
  103. @see http://php.net/manual/en/function.phpversion.php
  104. **/
  105. static function phpversion(?extension:String):String;
  106. /**
  107. @see http://php.net/manual/en/function.class-alias.php
  108. **/
  109. static function class_alias(original:String, alias:String, autoload:Bool = true):Bool;
  110. /**
  111. @see http://php.net/manual/en/function.count.php
  112. **/
  113. static function count(array:Dynamic, ?mode:Int):Int;
  114. /**
  115. @see http://php.net/manual/en/function.array-filter.php
  116. **/
  117. @:overload(function(array:NativeArray, callback:Dynamic->Bool, ?flag:Int):NativeArray {})
  118. static function array_filter(array:NativeArray, ?callback:Dynamic->?Dynamic->Bool, flag:Int = 0):NativeArray;
  119. /**
  120. @see http://php.net/manual/en/function.implode.php
  121. **/
  122. @:overload(function(pieces:NativeArray):String {})
  123. static function implode(glue:String, pieces:NativeArray):String;
  124. /**
  125. @see http://php.net/manual/en/function.array-map.php
  126. **/
  127. static function array_map(callback:EitherType<Dynamic->Dynamic, String>, array:Rest<NativeArray>):NativeArray;
  128. /**
  129. @see http://php.net/manual/en/function.array-merge.php
  130. **/
  131. static function array_merge(array:Rest<NativeArray>):NativeArray;
  132. /**
  133. @see http://php.net/manual/en/function.array-diff.php
  134. **/
  135. static function array_diff(array:Rest<NativeArray>):NativeArray;
  136. /**
  137. @see http://php.net/manual/en/function.array-pop.php
  138. **/
  139. static function array_pop(array:NativeArray):Dynamic;
  140. /**
  141. @see http://php.net/manual/en/function.array-push.php
  142. **/
  143. static function array_push(array:Ref<NativeArray>, value:Rest<Dynamic>):Int;
  144. /**
  145. @see http://php.net/manual/en/function.array-reverse.php
  146. **/
  147. static function array_reverse(array:NativeArray, preserve_keys:Bool = false):NativeArray;
  148. /**
  149. @see http://php.net/manual/en/function.array-search.php
  150. **/
  151. static function array_search(needle:Dynamic, haystack:NativeArray, strict:Bool = false):EitherType<Bool, EitherType<String, Int>>;
  152. /**
  153. @see http://php.net/manual/en/function.array-shift.php
  154. **/
  155. static function array_shift(array:Ref<NativeArray>):Dynamic;
  156. /**
  157. @see http://php.net/manual/en/function.array-slice.php
  158. **/
  159. static function array_slice(array:NativeArray, offset:Int, length:Int = null, preserve_keys:Bool = false):NativeArray;
  160. /**
  161. @see http://php.net/manual/en/function.array-splice.php
  162. **/
  163. static function array_splice(array:Ref<NativeArray>, offset:Int, lenght:Int = 0, ?replacement:Dynamic):NativeArray;
  164. /**
  165. @see http://php.net/manual/en/function.array-unshift.php
  166. **/
  167. static function array_unshift(arr:Ref<NativeArray>, value:Rest<Dynamic>):Int;
  168. /**
  169. @see http://php.net/manual/en/function.array-values.php
  170. **/
  171. static function array_values(arr:NativeArray):NativeIndexedArray<Dynamic>;
  172. /**
  173. @see http://php.net/manual/en/function.array-keys.php
  174. **/
  175. static function array_keys(arr:NativeArray):NativeIndexedArray<EitherType<String, Int>>;
  176. /**
  177. @see http://php.net/manual/en/function.array-key-exists.php
  178. **/
  179. static function array_key_exists(key:EitherType<String, Int>, arr:NativeArray):Bool;
  180. /**
  181. @see http://php.net/manual/en/function.array-fill.php
  182. **/
  183. static function array_fill(start_index:Int, num:Int, value:Dynamic):NativeArray;
  184. /**
  185. @see http://php.net/manual/en/function.array-pad.php
  186. **/
  187. static function array_pad(array:NativeArray, size:Int, value:Dynamic):NativeArray;
  188. /**
  189. @see http://php.net/manual/en/function.in-array.php
  190. **/
  191. static function in_array(needle:Dynamic, haystack:NativeArray, strict:Bool = false):Bool;
  192. /**
  193. @see http://php.net/manual/en/function.usort.php
  194. **/
  195. static function usort(array:Ref<NativeArray>, value_compare_func:Dynamic->Dynamic->Int):Bool;
  196. /**
  197. @see http://php.net/manual/en/function.reset.php
  198. **/
  199. static function reset(array:Ref<NativeArray>):Dynamic;
  200. /**
  201. @see http://php.net/manual/en/function.current.php
  202. **/
  203. static function current(array:Ref<NativeArray>):Dynamic;
  204. /**
  205. @see http://php.net/manual/en/function.next.php
  206. **/
  207. static function next(array:Ref<NativeArray>):Dynamic;
  208. /**
  209. @see http://php.net/manual/en/function.prev.php
  210. **/
  211. static function prev(array:Ref<NativeArray>):Dynamic;
  212. /**
  213. @see http://php.net/manual/en/function.end.php
  214. **/
  215. static function end(array:Ref<NativeArray>):Dynamic;
  216. /**
  217. @see http://php.net/manual/en/function.key.php
  218. **/
  219. static function key(array:NativeArray):EitherType<String, Int>;
  220. /**
  221. @see http://php.net/manual/en/function.each.php
  222. **/
  223. static function each(array:Ref<NativeArray>):NativeArray;
  224. /**
  225. @see http://php.net/manual/en/function.defined.php
  226. **/
  227. static function defined(name:String):Bool;
  228. /**
  229. @see http://php.net/manual/en/function.constant.php
  230. **/
  231. static function constant(name:String):Dynamic;
  232. /**
  233. @see http://php.net/manual/en/function.define.php
  234. **/
  235. static function define(name:String, value:Dynamic, case_insensitive:Bool = false):Bool;
  236. /**
  237. @see http://php.net/manual/en/function.echo.php
  238. **/
  239. static function echo(args:Rest<String>):Void;
  240. /**
  241. @see http://php.net/manual/en/function.sprintf.php
  242. **/
  243. static function sprintf(format:String, args:Rest<Dynamic>):EitherType<String, Bool>;
  244. /**
  245. @see http://php.net/manual/en/function.method-exists.php
  246. **/
  247. static function method_exists(object:Dynamic, method_name:String):Bool;
  248. /**
  249. @see http://php.net/manual/en/function.property-exists.php
  250. **/
  251. static function property_exists(object:Dynamic, property_name:String):Bool;
  252. /**
  253. @see http://php.net/manual/en/function.is-callable.php
  254. **/
  255. static function is_callable(value:Dynamic, syntax_only:Bool = false, ?callable_name:String):Bool;
  256. /**
  257. @see http://php.net/manual/en/function.isset.php
  258. **/
  259. static function isset(value:Dynamic, args:Rest<Dynamic>):Bool;
  260. /**
  261. @see http://php.net/manual/en/function.unset.php
  262. **/
  263. static function unset(value:Dynamic, values:Rest<Dynamic>):Void;
  264. /**
  265. @see http://php.net/manual/en/function.get-object-vars.php
  266. **/
  267. static function get_object_vars(object:{}):NativeAssocArray<Dynamic>;
  268. /**
  269. @see http://php.net/manual/en/function.get-class.php
  270. **/
  271. static function get_class(object:{} = null):EitherType<Bool, String>;
  272. /**
  273. @see http://php.net/manual/en/function.get-parent-class.php
  274. **/
  275. static function get_parent_class(?object:Dynamic):EitherType<Bool, String>;
  276. /**
  277. @see http://php.net/manual/en/function.var-dump.php
  278. **/
  279. static function var_dump(args:Rest<Dynamic>):Void;
  280. /**
  281. @see http://php.net/manual/en/function.ord.php
  282. **/
  283. static function ord(string:String):Int;
  284. /**
  285. @see http://php.net/manual/en/function.chr.php
  286. **/
  287. static function chr(code:Int):String;
  288. /**
  289. @see http://php.net/manual/en/function.strpos.php
  290. **/
  291. static function strpos(haystack:String, needle:String, offset:Int = 0):EitherType<Bool, Int>;
  292. /**
  293. @see http://php.net/manual/en/function.strrpos.php
  294. **/
  295. static function strrpos(haystack:String, needle:String, offset:Int = 0):EitherType<Bool, Int>;
  296. /**
  297. @see http://php.net/manual/en/function.str-split.php
  298. **/
  299. static function str_split(string:String, split_length:Int = 1):EitherType<Bool, NativeIndexedArray<String>>;
  300. /**
  301. @see http://php.net/manual/en/function.strlen.php
  302. **/
  303. static function strlen(string:String):Int;
  304. /**
  305. @see http://php.net/manual/en/function.strcmp.php
  306. **/
  307. static function strcmp(str1:String, str2:String):Int;
  308. /**
  309. @see http://php.net/manual/en/function.str-repeat.php
  310. **/
  311. static function str_repeat(input:String, multiplier:Int):String;
  312. /**
  313. @see http://php.net/manual/en/function.str-replace.php
  314. **/
  315. static function str_replace(search:EitherType<String, NativeArray>, replace:EitherType<String, NativeArray>, subject:EitherType<String, NativeArray>,
  316. ?count:Int):EitherType<String, NativeArray>;
  317. /**
  318. @see http://php.net/manual/en/function.explode.php
  319. **/
  320. static function explode(delimiter:String, string:String, ?limit:Int):EitherType<Bool, NativeIndexedArray<String>>;
  321. /**
  322. @see http://php.net/manual/en/function.substr.php
  323. **/
  324. static function substr(string:String, start:Int, ?length:Int):EitherType<Bool, String>;
  325. /**
  326. @see http://php.net/manual/en/function.substr-count.php
  327. **/
  328. static function substr_count(haystack:String, needle:String, ?offset:Int, ?length:Int):Int;
  329. /**
  330. @see http://php.net/manual/en/function.substr_replace.php
  331. **/
  332. static function substr_replace(string:EitherType<String, NativeArray>, replacement:EitherType<String, NativeArray>, start:EitherType<Int, NativeArray>,
  333. ?length:EitherType<Int, NativeArray>):EitherType<String, NativeArray>;
  334. /**
  335. @see http://php.net/manual/en/function.strtoupper.php
  336. **/
  337. static function strtoupper(string:String):String;
  338. /**
  339. @see http://php.net/manual/en/function.strtolower.php
  340. **/
  341. static function strtolower(string:String):String;
  342. /**
  343. @see http://php.net/manual/en/function.debug-backtrace.php
  344. **/
  345. static function debug_backtrace(?options:Int, ?limit:Int):NativeIndexedArray<NativeAssocArray<Dynamic>>;
  346. /**
  347. @see http://php.net/manual/en/function.call-user-func.php
  348. **/
  349. static function call_user_func(callback:Dynamic, arguments:Rest<Dynamic>):Dynamic;
  350. /**
  351. @see http://php.net/manual/en/function.call-user-func-array.php
  352. **/
  353. static function call_user_func_array(callback:Dynamic, arguments:NativeArray):Dynamic;
  354. /**
  355. @see http://php.net/manual/en/function.func-get-args.php
  356. **/
  357. static function func_get_args():NativeIndexedArray<Dynamic>;
  358. /**
  359. @see http://php.net/manual/en/function.abs.php
  360. **/
  361. static function abs<T:Float>(number:T):T;
  362. /**
  363. @see http://php.net/manual/en/function.min.php
  364. **/
  365. static function min(values:Rest<Dynamic>):Dynamic;
  366. /**
  367. @see http://php.net/manual/en/function.max.php
  368. **/
  369. static function max(values:Rest<Dynamic>):Dynamic;
  370. /**
  371. @see http://php.net/manual/en/function.sin.php
  372. **/
  373. static function sin(arg:Float):Float;
  374. /**
  375. @see http://php.net/manual/en/function.cos.php
  376. **/
  377. static function cos(arg:Float):Float;
  378. /**
  379. @see http://php.net/manual/en/function.atan2.php
  380. **/
  381. static function atan2(y:Float, x:Float):Float;
  382. /**
  383. @see http://php.net/manual/en/function.tan.php
  384. **/
  385. static function tan(arg:Float):Float;
  386. /**
  387. @see http://php.net/manual/en/function.exp.php
  388. **/
  389. static function exp(arg:Float):Float;
  390. /**
  391. @see http://php.net/manual/en/function.log.php
  392. **/
  393. static function log(arg:Float):Float;
  394. /**
  395. @see http://php.net/manual/en/function.sqrt.php
  396. **/
  397. static function sqrt(arg:Float):Float;
  398. /**
  399. @see http://php.net/manual/en/function.floor.php
  400. **/
  401. static function floor(arg:Float):Float;
  402. /**
  403. @see http://php.net/manual/en/function.ceil.php
  404. **/
  405. static function ceil(arg:Float):Float;
  406. /**
  407. @see http://php.net/manual/en/function.round.php
  408. **/
  409. static function round(val:Float, precision:Int = 0, ?mode:Int):Float;
  410. /**
  411. @see http://php.net/manual/en/function.atan.php
  412. **/
  413. static function atan(arg:Float):Float;
  414. /**
  415. @see http://php.net/manual/en/function.asin.php
  416. **/
  417. static function asin(arg:Float):Float;
  418. /**
  419. @see http://php.net/manual/en/function.acos.php
  420. **/
  421. static function acos(arg:Float):Float;
  422. /**
  423. @see http://php.net/manual/en/function.pow.php
  424. **/
  425. static function pow(base:Float, exp:Float):Float;
  426. /**
  427. @see http://php.net/manual/en/function.mt-rand.php
  428. **/
  429. @:overload(function():Int {})
  430. static function mt_rand(base:Int, exp:Int):Int;
  431. /**
  432. @see http://php.net/manual/en/function.mt-getrandmax.php
  433. **/
  434. static function mt_getrandmax():Int;
  435. /**
  436. @see http://php.net/manual/en/function.is-nan.php
  437. **/
  438. static function is_nan(arg:Float):Bool;
  439. /**
  440. @see http://php.net/manual/en/function.is-finite.php
  441. **/
  442. static function is_finite(arg:Float):Bool;
  443. /**
  444. @see http://php.net/manual/en/function.trim.php
  445. **/
  446. static function trim(str:String, ?character_mask:String):String;
  447. /**
  448. @see http://php.net/manual/en/function.rtrim.php
  449. **/
  450. static function rtrim(str:String, ?character_mask:String):String;
  451. /**
  452. @see http://php.net/manual/en/function.ltrim.php
  453. **/
  454. static function ltrim(str:String, ?character_mask:String):String;
  455. /**
  456. @see http://php.net/manual/en/function.getenv.php
  457. **/
  458. static function getenv(varname:String):EitherType<String, Bool>;
  459. /**
  460. @see http://php.net/manual/en/function.putenv.php
  461. **/
  462. static function putenv(setting:String):Bool;
  463. /**
  464. @see http://php.net/manual/en/function.sleep.php
  465. **/
  466. static function sleep(seconds:Int):EitherType<Bool, Int>;
  467. /**
  468. @see http://php.net/manual/en/function.usleep.php
  469. **/
  470. static function usleep(micro_seconds:Int):Void;
  471. /**
  472. @see http://php.net/manual/en/function.setlocale.php
  473. **/
  474. @:overload(function(category:Int, locale:NativeIndexedArray<String>):EitherType<Bool, String> {})
  475. static function setlocale(category:Int, locale:Rest<String>):EitherType<Bool, String>;
  476. /**
  477. @see http://php.net/manual/en/function.getcwd.php
  478. **/
  479. static function getcwd():EitherType<String, Bool>;
  480. /**
  481. @see http://php.net/manual/en/function.chdir.php
  482. **/
  483. static function chdir(directory:String):Bool;
  484. /**
  485. @see http://php.net/manual/en/function.php-uname.php
  486. **/
  487. static function php_uname(mode:String = 'a'):String;
  488. /**
  489. @see http://php.net/manual/en/function.system.php
  490. **/
  491. static function system(command:String, ?return_var:Ref<Int>):EitherType<String, Bool>;
  492. /**
  493. @see http://php.net/manual/en/function.microtime.php
  494. **/
  495. static function microtime(get_as_float:Bool = false):EitherType<Float, String>;
  496. /**
  497. @see http://php.net/manual/en/function.fopen.php
  498. **/
  499. static function fopen(filename:String, mode:String, use_include_path:Bool = false, ?context:Resource):EitherType<Bool, Resource>;
  500. /**
  501. @see http://php.net/manual/en/function.fclose.php
  502. **/
  503. static function fclose(handle:Resource):Bool;
  504. /**
  505. @see http://php.net/manual/en/function.feof.php
  506. **/
  507. static function feof(handle:Resource):Bool;
  508. /**
  509. @see http://php.net/manual/en/function.fseek.php
  510. **/
  511. static function fseek(handle:Resource, offset:Int, ?whence:Int):EitherType<Int, Bool>;
  512. /**
  513. @see http://php.net/manual/en/function.ftell.php
  514. **/
  515. static function ftell(handle:Resource):EitherType<Int, Bool>;
  516. /**
  517. @see http://php.net/manual/en/function.rewind.php
  518. **/
  519. static function rewind(handle:Resource):Bool;
  520. /**
  521. @see http://php.net/manual/en/function.fgetc.php
  522. **/
  523. static function fgetc(handle:Resource):EitherType<Bool, String>;
  524. /**
  525. @see http://php.net/manual/en/function.fgets.php
  526. **/
  527. static function fgets(handle:Resource):EitherType<Bool, String>;
  528. /**
  529. @see http://php.net/manual/en/function.fflush.php
  530. **/
  531. static function fflush(handle:Resource):Bool;
  532. /**
  533. @see http://php.net/manual/en/function.fwrite.php
  534. **/
  535. static function fwrite(handle:Resource, string:String, ?length:Int):EitherType<Int, Bool>;
  536. /**
  537. @see http://php.net/manual/en/function.fread.php
  538. **/
  539. static function fread(handle:Resource, length:Int):EitherType<Bool, String>;
  540. /**
  541. @see http://php.net/manual/en/function.file-exists.php
  542. **/
  543. static function file_exists(filename:String):Bool;
  544. /**
  545. @see http://php.net/manual/en/function.file-get-contents.php
  546. **/
  547. static function file_get_contents(filename:String, use_include_path:Bool = false, ?context:Resource, offset:Int = 0, ?maxlen:Int):EitherType<String, Bool>;
  548. /**
  549. @see http://php.net/manual/en/function.file-put-contents.php
  550. **/
  551. static function file_put_contents(filename:String, data:Dynamic, flags:Int = 0, ?context:Resource):EitherType<Int, Bool>;
  552. /**
  553. @see http://php.net/manual/en/function.clearstatcache.php
  554. **/
  555. static function clearstatcache(clear_realpath_cache:Bool = false, ?filename:String):Bool;
  556. /**
  557. @see http://php.net/manual/en/function.fstat.php
  558. **/
  559. static function fstat(handle:Resource):NativeArray;
  560. /**
  561. @see http://php.net/manual/en/function.stat.php
  562. **/
  563. static function stat(filename:String):EitherType<NativeArray, Bool>;
  564. /**
  565. @see http://php.net/manual/en/function.realpath.php
  566. **/
  567. static function realpath(path:String):EitherType<String, Bool>;
  568. /**
  569. @see http://php.net/manual/en/function.filetype.php
  570. **/
  571. static function filetype(filename:String):EitherType<String, Bool>;
  572. /**
  573. @see http://php.net/manual/en/function.mkdir.php
  574. **/
  575. static function mkdir(pathname:String, mode:Int = 511, recursive:Bool = false, ?context:Resource):Bool;
  576. /**
  577. @see http://php.net/manual/en/function.unlink.php
  578. **/
  579. static function unlink(filename:String, ?context:Resource):Bool;
  580. /**
  581. @see http://php.net/manual/en/function.rmdir.php
  582. **/
  583. static function rmdir(dirname:String, ?context:Resource):Bool;
  584. /**
  585. @see http://php.net/manual/en/function.dirname.php
  586. **/
  587. static function dirname(path:String, levels:Int = 1):String;
  588. /**
  589. @see http://php.net/manual/en/function.glob.php
  590. **/
  591. static function glob(pattern:String, flags:Int = 0):NativeArray;
  592. /**
  593. @see http://php.net/manual/en/function.opendir.php
  594. **/
  595. static function opendir(path:String, ?context:Resource):EitherType<Resource, Bool>;
  596. /**
  597. @see http://php.net/manual/en/function.closedir.php
  598. **/
  599. static function closedir(dir_handle:Resource):Void;
  600. /**
  601. @see http://php.net/manual/en/function.readdir.php
  602. **/
  603. static function readdir(?dir_handle:Resource):EitherType<String, Bool>;
  604. /**
  605. @see http://php.net/manual/en/function.rewinddir.php
  606. **/
  607. static function rewinddir(?dir_handle:Resource):Void;
  608. /**
  609. @see http://php.net/manual/en/function.is-dir.php
  610. **/
  611. static function is_dir(filename:String):Bool;
  612. /**
  613. @see http://php.net/manual/en/function.rename.php
  614. **/
  615. static function rename(oldname:String, newname:String, ?context:Resource):Bool;
  616. /**
  617. @see http://php.net/manual/en/function.copy.php
  618. **/
  619. static function copy(source:String, dest:String, ?context:Resource):Bool;
  620. /**
  621. @see http://php.net/manual/en/function.preg-match.php
  622. **/
  623. static function preg_match(pattern:String, subject:String, ?matches:NativeArray, ?flags:Int, ?offset:Int):EitherType<Bool, Int>;
  624. /**
  625. @see http://php.net/manual/en/function.preg-match-all.php
  626. **/
  627. static function preg_match_all(pattern:String, subject:String, ?matches:NativeArray, ?flags:Int, ?offset:Int):EitherType<Bool, Int>;
  628. /**
  629. @see http://php.net/manual/en/function.preg-quote.php
  630. **/
  631. static function preg_quote(str:String, ?delimiter:String):String;
  632. /**
  633. @see http://php.net/manual/en/function.preg-split.php
  634. **/
  635. static function preg_split(pattern:String, subject:String, limit:Int = -1, flags:Int = 0):EitherType<Bool, NativeArray>;
  636. /**
  637. @see http://php.net/manual/en/function.preg-replace.php
  638. **/
  639. static function preg_replace(pattern:EitherType<String, NativeArray>, replacement:EitherType<String, NativeArray>,
  640. subject:EitherType<String, NativeArray>, limit:Int = -1, ?count:Int):EitherType<String, NativeArray>;
  641. /**
  642. @see http://php.net/manual/en/function.preg-last-error.php
  643. **/
  644. static function preg_last_error():Int;
  645. /**
  646. @see http://php.net/manual/en/function.md5.php
  647. **/
  648. static function md5(str:String, raw_output:Bool = false):String;
  649. /**
  650. @see http://php.net/manual/en/function.sha1.php
  651. **/
  652. static function sha1(str:String, raw_output:Bool = false):String;
  653. /**
  654. @see http://php.net/manual/en/function.hash.php
  655. **/
  656. static function hash(algo:String, str:String, raw_output:Bool = false):String;
  657. /**
  658. @see http://php.net/manual/en/function.pack.php
  659. **/
  660. static function pack(format:String, args:Rest<Dynamic>):String;
  661. /**
  662. @see http://php.net/manual/en/function.unpack.php
  663. **/
  664. static function unpack(format:String, data:String):NativeArray;
  665. /**
  666. @see http://php.net/manual/en/function.chunk-split.php
  667. **/
  668. static function chunk_split(body:String, chunklen:Int = 76, end:String = "\r\n"):String;
  669. /**
  670. @see http://php.net/manual/en/function.urlencode.php
  671. **/
  672. static function urlencode(str:String):String;
  673. /**
  674. @see http://php.net/manual/en/function.urldecode.php
  675. **/
  676. static function urldecode(str:String):String;
  677. /**
  678. @see http://php.net/manual/en/function.rawurlencode.php
  679. **/
  680. static function rawurlencode(str:String):String;
  681. /**
  682. @see http://php.net/manual/en/function.rawurldecode.php
  683. **/
  684. static function rawurldecode(str:String):String;
  685. /**
  686. @see http://php.net/manual/en/function.header.php
  687. **/
  688. static function header(string:String, replace:Bool = true, ?http_response_code:Int):Void;
  689. /**
  690. @see http://php.net/manual/en/function.setcookie.php
  691. **/
  692. static function setcookie(name:String, value:String = "", expire:Int = 0, path:String = "", domain:String = "", secure:Bool = false,
  693. httponly:Bool = false):Bool;
  694. /**
  695. @see http://php.net/manual/en/function.htmlspecialchars.php
  696. **/
  697. static function htmlspecialchars(string:String, ?flags:Int, ?encoding:String, double_encode:Bool = true):String;
  698. /**
  699. @see http://php.net/manual/en/function.htmlspecialchars_decode.php
  700. **/
  701. static function htmlspecialchars_decode(string:String, ?flags:Int):String;
  702. /**
  703. @see http://php.net/manual/en/function.str-pad.php
  704. **/
  705. static function str_pad(input:String, pad_length:Int, pad_String:String = ' ', ?pad_type:Int):String;
  706. /**
  707. @see http://php.net/manual/en/function.dechex.php
  708. **/
  709. static function dechex(number:Int):String;
  710. /**
  711. @see http://php.net/manual/en/function.hexdec.php
  712. **/
  713. static function hexdec(hex_string:String):Int;
  714. /**
  715. @see http://php.net/manual/en/function.decbin.php
  716. **/
  717. static function decbin(number:Int):String;
  718. /**
  719. @see http://php.net/manual/en/function.bindec.php
  720. **/
  721. static function bindec(binary_string:String):Float;
  722. /**
  723. @see http://php.net/manual/en/function.bin2hex.php
  724. **/
  725. static function bin2hex(str:String):String;
  726. /**
  727. @see http://php.net/manual/en/function.hex2bin.php
  728. **/
  729. static function hex2bin(str:String):EitherType<String, Bool>;
  730. /**
  731. @see http://php.net/manual/en/function.serialize.php
  732. **/
  733. static function serialize(value:Dynamic):String;
  734. /**
  735. @see http://php.net/manual/en/function.unserialize.php
  736. **/
  737. static function unserialize(str:String, ?options:NativeArray):Dynamic;
  738. /**
  739. @see http://php.net/manual/en/function.extension-loaded.php
  740. **/
  741. static function extension_loaded(name:String):Bool;
  742. /**
  743. @see http://php.net/manual/en/function.strncasecmp.php
  744. **/
  745. static function strncasecmp(str1:String, str2:String, len:Int):Int;
  746. /**
  747. @see http://php.net/manual/en/function.strcasecmp.php
  748. **/
  749. static function strcasecmp(str1:String, str2:String):Int;
  750. /**
  751. @see http://php.net/manual/en/function.fpassthru.php
  752. **/
  753. static function fpassthru(handle:Resource):Int;
  754. /**
  755. @see http://php.net/manual/en/function.json-encode.php
  756. **/
  757. static function json_encode(value:Dynamic, options:Int = 0, depth:Int = 512):EitherType<String, Bool>;
  758. /**
  759. @see http://php.net/manual/en/function.json-decode.php
  760. **/
  761. static function json_decode(json:String, assoc:Bool = false, depth:Int = 512, options:Int = 512):Dynamic;
  762. /**
  763. @see http://php.net/manual/en/function.json-last-error.php
  764. **/
  765. static function json_last_error():Int;
  766. /**
  767. @see http://php.net/manual/en/function.json-last-error-msg.php
  768. **/
  769. static function json_last_error_msg():EitherType<String, Bool>;
  770. /**
  771. @see http://php.net/manual/en/function.spl-object-hash.php
  772. **/
  773. static function spl_object_hash(obj:{}):String;
  774. /**
  775. @see http://php.net/manual/en/function.spl-autoload-call.php
  776. **/
  777. static function spl_autoload_call(class_name:String):Void;
  778. /**
  779. @see http://php.net/manual/en/function.spl-autoload-extensions.php
  780. **/
  781. static function spl_autoload_extensions(?file_extensions:String):String;
  782. /**
  783. @see http://php.net/manual/en/function.spl-autoload-functions.php
  784. **/
  785. static function spl_autoload_functions():EitherType<NativeIndexedArray<Function>, Bool>;
  786. /**
  787. @see http://php.net/manual/en/function.spl-autoload-register.php
  788. **/
  789. static function spl_autoload_register(?autoload_function:(className:String) -> Void, throw_exception:Bool = true, prepend:Bool = false):Bool;
  790. /**
  791. @see http://php.net/manual/en/function.spl-autoload-unregister.php
  792. **/
  793. static function spl_autoload_unregister(autoload_function:(className:String) -> Void):Bool;
  794. /**
  795. @see http://php.net/manual/en/function.spl-autoload.php
  796. **/
  797. static function spl_autoload(class_name:String, ?file_extensions:String):Void;
  798. /**
  799. @see http://php.net/manual/en/function.utf8-encode.php
  800. **/
  801. static function utf8_encode(data:String):String;
  802. /**
  803. @see http://php.net/manual/en/function.utf8-decode.php
  804. **/
  805. static function utf8_decode(data:String):String;
  806. /**
  807. @see http://php.net/manual/en/function.mb-internal-encoding.php
  808. **/
  809. static function mb_internal_encoding(?encoding:String):EitherType<Bool, String>;
  810. /**
  811. @see http://php.net/manual/en/function.mb-convert-encoding.php
  812. **/
  813. static function mb_convert_encoding(str:String, to_encoding:String, ?from_encoding:Dynamic):String;
  814. /**
  815. @see http://php.net/manual/en/function.mb-check-encoding.php
  816. **/
  817. static function mb_check_encoding(str:String = null, ?encoding:String):Bool;
  818. /**
  819. @see http://php.net/manual/en/function.mb-split.php
  820. **/
  821. static function mb_split(pattern:String, str:String, ?limit:Int):NativeIndexedArray<String>;
  822. /**
  823. @see http://php.net/manual/en/function.mb-strlen.php
  824. **/
  825. static function mb_strlen(str:String, ?encoding:String):EitherType<Int, Bool>;
  826. /**
  827. @see http://php.net/manual/en/function.mb-substr.php
  828. **/
  829. static function mb_substr(str:String, start:Int, length:Int = null, ?encoding:String):String;
  830. /**
  831. @see http://php.net/manual/en/function.mb-chr.php
  832. (Polyfilled for php 7.0)
  833. **/
  834. static function mb_chr(cp:Int, ?encoding:String):String;
  835. /**
  836. @see http://php.net/manual/en/function.mb-ord.php
  837. (Polyfilled for php 7.0)
  838. **/
  839. static function mb_ord(str:String, ?encoding:String):Int;
  840. /**
  841. @see http://php.net/manual/en/function.mb-regex-encoding.php
  842. **/
  843. static function mb_regex_encoding(?encoding:String):EitherType<Bool, String>;
  844. /**
  845. @see http://php.net/manual/en/function.mb-strtoupper.php
  846. **/
  847. static function mb_strtoupper(str:String, ?encoding:String):String;
  848. /**
  849. @see http://php.net/manual/en/function.mb-strpos.php
  850. **/
  851. static function mb_strpos(haystack:String, needle:String, ?offset:Int, ?encoding:String):EitherType<Int, Bool>;
  852. /**
  853. @see http://php.net/manual/en/function.mb-strrpos.php
  854. **/
  855. static function mb_strrpos(haystack:String, needle:String, ?offset:Int, ?encoding:String):EitherType<Int, Bool>;
  856. /**
  857. @see http://php.net/manual/en/function.mb-strtolower.php
  858. **/
  859. static function mb_strtolower(str:String, ?encoding:String):String;
  860. /**
  861. @see http://php.net/manual/en/function.proc-open.php
  862. **/
  863. static function proc_open(cmd:String, descriptorspec:NativeArray, pipes:NativeIndexedArray<Resource>, ?cwd:String, ?env:NativeArray,
  864. ?other_options:NativeArray):EitherType<Resource, Bool>;
  865. /**
  866. @see http://php.net/manual/en/function.proc-get-status.php
  867. **/
  868. static function proc_get_status(process:Resource):EitherType<Bool, NativeAssocArray<Scalar>>;
  869. /**
  870. @see http://php.net/manual/en/function.proc-close.php
  871. **/
  872. static function proc_close(process:Resource):Int;
  873. /**
  874. @see http://php.net/manual/en/function.proc-terminate.php
  875. **/
  876. static function proc_terminate(process:Resource, signal:Int = 15):Bool;
  877. /**
  878. @see http://php.net/manual/en/function.stream-select.php
  879. **/
  880. static function stream_select(read:NativeArray, write:NativeArray, except:NativeArray, tv_sec:Int, tv_usec:Int = 0):Bool;
  881. /**
  882. @see http://php.net/manual/en/function.stream-get-contents.php
  883. **/
  884. static function stream_get_contents(handle:Resource, maxlength:Int = -1, offset:Int = -1):EitherType<String, Bool>;
  885. /**
  886. @see http://php.net/manual/en/function.stream-socket-shutdown.php
  887. **/
  888. static function stream_socket_shutdown(stream:Resource, how:Int):Bool;
  889. /**
  890. @see http://php.net/manual/en/function.stream-set-timeout.php
  891. **/
  892. static function stream_set_timeout(stream:Resource, seconds:Int, microseconds:Int = 0):Bool;
  893. /**
  894. @see http://php.net/manual/en/function.stream-set-blocking.php
  895. **/
  896. static function stream_set_blocking(stream:Resource, mode:Bool):Bool;
  897. /**
  898. @see http://php.net/manual/en/function.stream-socket-accept.php
  899. **/
  900. static function stream_socket_accept(server_socket:Resource, ?timeout:Float, ?peername:Ref<String>):EitherType<Resource, Bool>;
  901. /**
  902. @see http://php.net/manual/en/function.stream-socket-client.php
  903. **/
  904. static function stream_socket_client(remote_socket:String, ?errno:Ref<Int>, ?errstr:Ref<String>, ?timeout:Float, ?flags:Int,
  905. ?context:Resource):EitherType<Resource, Bool>;
  906. /**
  907. @see http://php.net/manual/en/function.stream-socket-server.php
  908. **/
  909. static function stream_socket_server(local_socket:String, ?errno:Ref<Int>, ?errstr:Ref<String>, ?flags:Int, ?context:Resource):EitherType<Resource, Bool>;
  910. /**
  911. @see http://php.net/manual/en/function.stream-socket-get-name.php
  912. **/
  913. static function stream_socket_get_name(stream:Resource, want_peer:Bool):EitherType<String, Bool>;
  914. /**
  915. @see http://php.net/manual/en/function.socket-create.php
  916. **/
  917. static function socket_create(domain:Int, type:Int, protocol:Int):Resource;
  918. /**
  919. @see http://php.net/manual/en/function.socket-connect.php
  920. **/
  921. static function socket_connect(stream:Resource, host:String, port:Int):Bool;
  922. /**
  923. @see http://php.net/manual/en/function.socket-listen.php
  924. **/
  925. static function socket_listen(stream:Resource, connections:Int):Bool;
  926. /**
  927. @see http://php.net/manual/en/function.socket-shutdown.php
  928. **/
  929. static function socket_shutdown(stream:Resource, rw:Int):Bool;
  930. /**
  931. @see http://php.net/manual/en/function.socket-bind.php
  932. **/
  933. static function socket_bind(stream:Resource, host:String, port:Int):Bool;
  934. /**
  935. @see http://php.net/manual/en/function.socket-accept.php
  936. **/
  937. static function socket_accept(stream:Resource):EitherType<Resource, Bool>;
  938. /**
  939. @see http://php.net/manual/en/function.socket-getpeername.php
  940. **/
  941. static function socket_getpeername(stream:Resource, host:Ref<String>, port:Ref<Int>):Bool;
  942. /**
  943. @see http://php.net/manual/en/function.socket-getsockname.php
  944. **/
  945. static function socket_getsockname(stream:Resource, host:Ref<String>, port:Ref<Int>):Bool;
  946. /**
  947. @see http://php.net/manual/en/function.socket-set-block.php
  948. **/
  949. static function socket_set_block(stream:Resource):Bool;
  950. /**
  951. @see http://php.net/manual/en/function.socket-set-nonblock.php
  952. **/
  953. static function socket_set_nonblock(stream:Resource):Bool;
  954. /**
  955. @see http://php.net/manual/en/function.socket-set-option.php
  956. **/
  957. static function socket_set_option(stream:Resource, level:Int, option:Int, val:Any):Bool;
  958. /**
  959. @see http://php.net/manual/en/function.socket-select.php
  960. **/
  961. static function socket_select(read:NativeIndexedArray<Resource>, write:NativeIndexedArray<Resource>, other:NativeIndexedArray<Resource>, tv_sec:Int = 0,
  962. tv_usec:Int = 0):EitherType<Bool, Int>;
  963. /**
  964. @see http://php.net/manual/en/function.socket-read.php
  965. **/
  966. static function socket_read(resource:Resource, length:Int, ?type:Int):EitherType<Bool, String>;
  967. /**
  968. @see http://php.net/manual/en/function.socket-write.php
  969. **/
  970. static function socket_write(resource:Resource, buffer:String, len:Int = 0):EitherType<Bool, Int>;
  971. /**
  972. @see http://php.net/manual/en/function.socket-import-stream.php
  973. **/
  974. static function socket_import_stream(resource:Resource):EitherType<Bool, Resource>;
  975. /**
  976. @see http://php.net/manual/en/function.socket-export-stream.php
  977. **/
  978. static function socket_export_stream(resource:Resource):EitherType<Bool, Resource>;
  979. /**
  980. @see http://php.net/manual/en/function.socket-close.php
  981. **/
  982. static function socket_close(resource:Resource):Void;
  983. /**
  984. @see http://php.net/manual/en/function.ini-get.php
  985. **/
  986. static function ini_get(var_name:String):EitherType<Bool, String>;
  987. /**
  988. @see http://php.net/manual/en/function.ini-set.php
  989. **/
  990. static function ini_set(var_name:String, newvalue:String):EitherType<Bool, String>;
  991. /**
  992. @see http://php.net/manual/en/function.sqlite-error-string.php
  993. **/
  994. static function sqlite_error_string(error_code:Int):String;
  995. /**
  996. @see http://php.net/manual/en/function.sqlite-escape-string.php
  997. **/
  998. static function sqlite_escape_string(item:String):String;
  999. /**
  1000. @see http://php.net/manual/en/function.set-time-limit.php
  1001. **/
  1002. static function set_time_limit(seconds:Int):Bool;
  1003. /**
  1004. @see http://php.net/manual/en/function.function-exists.php
  1005. **/
  1006. static function function_exists(function_name:String):Bool;
  1007. /**
  1008. @see http://php.net/manual/en/function.getallheaders.php
  1009. **/
  1010. static function getallheaders():NativeAssocArray<Dynamic>;
  1011. /**
  1012. @see http://php.net/manual/en/function.ucwords.php
  1013. **/
  1014. static function ucwords(str:String, ?delimiters:String):String;
  1015. /**
  1016. @see http://php.net/manual/en/function.base64-encode.php
  1017. **/
  1018. static function base64_encode(data:String):String;
  1019. /**
  1020. @see http://php.net/manual/en/function.base64-decode.php
  1021. **/
  1022. static function base64_decode(data:String, strict:Bool = false):EitherType<String, Bool>;
  1023. /**
  1024. @see http://php.net/manual/en/function.gethostbyname.php
  1025. **/
  1026. static function gethostbyname(hostname:String):String;
  1027. /**
  1028. @see http://php.net/manual/en/function.gethostbyaddr.php
  1029. **/
  1030. static function gethostbyaddr(ip_address:String):EitherType<String, Bool>;
  1031. /**
  1032. @see http://php.net/manual/en/function.getprotobyname.php
  1033. **/
  1034. static function getprotobyname(name:String):EitherType<Int, Bool>;
  1035. /**
  1036. @see http://php.net/manual/en/function.mktime.php
  1037. **/
  1038. static function mktime(?hour:Int, ?minute:Int, ?second:Int, ?month:Int, ?day:Int, ?year:Int, ?is_dst:Int):EitherType<Int, Bool>;
  1039. /**
  1040. @see http://php.net/manual/en/function.gmmktime.php
  1041. **/
  1042. static function gmmktime(?hour:Int, ?minute:Int, ?second:Int, ?month:Int, ?day:Int, ?year:Int, ?is_dst:Int):Int;
  1043. /**
  1044. @see http://php.net/manual/en/function.date.php
  1045. **/
  1046. static function date(format:String, ?timestamp:Int):EitherType<String, Bool>;
  1047. /**
  1048. @see http://php.net/manual/en/function.gmdate.php
  1049. **/
  1050. static function gmdate(format:String, ?timestamp:Int):EitherType<String, Bool>;
  1051. /**
  1052. @see http://php.net/manual/en/function.time.php
  1053. **/
  1054. static function time():Int;
  1055. /**
  1056. @see http://php.net/manual/en/function.strftime.php
  1057. **/
  1058. static function strftime(format:String, ?timestamp:Int):EitherType<String, Bool>;
  1059. /**
  1060. @see http://php.net/manual/en/function.strtotime.php
  1061. **/
  1062. static function strtotime(time:String, ?now:Int):EitherType<Int, Bool>;
  1063. /**
  1064. @see http://php.net/manual/en/function.flush.php
  1065. **/
  1066. static function flush():Void;
  1067. /**
  1068. @see http://php.net/manual/en/function.session-cache-limiter.php
  1069. **/
  1070. static function session_cache_limiter(?cache_limiter:String):String;
  1071. /**
  1072. @see http://php.net/manual/en/function.session-cache-expire.php
  1073. **/
  1074. static function session_cache_expire(?new_cache_expire:Int):Int;
  1075. /**
  1076. @see http://php.net/manual/en/function.session-name.php
  1077. **/
  1078. static function session_name(?name:String):String;
  1079. /**
  1080. @see http://php.net/manual/en/function.session-start.php
  1081. **/
  1082. static function session_start(?options:NativeArray):Bool;
  1083. /**
  1084. @see http://php.net/manual/en/function.session-unset.php
  1085. **/
  1086. static function session_unset():Void;
  1087. /**
  1088. @see http://php.net/manual/en/function.session-write-close.php
  1089. **/
  1090. static function session_write_close():Void;
  1091. /**
  1092. @see http://php.net/manual/en/function.session-id.php
  1093. **/
  1094. static function session_id(?id:String):String;
  1095. /**
  1096. @see http://php.net/manual/en/function.session-save-path.php
  1097. **/
  1098. static function session_save_path(?path:String):String;
  1099. /**
  1100. @see http://php.net/manual/en/function.session-module-name.php
  1101. **/
  1102. static function session_module_name(?module:String):String;
  1103. /**
  1104. @see http://php.net/manual/en/function.session-regenerate-id.php
  1105. **/
  1106. static function session_regenerate_id(delete_old_session:Bool = false):Bool;
  1107. /**
  1108. @see http://php.net/manual/en/function.session-set-cookie-params.php
  1109. **/
  1110. static function session_set_cookie_params(lifetime:Int, ?path:String, ?domain:String, secure:Bool = false, httponly:Bool = false):Bool;
  1111. /**
  1112. @see http://php.net/manual/en/function.session-get-cookie-params.php
  1113. **/
  1114. static function session_get_cookie_params():NativeAssocArray<Dynamic>;
  1115. /**
  1116. @see http://php.net/manual/en/function.session-set-save-handler.php
  1117. **/
  1118. @:overload(function(sessionhandler:SessionHandlerInterface, register_shutdown:Bool = true):Bool {})
  1119. static function session_set_save_handler(open:String->String->Bool, close:Void->Bool, read:String->String, write:String->String->Bool,
  1120. destroy:String->Bool, gc:Int->Bool, ?create_sid:Void->String, ?validate_sid:Function, ?update_timestamp:Function):Bool;
  1121. /**
  1122. @see http://php.net/manual/en/function.mail.php
  1123. **/
  1124. static function mail(to:String, subject:String, message:String, ?additional_headers:String, ?additional_parameters:String):Bool;
  1125. /**
  1126. @see http://php.net/manual/en/function.require.php
  1127. **/
  1128. static function require(include_path:String):Void;
  1129. /**
  1130. @see http://php.net/manual/en/function.require-once.php
  1131. **/
  1132. static function require_once(include_path:String):Void;
  1133. /**
  1134. @see http://php.net/manual/en/function.include.php
  1135. **/
  1136. static function include(include_path:String):Void;
  1137. /**
  1138. @see http://php.net/manual/en/function.include-once.php
  1139. **/
  1140. static function include_once(include_path:String):Void;
  1141. /**
  1142. @see http://php.net/manual/en/function.set-include-path.php
  1143. **/
  1144. static function set_include_path(new_include_path:String):String;
  1145. /**
  1146. @see http://php.net/manual/en/function.get-include-path.php
  1147. **/
  1148. static function get_include_path():String;
  1149. /**
  1150. @see http://php.net/manual/en/function.gzcompress.php
  1151. **/
  1152. static function gzcompress(data:String, ?level:Int, ?encoding:Int):EitherType<String, Bool>;
  1153. /**
  1154. @see http://php.net/manual/en/function.gzuncompress.php
  1155. **/
  1156. static function gzuncompress(data:String, ?length:Int):EitherType<String, Bool>;
  1157. /**
  1158. @see http://php.net/manual/en/function.move-uploaded-file.php
  1159. **/
  1160. static function move_uploaded_file(filename:String, destination:String):Bool;
  1161. /**
  1162. @see http://php.net/manual/en/function.is-uploaded-file.php
  1163. **/
  1164. static function is_uploaded_file(filename:String):Bool;
  1165. /**
  1166. @see http://php.net/manual/en/function.gc-collect-cycles.php
  1167. **/
  1168. static function gc_collect_cycles():Int;
  1169. }