Global.hx 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497
  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.strtr.php
  310. **/
  311. @:overload(function(str:String, from:NativeAssocArray<String>):String {})
  312. static function strtr(str:String, from:String, to:String):String;
  313. /**
  314. @see http://php.net/manual/en/function.str-repeat.php
  315. **/
  316. static function str_repeat(input:String, multiplier:Int):String;
  317. /**
  318. @see http://php.net/manual/en/function.str-replace.php
  319. **/
  320. static function str_replace(search:EitherType<String, NativeArray>, replace:EitherType<String, NativeArray>, subject:EitherType<String, NativeArray>,
  321. ?count:Int):EitherType<String, NativeArray>;
  322. /**
  323. @see http://php.net/manual/en/function.explode.php
  324. **/
  325. static function explode(delimiter:String, string:String, ?limit:Int):EitherType<Bool, NativeIndexedArray<String>>;
  326. /**
  327. @see http://php.net/manual/en/function.substr.php
  328. **/
  329. static function substr(string:String, start:Int, ?length:Int):EitherType<Bool, String>;
  330. /**
  331. @see http://php.net/manual/en/function.substr-count.php
  332. **/
  333. static function substr_count(haystack:String, needle:String, ?offset:Int, ?length:Int):Int;
  334. /**
  335. @see http://php.net/manual/en/function.substr_replace.php
  336. **/
  337. static function substr_replace(string:EitherType<String, NativeArray>, replacement:EitherType<String, NativeArray>, start:EitherType<Int, NativeArray>,
  338. ?length:EitherType<Int, NativeArray>):EitherType<String, NativeArray>;
  339. /**
  340. @see http://php.net/manual/en/function.strtoupper.php
  341. **/
  342. static function strtoupper(string:String):String;
  343. /**
  344. @see http://php.net/manual/en/function.strtolower.php
  345. **/
  346. static function strtolower(string:String):String;
  347. /**
  348. @see http://php.net/manual/en/function.debug-backtrace.php
  349. **/
  350. static function debug_backtrace(?options:Int, ?limit:Int):NativeIndexedArray<NativeAssocArray<Dynamic>>;
  351. /**
  352. @see http://php.net/manual/en/function.call-user-func.php
  353. **/
  354. static function call_user_func(callback:Dynamic, arguments:Rest<Dynamic>):Dynamic;
  355. /**
  356. @see http://php.net/manual/en/function.call-user-func-array.php
  357. **/
  358. static function call_user_func_array(callback:Dynamic, arguments:NativeArray):Dynamic;
  359. /**
  360. @see http://php.net/manual/en/function.func-get-args.php
  361. **/
  362. static function func_get_args():NativeIndexedArray<Dynamic>;
  363. /**
  364. @see http://php.net/manual/en/function.abs.php
  365. **/
  366. static function abs<T:Float>(number:T):T;
  367. /**
  368. @see http://php.net/manual/en/function.min.php
  369. **/
  370. static function min(values:Rest<Dynamic>):Dynamic;
  371. /**
  372. @see http://php.net/manual/en/function.max.php
  373. **/
  374. static function max(values:Rest<Dynamic>):Dynamic;
  375. /**
  376. @see http://php.net/manual/en/function.sin.php
  377. **/
  378. static function sin(arg:Float):Float;
  379. /**
  380. @see http://php.net/manual/en/function.cos.php
  381. **/
  382. static function cos(arg:Float):Float;
  383. /**
  384. @see http://php.net/manual/en/function.atan2.php
  385. **/
  386. static function atan2(y:Float, x:Float):Float;
  387. /**
  388. @see http://php.net/manual/en/function.tan.php
  389. **/
  390. static function tan(arg:Float):Float;
  391. /**
  392. @see http://php.net/manual/en/function.exp.php
  393. **/
  394. static function exp(arg:Float):Float;
  395. /**
  396. @see http://php.net/manual/en/function.log.php
  397. **/
  398. static function log(arg:Float):Float;
  399. /**
  400. @see http://php.net/manual/en/function.sqrt.php
  401. **/
  402. static function sqrt(arg:Float):Float;
  403. /**
  404. @see http://php.net/manual/en/function.floor.php
  405. **/
  406. static function floor(arg:Float):Float;
  407. /**
  408. @see http://php.net/manual/en/function.ceil.php
  409. **/
  410. static function ceil(arg:Float):Float;
  411. /**
  412. @see http://php.net/manual/en/function.round.php
  413. **/
  414. static function round(val:Float, precision:Int = 0, ?mode:Int):Float;
  415. /**
  416. @see http://php.net/manual/en/function.atan.php
  417. **/
  418. static function atan(arg:Float):Float;
  419. /**
  420. @see http://php.net/manual/en/function.asin.php
  421. **/
  422. static function asin(arg:Float):Float;
  423. /**
  424. @see http://php.net/manual/en/function.acos.php
  425. **/
  426. static function acos(arg:Float):Float;
  427. /**
  428. @see http://php.net/manual/en/function.pow.php
  429. **/
  430. static function pow(base:Float, exp:Float):Float;
  431. /**
  432. @see http://php.net/manual/en/function.mt-rand.php
  433. **/
  434. @:overload(function():Int {})
  435. static function mt_rand(base:Int, exp:Int):Int;
  436. /**
  437. @see http://php.net/manual/en/function.mt-getrandmax.php
  438. **/
  439. static function mt_getrandmax():Int;
  440. /**
  441. @see http://php.net/manual/en/function.is-nan.php
  442. **/
  443. static function is_nan(arg:Float):Bool;
  444. /**
  445. @see http://php.net/manual/en/function.is-finite.php
  446. **/
  447. static function is_finite(arg:Float):Bool;
  448. /**
  449. @see http://php.net/manual/en/function.trim.php
  450. **/
  451. static function trim(str:String, ?character_mask:String):String;
  452. /**
  453. @see http://php.net/manual/en/function.rtrim.php
  454. **/
  455. static function rtrim(str:String, ?character_mask:String):String;
  456. /**
  457. @see http://php.net/manual/en/function.ltrim.php
  458. **/
  459. static function ltrim(str:String, ?character_mask:String):String;
  460. /**
  461. @see http://php.net/manual/en/function.getenv.php
  462. **/
  463. static function getenv(varname:String):EitherType<String, Bool>;
  464. /**
  465. @see http://php.net/manual/en/function.putenv.php
  466. **/
  467. static function putenv(setting:String):Bool;
  468. /**
  469. @see http://php.net/manual/en/function.sleep.php
  470. **/
  471. static function sleep(seconds:Int):EitherType<Bool, Int>;
  472. /**
  473. @see http://php.net/manual/en/function.usleep.php
  474. **/
  475. static function usleep(micro_seconds:Int):Void;
  476. /**
  477. @see http://php.net/manual/en/function.setlocale.php
  478. **/
  479. @:overload(function(category:Int, locale:NativeIndexedArray<String>):EitherType<Bool, String> {})
  480. static function setlocale(category:Int, locale:Rest<String>):EitherType<Bool, String>;
  481. /**
  482. @see http://php.net/manual/en/function.getcwd.php
  483. **/
  484. static function getcwd():EitherType<String, Bool>;
  485. /**
  486. @see http://php.net/manual/en/function.chdir.php
  487. **/
  488. static function chdir(directory:String):Bool;
  489. /**
  490. @see http://php.net/manual/en/function.php-uname.php
  491. **/
  492. static function php_uname(mode:String = 'a'):String;
  493. /**
  494. @see http://php.net/manual/en/function.system.php
  495. **/
  496. static function system(command:String, ?return_var:Ref<Int>):EitherType<String, Bool>;
  497. /**
  498. @see http://php.net/manual/en/function.microtime.php
  499. **/
  500. static function microtime(get_as_float:Bool = false):EitherType<Float, String>;
  501. /**
  502. @see http://php.net/manual/en/function.fopen.php
  503. **/
  504. static function fopen(filename:String, mode:String, use_include_path:Bool = false, ?context:Resource):EitherType<Bool, Resource>;
  505. /**
  506. @see http://php.net/manual/en/function.fclose.php
  507. **/
  508. static function fclose(handle:Resource):Bool;
  509. /**
  510. @see http://php.net/manual/en/function.feof.php
  511. **/
  512. static function feof(handle:Resource):Bool;
  513. /**
  514. @see http://php.net/manual/en/function.fseek.php
  515. **/
  516. static function fseek(handle:Resource, offset:Int, ?whence:Int):EitherType<Int, Bool>;
  517. /**
  518. @see http://php.net/manual/en/function.ftell.php
  519. **/
  520. static function ftell(handle:Resource):EitherType<Int, Bool>;
  521. /**
  522. @see http://php.net/manual/en/function.rewind.php
  523. **/
  524. static function rewind(handle:Resource):Bool;
  525. /**
  526. @see http://php.net/manual/en/function.fgetc.php
  527. **/
  528. static function fgetc(handle:Resource):EitherType<Bool, String>;
  529. /**
  530. @see http://php.net/manual/en/function.fgets.php
  531. **/
  532. static function fgets(handle:Resource):EitherType<Bool, String>;
  533. /**
  534. @see http://php.net/manual/en/function.fflush.php
  535. **/
  536. static function fflush(handle:Resource):Bool;
  537. /**
  538. @see http://php.net/manual/en/function.fwrite.php
  539. **/
  540. static function fwrite(handle:Resource, string:String, ?length:Int):EitherType<Int, Bool>;
  541. /**
  542. @see http://php.net/manual/en/function.fread.php
  543. **/
  544. static function fread(handle:Resource, length:Int):EitherType<Bool, String>;
  545. /**
  546. @see http://php.net/manual/en/function.file-exists.php
  547. **/
  548. static function file_exists(filename:String):Bool;
  549. /**
  550. @see http://php.net/manual/en/function.file-get-contents.php
  551. **/
  552. static function file_get_contents(filename:String, use_include_path:Bool = false, ?context:Resource, offset:Int = 0, ?maxlen:Int):EitherType<String, Bool>;
  553. /**
  554. @see http://php.net/manual/en/function.file-put-contents.php
  555. **/
  556. static function file_put_contents(filename:String, data:Dynamic, flags:Int = 0, ?context:Resource):EitherType<Int, Bool>;
  557. /**
  558. @see http://php.net/manual/en/function.clearstatcache.php
  559. **/
  560. static function clearstatcache(clear_realpath_cache:Bool = false, ?filename:String):Bool;
  561. /**
  562. @see http://php.net/manual/en/function.fstat.php
  563. **/
  564. static function fstat(handle:Resource):NativeArray;
  565. /**
  566. @see http://php.net/manual/en/function.stat.php
  567. **/
  568. static function stat(filename:String):EitherType<NativeArray, Bool>;
  569. /**
  570. @see http://php.net/manual/en/function.realpath.php
  571. **/
  572. static function realpath(path:String):EitherType<String, Bool>;
  573. /**
  574. @see http://php.net/manual/en/function.filetype.php
  575. **/
  576. static function filetype(filename:String):EitherType<String, Bool>;
  577. /**
  578. @see http://php.net/manual/en/function.mkdir.php
  579. **/
  580. static function mkdir(pathname:String, mode:Int = 511, recursive:Bool = false, ?context:Resource):Bool;
  581. /**
  582. @see http://php.net/manual/en/function.unlink.php
  583. **/
  584. static function unlink(filename:String, ?context:Resource):Bool;
  585. /**
  586. @see http://php.net/manual/en/function.rmdir.php
  587. **/
  588. static function rmdir(dirname:String, ?context:Resource):Bool;
  589. /**
  590. @see http://php.net/manual/en/function.dirname.php
  591. **/
  592. static function dirname(path:String, levels:Int = 1):String;
  593. /**
  594. @see http://php.net/manual/en/function.glob.php
  595. **/
  596. static function glob(pattern:String, flags:Int = 0):NativeArray;
  597. /**
  598. @see http://php.net/manual/en/function.opendir.php
  599. **/
  600. static function opendir(path:String, ?context:Resource):EitherType<Resource, Bool>;
  601. /**
  602. @see http://php.net/manual/en/function.closedir.php
  603. **/
  604. static function closedir(dir_handle:Resource):Void;
  605. /**
  606. @see http://php.net/manual/en/function.readdir.php
  607. **/
  608. static function readdir(?dir_handle:Resource):EitherType<String, Bool>;
  609. /**
  610. @see http://php.net/manual/en/function.rewinddir.php
  611. **/
  612. static function rewinddir(?dir_handle:Resource):Void;
  613. /**
  614. @see http://php.net/manual/en/function.is-dir.php
  615. **/
  616. static function is_dir(filename:String):Bool;
  617. /**
  618. @see http://php.net/manual/en/function.is-executable.php
  619. **/
  620. static function is_executable(filename:String):Bool;
  621. /**
  622. @see http://php.net/manual/en/function.is-file.php
  623. **/
  624. static function is_file(filename:String):Bool;
  625. /**
  626. @see http://php.net/manual/en/function.is-link.php
  627. **/
  628. static function is_link(filename:String):Bool;
  629. /**
  630. @see http://php.net/manual/en/function.is-readable.php
  631. **/
  632. static function is_readable(filename:String):Bool;
  633. /**
  634. @see http://php.net/manual/en/function.is-writable.php
  635. **/
  636. static function is_writable(filename:String):Bool;
  637. /**
  638. @see http://php.net/manual/en/function.rename.php
  639. **/
  640. static function rename(oldname:String, newname:String, ?context:Resource):Bool;
  641. /**
  642. @see http://php.net/manual/en/function.copy.php
  643. **/
  644. static function copy(source:String, dest:String, ?context:Resource):Bool;
  645. /**
  646. @see http://php.net/manual/en/function.preg-match.php
  647. **/
  648. static function preg_match(pattern:String, subject:String, ?matches:NativeArray, ?flags:Int, ?offset:Int):EitherType<Bool, Int>;
  649. /**
  650. @see http://php.net/manual/en/function.preg-match-all.php
  651. **/
  652. static function preg_match_all(pattern:String, subject:String, ?matches:NativeArray, ?flags:Int, ?offset:Int):EitherType<Bool, Int>;
  653. /**
  654. @see http://php.net/manual/en/function.preg-quote.php
  655. **/
  656. static function preg_quote(str:String, ?delimiter:String):String;
  657. /**
  658. @see http://php.net/manual/en/function.preg-split.php
  659. **/
  660. static function preg_split(pattern:String, subject:String, limit:Int = -1, flags:Int = 0):EitherType<Bool, NativeArray>;
  661. /**
  662. @see http://php.net/manual/en/function.preg-replace.php
  663. **/
  664. static function preg_replace(pattern:EitherType<String, NativeArray>, replacement:EitherType<String, NativeArray>,
  665. subject:EitherType<String, NativeArray>, limit:Int = -1, ?count:Int):EitherType<String, NativeArray>;
  666. /**
  667. @see http://php.net/manual/en/function.preg-last-error.php
  668. **/
  669. static function preg_last_error():Int;
  670. /**
  671. @see http://php.net/manual/en/function.md5.php
  672. **/
  673. static function md5(str:String, raw_output:Bool = false):String;
  674. /**
  675. @see http://php.net/manual/en/function.sha1.php
  676. **/
  677. static function sha1(str:String, raw_output:Bool = false):String;
  678. /**
  679. @see http://php.net/manual/en/function.hash.php
  680. **/
  681. static function hash(algo:String, str:String, raw_output:Bool = false):String;
  682. /**
  683. @see http://php.net/manual/en/function.pack.php
  684. **/
  685. static function pack(format:String, args:Rest<Dynamic>):String;
  686. /**
  687. @see http://php.net/manual/en/function.unpack.php
  688. **/
  689. static function unpack(format:String, data:String):NativeArray;
  690. /**
  691. @see http://php.net/manual/en/function.chunk-split.php
  692. **/
  693. static function chunk_split(body:String, chunklen:Int = 76, end:String = "\r\n"):String;
  694. /**
  695. @see http://php.net/manual/en/function.urlencode.php
  696. **/
  697. static function urlencode(str:String):String;
  698. /**
  699. @see http://php.net/manual/en/function.urldecode.php
  700. **/
  701. static function urldecode(str:String):String;
  702. /**
  703. @see http://php.net/manual/en/function.rawurlencode.php
  704. **/
  705. static function rawurlencode(str:String):String;
  706. /**
  707. @see http://php.net/manual/en/function.rawurldecode.php
  708. **/
  709. static function rawurldecode(str:String):String;
  710. /**
  711. @see http://php.net/manual/en/function.header.php
  712. **/
  713. static function header(string:String, replace:Bool = true, ?http_response_code:Int):Void;
  714. /**
  715. @see http://php.net/manual/en/function.setcookie.php
  716. **/
  717. static function setcookie(name:String, value:String = "", expire:Int = 0, path:String = "", domain:String = "", secure:Bool = false,
  718. httponly:Bool = false):Bool;
  719. /**
  720. @see http://php.net/manual/en/function.htmlspecialchars.php
  721. **/
  722. static function htmlspecialchars(string:String, ?flags:Int, ?encoding:String, double_encode:Bool = true):String;
  723. /**
  724. @see http://php.net/manual/en/function.htmlspecialchars_decode.php
  725. **/
  726. static function htmlspecialchars_decode(string:String, ?flags:Int):String;
  727. /**
  728. @see http://php.net/manual/en/function.str-pad.php
  729. **/
  730. static function str_pad(input:String, pad_length:Int, pad_String:String = ' ', ?pad_type:Int):String;
  731. /**
  732. @see http://php.net/manual/en/function.dechex.php
  733. **/
  734. static function dechex(number:Int):String;
  735. /**
  736. @see http://php.net/manual/en/function.hexdec.php
  737. **/
  738. static function hexdec(hex_string:String):Int;
  739. /**
  740. @see http://php.net/manual/en/function.decbin.php
  741. **/
  742. static function decbin(number:Int):String;
  743. /**
  744. @see http://php.net/manual/en/function.bindec.php
  745. **/
  746. static function bindec(binary_string:String):Float;
  747. /**
  748. @see http://php.net/manual/en/function.bin2hex.php
  749. **/
  750. static function bin2hex(str:String):String;
  751. /**
  752. @see http://php.net/manual/en/function.hex2bin.php
  753. **/
  754. static function hex2bin(str:String):EitherType<String, Bool>;
  755. /**
  756. @see http://php.net/manual/en/function.serialize.php
  757. **/
  758. static function serialize(value:Dynamic):String;
  759. /**
  760. @see http://php.net/manual/en/function.unserialize.php
  761. **/
  762. static function unserialize(str:String, ?options:NativeArray):Dynamic;
  763. /**
  764. @see http://php.net/manual/en/function.extension-loaded.php
  765. **/
  766. static function extension_loaded(name:String):Bool;
  767. /**
  768. @see http://php.net/manual/en/function.strncasecmp.php
  769. **/
  770. static function strncasecmp(str1:String, str2:String, len:Int):Int;
  771. /**
  772. @see http://php.net/manual/en/function.strcasecmp.php
  773. **/
  774. static function strcasecmp(str1:String, str2:String):Int;
  775. /**
  776. @see http://php.net/manual/en/function.fpassthru.php
  777. **/
  778. static function fpassthru(handle:Resource):Int;
  779. /**
  780. @see http://php.net/manual/en/function.json-encode.php
  781. **/
  782. static function json_encode(value:Dynamic, options:Int = 0, depth:Int = 512):EitherType<String, Bool>;
  783. /**
  784. @see http://php.net/manual/en/function.json-decode.php
  785. **/
  786. static function json_decode(json:String, assoc:Bool = false, depth:Int = 512, options:Int = 512):Dynamic;
  787. /**
  788. @see http://php.net/manual/en/function.json-last-error.php
  789. **/
  790. static function json_last_error():Int;
  791. /**
  792. @see http://php.net/manual/en/function.json-last-error-msg.php
  793. **/
  794. static function json_last_error_msg():EitherType<String, Bool>;
  795. /**
  796. @see http://php.net/manual/en/function.spl-object-hash.php
  797. **/
  798. static function spl_object_hash(obj:{}):String;
  799. /**
  800. @see http://php.net/manual/en/function.spl-autoload-call.php
  801. **/
  802. static function spl_autoload_call(class_name:String):Void;
  803. /**
  804. @see http://php.net/manual/en/function.spl-autoload-extensions.php
  805. **/
  806. static function spl_autoload_extensions(?file_extensions:String):String;
  807. /**
  808. @see http://php.net/manual/en/function.spl-autoload-functions.php
  809. **/
  810. static function spl_autoload_functions():EitherType<NativeIndexedArray<Function>, Bool>;
  811. /**
  812. @see http://php.net/manual/en/function.spl-autoload-register.php
  813. **/
  814. static function spl_autoload_register(?autoload_function:(className:String) -> Void, throw_exception:Bool = true, prepend:Bool = false):Bool;
  815. /**
  816. @see http://php.net/manual/en/function.spl-autoload-unregister.php
  817. **/
  818. static function spl_autoload_unregister(autoload_function:(className:String) -> Void):Bool;
  819. /**
  820. @see http://php.net/manual/en/function.spl-autoload.php
  821. **/
  822. static function spl_autoload(class_name:String, ?file_extensions:String):Void;
  823. /**
  824. @see http://php.net/manual/en/function.utf8-encode.php
  825. **/
  826. static function utf8_encode(data:String):String;
  827. /**
  828. @see http://php.net/manual/en/function.utf8-decode.php
  829. **/
  830. static function utf8_decode(data:String):String;
  831. /**
  832. @see http://php.net/manual/en/function.mb-internal-encoding.php
  833. **/
  834. static function mb_internal_encoding(?encoding:String):EitherType<Bool, String>;
  835. /**
  836. @see http://php.net/manual/en/function.mb-convert-encoding.php
  837. **/
  838. static function mb_convert_encoding(str:String, to_encoding:String, ?from_encoding:Dynamic):String;
  839. /**
  840. @see http://php.net/manual/en/function.mb-check-encoding.php
  841. **/
  842. static function mb_check_encoding(str:String = null, ?encoding:String):Bool;
  843. /**
  844. @see http://php.net/manual/en/function.mb-split.php
  845. **/
  846. static function mb_split(pattern:String, str:String, ?limit:Int):NativeIndexedArray<String>;
  847. /**
  848. @see http://php.net/manual/en/function.mb-strlen.php
  849. **/
  850. static function mb_strlen(str:String, ?encoding:String):EitherType<Int, Bool>;
  851. /**
  852. @see http://php.net/manual/en/function.mb-substr.php
  853. **/
  854. static function mb_substr(str:String, start:Int, length:Int = null, ?encoding:String):String;
  855. /**
  856. @see http://php.net/manual/en/function.mb-chr.php
  857. (Polyfilled for php 7.0)
  858. **/
  859. static function mb_chr(cp:Int, ?encoding:String):String;
  860. /**
  861. @see http://php.net/manual/en/function.mb-ord.php
  862. (Polyfilled for php 7.0)
  863. **/
  864. static function mb_ord(str:String, ?encoding:String):Int;
  865. /**
  866. @see http://php.net/manual/en/function.mb-regex-encoding.php
  867. **/
  868. static function mb_regex_encoding(?encoding:String):EitherType<Bool, String>;
  869. /**
  870. @see http://php.net/manual/en/function.mb-strtoupper.php
  871. **/
  872. static function mb_strtoupper(str:String, ?encoding:String):String;
  873. /**
  874. @see http://php.net/manual/en/function.mb-strpos.php
  875. **/
  876. static function mb_strpos(haystack:String, needle:String, ?offset:Int, ?encoding:String):EitherType<Int, Bool>;
  877. /**
  878. @see http://php.net/manual/en/function.mb-strrpos.php
  879. **/
  880. static function mb_strrpos(haystack:String, needle:String, ?offset:Int, ?encoding:String):EitherType<Int, Bool>;
  881. /**
  882. @see http://php.net/manual/en/function.mb-strtolower.php
  883. **/
  884. static function mb_strtolower(str:String, ?encoding:String):String;
  885. /**
  886. @see http://php.net/manual/en/function.proc-open.php
  887. **/
  888. static function proc_open(cmd:String, descriptorspec:NativeArray, pipes:NativeIndexedArray<Resource>, ?cwd:String, ?env:NativeArray,
  889. ?other_options:NativeArray):EitherType<Resource, Bool>;
  890. /**
  891. @see http://php.net/manual/en/function.proc-get-status.php
  892. **/
  893. static function proc_get_status(process:Resource):EitherType<Bool, NativeAssocArray<Scalar>>;
  894. /**
  895. @see http://php.net/manual/en/function.proc-close.php
  896. **/
  897. static function proc_close(process:Resource):Int;
  898. /**
  899. @see http://php.net/manual/en/function.proc-terminate.php
  900. **/
  901. static function proc_terminate(process:Resource, signal:Int = 15):Bool;
  902. /**
  903. @see http://php.net/manual/en/function.stream-select.php
  904. **/
  905. static function stream_select(read:NativeArray, write:NativeArray, except:NativeArray, tv_sec:Int, tv_usec:Int = 0):Bool;
  906. /**
  907. @see http://php.net/manual/en/function.stream-get-contents.php
  908. **/
  909. static function stream_get_contents(handle:Resource, maxlength:Int = -1, offset:Int = -1):EitherType<String, Bool>;
  910. /**
  911. @see http://php.net/manual/en/function.stream-socket-shutdown.php
  912. **/
  913. static function stream_socket_shutdown(stream:Resource, how:Int):Bool;
  914. /**
  915. @see http://php.net/manual/en/function.stream-set-timeout.php
  916. **/
  917. static function stream_set_timeout(stream:Resource, seconds:Int, microseconds:Int = 0):Bool;
  918. /**
  919. @see http://php.net/manual/en/function.stream-set-blocking.php
  920. **/
  921. static function stream_set_blocking(stream:Resource, mode:Bool):Bool;
  922. /**
  923. @see http://php.net/manual/en/function.stream-socket-accept.php
  924. **/
  925. static function stream_socket_accept(server_socket:Resource, ?timeout:Float, ?peername:Ref<String>):EitherType<Resource, Bool>;
  926. /**
  927. @see http://php.net/manual/en/function.stream-socket-client.php
  928. **/
  929. static function stream_socket_client(remote_socket:String, ?errno:Ref<Int>, ?errstr:Ref<String>, ?timeout:Float, ?flags:Int,
  930. ?context:Resource):EitherType<Resource, Bool>;
  931. /**
  932. @see http://php.net/manual/en/function.stream-socket-server.php
  933. **/
  934. static function stream_socket_server(local_socket:String, ?errno:Ref<Int>, ?errstr:Ref<String>, ?flags:Int, ?context:Resource):EitherType<Resource, Bool>;
  935. /**
  936. @see http://php.net/manual/en/function.stream-socket-get-name.php
  937. **/
  938. static function stream_socket_get_name(stream:Resource, want_peer:Bool):EitherType<String, Bool>;
  939. /**
  940. @see http://php.net/manual/en/function.socket-create.php
  941. **/
  942. static function socket_create(domain:Int, type:Int, protocol:Int):Resource;
  943. /**
  944. @see http://php.net/manual/en/function.socket-connect.php
  945. **/
  946. static function socket_connect(stream:Resource, host:String, port:Int):Bool;
  947. /**
  948. @see http://php.net/manual/en/function.socket-listen.php
  949. **/
  950. static function socket_listen(stream:Resource, connections:Int):Bool;
  951. /**
  952. @see http://php.net/manual/en/function.socket-shutdown.php
  953. **/
  954. static function socket_shutdown(stream:Resource, rw:Int):Bool;
  955. /**
  956. @see http://php.net/manual/en/function.socket-bind.php
  957. **/
  958. static function socket_bind(stream:Resource, host:String, port:Int):Bool;
  959. /**
  960. @see http://php.net/manual/en/function.socket-accept.php
  961. **/
  962. static function socket_accept(stream:Resource):EitherType<Resource, Bool>;
  963. /**
  964. @see http://php.net/manual/en/function.socket-getpeername.php
  965. **/
  966. static function socket_getpeername(stream:Resource, host:Ref<String>, port:Ref<Int>):Bool;
  967. /**
  968. @see http://php.net/manual/en/function.socket-getsockname.php
  969. **/
  970. static function socket_getsockname(stream:Resource, host:Ref<String>, port:Ref<Int>):Bool;
  971. /**
  972. @see http://php.net/manual/en/function.socket-set-block.php
  973. **/
  974. static function socket_set_block(stream:Resource):Bool;
  975. /**
  976. @see http://php.net/manual/en/function.socket-set-nonblock.php
  977. **/
  978. static function socket_set_nonblock(stream:Resource):Bool;
  979. /**
  980. @see http://php.net/manual/en/function.socket-set-option.php
  981. **/
  982. static function socket_set_option(stream:Resource, level:Int, option:Int, val:Any):Bool;
  983. /**
  984. @see http://php.net/manual/en/function.socket-select.php
  985. **/
  986. static function socket_select(read:NativeIndexedArray<Resource>, write:NativeIndexedArray<Resource>, other:NativeIndexedArray<Resource>, tv_sec:Int = 0,
  987. tv_usec:Int = 0):EitherType<Bool, Int>;
  988. /**
  989. @see http://php.net/manual/en/function.socket-read.php
  990. **/
  991. static function socket_read(resource:Resource, length:Int, ?type:Int):EitherType<Bool, String>;
  992. /**
  993. @see http://php.net/manual/en/function.socket-write.php
  994. **/
  995. static function socket_write(resource:Resource, buffer:String, len:Int = 0):EitherType<Bool, Int>;
  996. /**
  997. @see http://php.net/manual/en/function.socket-import-stream.php
  998. **/
  999. static function socket_import_stream(resource:Resource):EitherType<Bool, Resource>;
  1000. /**
  1001. @see http://php.net/manual/en/function.socket-export-stream.php
  1002. **/
  1003. static function socket_export_stream(resource:Resource):EitherType<Bool, Resource>;
  1004. /**
  1005. @see http://php.net/manual/en/function.socket-close.php
  1006. **/
  1007. static function socket_close(resource:Resource):Void;
  1008. /**
  1009. @see http://php.net/manual/en/function.ini-get.php
  1010. **/
  1011. static function ini_get(var_name:String):EitherType<Bool, String>;
  1012. /**
  1013. @see http://php.net/manual/en/function.ini-set.php
  1014. **/
  1015. static function ini_set(var_name:String, newvalue:String):EitherType<Bool, String>;
  1016. /**
  1017. @see http://php.net/manual/en/function.sqlite-error-string.php
  1018. **/
  1019. static function sqlite_error_string(error_code:Int):String;
  1020. /**
  1021. @see http://php.net/manual/en/function.sqlite-escape-string.php
  1022. **/
  1023. static function sqlite_escape_string(item:String):String;
  1024. /**
  1025. @see http://php.net/manual/en/function.set-time-limit.php
  1026. **/
  1027. static function set_time_limit(seconds:Int):Bool;
  1028. /**
  1029. @see http://php.net/manual/en/function.function-exists.php
  1030. **/
  1031. static function function_exists(function_name:String):Bool;
  1032. /**
  1033. @see http://php.net/manual/en/function.getallheaders.php
  1034. **/
  1035. static function getallheaders():NativeAssocArray<Dynamic>;
  1036. /**
  1037. @see http://php.net/manual/en/function.ucwords.php
  1038. **/
  1039. static function ucwords(str:String, ?delimiters:String):String;
  1040. /**
  1041. @see http://php.net/manual/en/function.base64-encode.php
  1042. **/
  1043. static function base64_encode(data:String):String;
  1044. /**
  1045. @see http://php.net/manual/en/function.base64-decode.php
  1046. **/
  1047. static function base64_decode(data:String, strict:Bool = false):EitherType<String, Bool>;
  1048. /**
  1049. @see http://php.net/manual/en/function.gethostbyname.php
  1050. **/
  1051. static function gethostbyname(hostname:String):String;
  1052. /**
  1053. @see http://php.net/manual/en/function.gethostbyaddr.php
  1054. **/
  1055. static function gethostbyaddr(ip_address:String):EitherType<String, Bool>;
  1056. /**
  1057. @see http://php.net/manual/en/function.getprotobyname.php
  1058. **/
  1059. static function getprotobyname(name:String):EitherType<Int, Bool>;
  1060. /**
  1061. @see http://php.net/manual/en/function.mktime.php
  1062. **/
  1063. static function mktime(?hour:Int, ?minute:Int, ?second:Int, ?month:Int, ?day:Int, ?year:Int, ?is_dst:Int):EitherType<Int, Bool>;
  1064. /**
  1065. @see http://php.net/manual/en/function.gmmktime.php
  1066. **/
  1067. static function gmmktime(?hour:Int, ?minute:Int, ?second:Int, ?month:Int, ?day:Int, ?year:Int, ?is_dst:Int):Int;
  1068. /**
  1069. @see http://php.net/manual/en/function.date.php
  1070. **/
  1071. static function date(format:String, ?timestamp:Int):EitherType<String, Bool>;
  1072. /**
  1073. @see http://php.net/manual/en/function.gmdate.php
  1074. **/
  1075. static function gmdate(format:String, ?timestamp:Int):EitherType<String, Bool>;
  1076. /**
  1077. @see http://php.net/manual/en/function.time.php
  1078. **/
  1079. static function time():Int;
  1080. /**
  1081. @see http://php.net/manual/en/function.strftime.php
  1082. **/
  1083. static function strftime(format:String, ?timestamp:Int):EitherType<String, Bool>;
  1084. /**
  1085. @see http://php.net/manual/en/function.strtotime.php
  1086. **/
  1087. static function strtotime(time:String, ?now:Int):EitherType<Int, Bool>;
  1088. /**
  1089. @see http://php.net/manual/en/function.flush.php
  1090. **/
  1091. static function flush():Void;
  1092. /**
  1093. @see http://php.net/manual/en/function.session-cache-limiter.php
  1094. **/
  1095. static function session_cache_limiter(?cache_limiter:String):String;
  1096. /**
  1097. @see http://php.net/manual/en/function.session-cache-expire.php
  1098. **/
  1099. static function session_cache_expire(?new_cache_expire:Int):Int;
  1100. /**
  1101. @see http://php.net/manual/en/function.session-name.php
  1102. **/
  1103. static function session_name(?name:String):String;
  1104. /**
  1105. @see http://php.net/manual/en/function.session-start.php
  1106. **/
  1107. static function session_start(?options:NativeArray):Bool;
  1108. /**
  1109. @see http://php.net/manual/en/function.session-unset.php
  1110. **/
  1111. static function session_unset():Void;
  1112. /**
  1113. @see http://php.net/manual/en/function.session-write-close.php
  1114. **/
  1115. static function session_write_close():Void;
  1116. /**
  1117. @see http://php.net/manual/en/function.session-id.php
  1118. **/
  1119. static function session_id(?id:String):String;
  1120. /**
  1121. @see http://php.net/manual/en/function.session-save-path.php
  1122. **/
  1123. static function session_save_path(?path:String):String;
  1124. /**
  1125. @see http://php.net/manual/en/function.session-module-name.php
  1126. **/
  1127. static function session_module_name(?module:String):String;
  1128. /**
  1129. @see http://php.net/manual/en/function.session-regenerate-id.php
  1130. **/
  1131. static function session_regenerate_id(delete_old_session:Bool = false):Bool;
  1132. /**
  1133. @see http://php.net/manual/en/function.session-set-cookie-params.php
  1134. **/
  1135. @:overload(function(options:NativeStructArray<{?lifetime:Int, ?path:String, ?domain:String, ?secure:Bool, ?httponly:Bool, ?samesite:String}>):Bool {})
  1136. static function session_set_cookie_params(lifetime:Int, ?path:String, ?domain:String, secure:Bool = false, httponly:Bool = false):Bool;
  1137. /**
  1138. @see http://php.net/manual/en/function.session-get-cookie-params.php
  1139. **/
  1140. static function session_get_cookie_params():NativeAssocArray<Dynamic>;
  1141. /**
  1142. @see http://php.net/manual/en/function.session-set-save-handler.php
  1143. **/
  1144. @:overload(function(sessionhandler:SessionHandlerInterface, register_shutdown:Bool = true):Bool {})
  1145. static function session_set_save_handler(open:String->String->Bool, close:Void->Bool, read:String->String, write:String->String->Bool,
  1146. destroy:String->Bool, gc:Int->Bool, ?create_sid:Void->String, ?validate_sid:Function, ?update_timestamp:Function):Bool;
  1147. /**
  1148. @see http://php.net/manual/en/function.mail.php
  1149. **/
  1150. static function mail(to:String, subject:String, message:String, ?additional_headers:String, ?additional_parameters:String):Bool;
  1151. /**
  1152. @see http://php.net/manual/en/function.require.php
  1153. **/
  1154. static function require(include_path:String):Void;
  1155. /**
  1156. @see http://php.net/manual/en/function.require-once.php
  1157. **/
  1158. static function require_once(include_path:String):Void;
  1159. /**
  1160. @see http://php.net/manual/en/function.include.php
  1161. **/
  1162. static function include(include_path:String):Void;
  1163. /**
  1164. @see http://php.net/manual/en/function.include-once.php
  1165. **/
  1166. static function include_once(include_path:String):Void;
  1167. /**
  1168. @see http://php.net/manual/en/function.set-include-path.php
  1169. **/
  1170. static function set_include_path(new_include_path:String):String;
  1171. /**
  1172. @see http://php.net/manual/en/function.get-include-path.php
  1173. **/
  1174. static function get_include_path():String;
  1175. /**
  1176. @see http://php.net/manual/en/function.gzcompress.php
  1177. **/
  1178. static function gzcompress(data:String, ?level:Int, ?encoding:Int):EitherType<String, Bool>;
  1179. /**
  1180. @see http://php.net/manual/en/function.gzuncompress.php
  1181. **/
  1182. static function gzuncompress(data:String, ?length:Int):EitherType<String, Bool>;
  1183. /**
  1184. @see http://php.net/manual/en/function.move-uploaded-file.php
  1185. **/
  1186. static function move_uploaded_file(filename:String, destination:String):Bool;
  1187. /**
  1188. @see http://php.net/manual/en/function.is-uploaded-file.php
  1189. **/
  1190. static function is_uploaded_file(filename:String):Bool;
  1191. /**
  1192. @see http://php.net/manual/en/function.gc-collect-cycles.php
  1193. **/
  1194. static function gc_collect_cycles():Int;
  1195. /**
  1196. @see http://php.net/manual/en/function.cli-set-process-title.php
  1197. **/
  1198. static function cli_set_process_title(title:String):Bool;
  1199. /**
  1200. @see http://php.net/manual/en/function.http-response-code.php
  1201. **/
  1202. static function http_response_code(?response_code:Int):EitherType<Int, Bool>;
  1203. }