Global.hx 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131
  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-log.php
  20. **/
  21. static function error_log(message:String, message_type:Int = 0, ?destination:String, ?extra_headers:String):Bool;
  22. /**
  23. @see http://php.net/manual/en/function.error-reporting.php
  24. **/
  25. static function error_reporting(?level:Int):Int;
  26. /**
  27. @see http://php.net/manual/en/function.set-error-handler.php
  28. **/
  29. @:overload(function(error_handler:Int->String->Bool, ?error_types:Int):Dynamic {})
  30. @:overload(function(error_handler:Int->String->String->Bool, ?error_types:Int):Dynamic {})
  31. @:overload(function(error_handler:Int->String->String->Int->Bool, ?error_types:Int):Dynamic {})
  32. static function set_error_handler(?error_handler:Int->String->String->Int->Array<Dynamic>->Bool, ?error_types:Int):Dynamic;
  33. /**
  34. @see http://php.net/manual/en/function.restore-error-handler.php
  35. **/
  36. static function restore_error_handler():Bool;
  37. /**
  38. @see http://php.net/manual/en/function.set-exception-handler.php
  39. **/
  40. static function set_exception_handler(exception_handler:Throwable->Void):Dynamic;
  41. /**
  42. @see http://php.net/manual/en/function.restore-exception-handler.php
  43. **/
  44. static function restore_exception_handler():Bool;
  45. /**
  46. @see http://php.net/manual/en/function.is-int.php
  47. **/
  48. static function is_int(value:Dynamic):Bool;
  49. /**
  50. @see http://php.net/manual/en/function.is-float.php
  51. **/
  52. static function is_float(value:Dynamic):Bool;
  53. /**
  54. @see http://php.net/manual/en/function.is-string.php
  55. **/
  56. static function is_string(value:Dynamic):Bool;
  57. /**
  58. @see http://php.net/manual/en/function.is-numeric.php
  59. **/
  60. static function is_numeric(value:Dynamic):Bool;
  61. /**
  62. @see http://php.net/manual/en/function.is-bool.php
  63. **/
  64. static function is_bool(value:Dynamic):Bool;
  65. /**
  66. Checks if `values` is `php.NativeArray`
  67. @see http://php.net/manual/en/function.is-array.php
  68. **/
  69. static function is_array(value:Dynamic):Bool;
  70. /**
  71. @see http://php.net/manual/en/function.is-object.php
  72. **/
  73. static function is_object(value:Dynamic):Bool;
  74. /**
  75. @see http://php.net/manual/en/function.is-null.php
  76. **/
  77. static function is_null(value:Dynamic):Bool;
  78. /**
  79. @see http://php.net/manual/en/function.is-subclass-of.php
  80. **/
  81. static function is_subclass_of(value:Dynamic, className:String, allow_string:Bool = true):Bool;
  82. /**
  83. @see http://php.net/manual/en/function.class-exists.php
  84. **/
  85. static function class_exists(class_name:String, autoload:Bool = true):Bool;
  86. /**
  87. @see http://php.net/manual/en/function.interface-exists.php
  88. **/
  89. static function interface_exists(interface_name:String, autoload:Bool = true):Bool;
  90. /**
  91. @see http://php.net/manual/en/function.intval.php
  92. **/
  93. static function intval(value:Dynamic, base:Int = 10):Int;
  94. /**
  95. @see http://php.net/manual/en/function.floatval.php
  96. **/
  97. static function floatval(value:Dynamic):Float;
  98. /**
  99. @see http://php.net/manual/en/function.boolval.php
  100. **/
  101. static function boolval(value:Dynamic):Bool;
  102. /**
  103. @see http://php.net/manual/en/function.strval.php
  104. **/
  105. static function strval(value:Dynamic):String;
  106. /**
  107. @see http://php.net/manual/en/function.phpversion.php
  108. **/
  109. static function phpversion(?extension:String):String;
  110. /**
  111. @see http://php.net/manual/en/function.class-alias.php
  112. **/
  113. static function class_alias(original:String, alias:String, autoload:Bool = true):Bool;
  114. /**
  115. @see http://php.net/manual/en/function.count.php
  116. **/
  117. static function count(array:Dynamic, ?mode:Int):Int;
  118. /**
  119. @see http://php.net/manual/en/function.array-filter.php
  120. **/
  121. @:overload(function(array:NativeArray, callback:Dynamic->Bool, ?flag:Int):NativeArray {})
  122. static function array_filter(array:NativeArray, ?callback:Dynamic->?Dynamic->Bool, flag:Int = 0):NativeArray;
  123. /**
  124. @see http://php.net/manual/en/function.implode.php
  125. **/
  126. @:overload(function(pieces:NativeArray):String {})
  127. static function implode(glue:String, pieces:NativeArray):String;
  128. /**
  129. @see http://php.net/manual/en/function.array-map.php
  130. **/
  131. static function array_map(callback:EitherType<Dynamic->Dynamic, String>, array:Rest<NativeArray>):NativeArray;
  132. /**
  133. @see http://php.net/manual/en/function.array-merge.php
  134. **/
  135. static function array_merge(array:Rest<NativeArray>):NativeArray;
  136. /**
  137. @see http://php.net/manual/en/function.array-diff.php
  138. **/
  139. static function array_diff(array:Rest<NativeArray>):NativeArray;
  140. /**
  141. @see http://php.net/manual/en/function.array-pop.php
  142. **/
  143. static function array_pop(array:NativeArray):Dynamic;
  144. /**
  145. @see http://php.net/manual/en/function.array-push.php
  146. **/
  147. static function array_push(array:Ref<NativeArray>, value:Rest<Dynamic>):Int;
  148. /**
  149. @see http://php.net/manual/en/function.array-reverse.php
  150. **/
  151. static function array_reverse(array:NativeArray, preserve_keys:Bool = false):NativeArray;
  152. /**
  153. @see http://php.net/manual/en/function.array-search.php
  154. **/
  155. static function array_search(needle:Dynamic, haystack:NativeArray, strict:Bool = false):EitherType<Bool, EitherType<String, Int>>;
  156. /**
  157. @see http://php.net/manual/en/function.array-shift.php
  158. **/
  159. static function array_shift(array:Ref<NativeArray>):Dynamic;
  160. /**
  161. @see http://php.net/manual/en/function.array-slice.php
  162. **/
  163. static function array_slice(array:NativeArray, offset:Int, length:Int = null, preserve_keys:Bool = false):NativeArray;
  164. /**
  165. @see http://php.net/manual/en/function.array-splice.php
  166. **/
  167. static function array_splice(array:Ref<NativeArray>, offset:Int, lenght:Int = 0, ?replacement:Dynamic):NativeArray;
  168. /**
  169. @see http://php.net/manual/en/function.array-unshift.php
  170. **/
  171. static function array_unshift(arr:Ref<NativeArray>, value:Rest<Dynamic>):Int;
  172. /**
  173. @see http://php.net/manual/en/function.array-values.php
  174. **/
  175. static function array_values(arr:NativeArray):NativeIndexedArray<Dynamic>;
  176. /**
  177. @see http://php.net/manual/en/function.array-keys.php
  178. **/
  179. static function array_keys(arr:NativeArray):NativeIndexedArray<EitherType<String, Int>>;
  180. /**
  181. @see http://php.net/manual/en/function.array-key-exists.php
  182. **/
  183. static function array_key_exists(key:EitherType<String, Int>, arr:NativeArray):Bool;
  184. /**
  185. @see http://php.net/manual/en/function.array-fill.php
  186. **/
  187. static function array_fill(start_index:Int, num:Int, value:Dynamic):NativeArray;
  188. /**
  189. @see http://php.net/manual/en/function.array-pad.php
  190. **/
  191. static function array_pad(array:NativeArray, size:Int, value:Dynamic):NativeArray;
  192. /**
  193. @see http://php.net/manual/en/function.in-array.php
  194. **/
  195. static function in_array(needle:Dynamic, haystack:NativeArray, strict:Bool = false):Bool;
  196. /**
  197. @see http://php.net/manual/en/function.usort.php
  198. **/
  199. static function usort(array:Ref<NativeArray>, value_compare_func:Dynamic->Dynamic->Int):Bool;
  200. /**
  201. @see http://php.net/manual/en/function.reset.php
  202. **/
  203. static function reset(array:Ref<NativeArray>):Dynamic;
  204. /**
  205. @see http://php.net/manual/en/function.current.php
  206. **/
  207. static function current(array:Ref<NativeArray>):Dynamic;
  208. /**
  209. @see http://php.net/manual/en/function.next.php
  210. **/
  211. static function next(array:Ref<NativeArray>):Dynamic;
  212. /**
  213. @see http://php.net/manual/en/function.prev.php
  214. **/
  215. static function prev(array:Ref<NativeArray>):Dynamic;
  216. /**
  217. @see http://php.net/manual/en/function.end.php
  218. **/
  219. static function end(array:Ref<NativeArray>):Dynamic;
  220. /**
  221. @see http://php.net/manual/en/function.key.php
  222. **/
  223. static function key(array:NativeArray):EitherType<String, Int>;
  224. /**
  225. @see http://php.net/manual/en/function.each.php
  226. **/
  227. static function each(array:Ref<NativeArray>):NativeArray;
  228. /**
  229. @see http://php.net/manual/en/function.defined.php
  230. **/
  231. static function defined(name:String):Bool;
  232. /**
  233. @see http://php.net/manual/en/function.constant.php
  234. **/
  235. static function constant(name:String):Dynamic;
  236. /**
  237. @see http://php.net/manual/en/function.define.php
  238. **/
  239. static function define(name:String, value:Dynamic, case_insensitive:Bool = false):Bool;
  240. /**
  241. @see http://php.net/manual/en/function.echo.php
  242. **/
  243. static function echo(args:Rest<String>):Void;
  244. /**
  245. @see http://php.net/manual/en/function.print-r.php
  246. **/
  247. static function print_r(expression:Any, ?returnOutput:Bool):EitherType<Bool, String>;
  248. /**
  249. @see http://php.net/manual/en/function.sprintf.php
  250. **/
  251. static function sprintf(format:String, args:Rest<Dynamic>):EitherType<String, Bool>;
  252. /**
  253. @see http://php.net/manual/en/function.method-exists.php
  254. **/
  255. static function method_exists(object:Dynamic, method_name:String):Bool;
  256. /**
  257. @see http://php.net/manual/en/function.property-exists.php
  258. **/
  259. static function property_exists(object:Dynamic, property_name:String):Bool;
  260. /**
  261. @see http://php.net/manual/en/function.is-callable.php
  262. **/
  263. static function is_callable(value:Dynamic, syntax_only:Bool = false, ?callable_name:String):Bool;
  264. /**
  265. @see http://php.net/manual/en/function.isset.php
  266. **/
  267. static function isset(value:Dynamic, args:Rest<Dynamic>):Bool;
  268. /**
  269. @see http://php.net/manual/en/function.unset.php
  270. **/
  271. static function unset(value:Dynamic, values:Rest<Dynamic>):Void;
  272. /**
  273. @see http://php.net/manual/en/function.get-object-vars.php
  274. **/
  275. static function get_object_vars(object:{}):NativeAssocArray<Dynamic>;
  276. /**
  277. @see http://php.net/manual/en/function.get-class.php
  278. **/
  279. static function get_class(object:{} = null):EitherType<Bool, String>;
  280. /**
  281. @see http://php.net/manual/en/function.get-parent-class.php
  282. **/
  283. static function get_parent_class(?object:Dynamic):EitherType<Bool, String>;
  284. /**
  285. @see http://php.net/manual/en/function.var-dump.php
  286. **/
  287. static function var_dump(args:Rest<Dynamic>):Void;
  288. /**
  289. @see http://php.net/manual/en/function.ord.php
  290. **/
  291. static function ord(string:String):Int;
  292. /**
  293. @see http://php.net/manual/en/function.chr.php
  294. **/
  295. static function chr(code:Int):String;
  296. /**
  297. @see http://php.net/manual/en/function.strpos.php
  298. **/
  299. static function strpos(haystack:String, needle:String, offset:Int = 0):EitherType<Bool, Int>;
  300. /**
  301. @see http://php.net/manual/en/function.stripos.php
  302. **/
  303. static function stripos(haystack:String, needle:String, offset:Int = 0):EitherType<Bool, Int>;
  304. /**
  305. @see http://php.net/manual/en/function.strrpos.php
  306. **/
  307. static function strrpos(haystack:String, needle:String, offset:Int = 0):EitherType<Bool, Int>;
  308. /**
  309. @see http://php.net/manual/en/function.str-split.php
  310. **/
  311. static function str_split(string:String, split_length:Int = 1):EitherType<Bool, NativeIndexedArray<String>>;
  312. /**
  313. @see http://php.net/manual/en/function.strlen.php
  314. **/
  315. static function strlen(string:String):Int;
  316. /**
  317. @see http://php.net/manual/en/function.strcmp.php
  318. **/
  319. static function strcmp(str1:String, str2:String):Int;
  320. /**
  321. @see https://www.php.net/manual/en/function.strspn.php
  322. **/
  323. static function strspn(string:String, characters:String, offset:Int = 0, ?length:Int):Int;
  324. /**
  325. @see http://php.net/manual/en/function.strtr.php
  326. **/
  327. @:overload(function(str:String, from:NativeAssocArray<String>):String {})
  328. static function strtr(str:String, from:String, to:String):String;
  329. /**
  330. @see http://php.net/manual/en/function.str-repeat.php
  331. **/
  332. static function str_repeat(input:String, multiplier:Int):String;
  333. /**
  334. @see http://php.net/manual/en/function.str-replace.php
  335. **/
  336. static function str_replace(search:EitherType<String, NativeArray>, replace:EitherType<String, NativeArray>, subject:EitherType<String, NativeArray>,
  337. ?count:Int):EitherType<String, NativeArray>;
  338. /**
  339. @see https://www.php.net/manual/en/function.str-starts-with.php
  340. **/
  341. static function str_starts_with(haystack:String, needle:String):Bool;
  342. /**
  343. @see http://php.net/manual/en/function.explode.php
  344. **/
  345. static function explode(delimiter:String, string:String, ?limit:Int):EitherType<Bool, NativeIndexedArray<String>>;
  346. /**
  347. @see http://php.net/manual/en/function.substr.php
  348. **/
  349. static function substr(string:String, start:Int, ?length:Int):EitherType<Bool, String>;
  350. /**
  351. @see http://php.net/manual/en/function.substr-count.php
  352. **/
  353. static function substr_count(haystack:String, needle:String, ?offset:Int, ?length:Int):Int;
  354. /**
  355. @see http://php.net/manual/en/function.substr_replace.php
  356. **/
  357. static function substr_replace(string:EitherType<String, NativeArray>, replacement:EitherType<String, NativeArray>, start:EitherType<Int, NativeArray>,
  358. ?length:EitherType<Int, NativeArray>):EitherType<String, NativeArray>;
  359. /**
  360. @see http://php.net/manual/en/function.strtoupper.php
  361. **/
  362. static function strtoupper(string:String):String;
  363. /**
  364. @see http://php.net/manual/en/function.strtolower.php
  365. **/
  366. static function strtolower(string:String):String;
  367. /**
  368. @see http://php.net/manual/en/function.debug-backtrace.php
  369. **/
  370. static function debug_backtrace(?options:Int, ?limit:Int):NativeIndexedArray<NativeAssocArray<Dynamic>>;
  371. /**
  372. @see http://php.net/manual/en/function.call-user-func.php
  373. **/
  374. static function call_user_func(callback:Dynamic, arguments:Rest<Dynamic>):Dynamic;
  375. /**
  376. @see http://php.net/manual/en/function.call-user-func-array.php
  377. **/
  378. static function call_user_func_array(callback:Dynamic, arguments:NativeArray):Dynamic;
  379. /**
  380. @see http://php.net/manual/en/function.func-get-args.php
  381. **/
  382. static function func_get_args():NativeIndexedArray<Dynamic>;
  383. /**
  384. @see http://php.net/manual/en/function.abs.php
  385. **/
  386. static function abs<T:Float>(number:T):T;
  387. /**
  388. @see http://php.net/manual/en/function.min.php
  389. **/
  390. static function min(values:Rest<Dynamic>):Dynamic;
  391. /**
  392. @see http://php.net/manual/en/function.max.php
  393. **/
  394. static function max(values:Rest<Dynamic>):Dynamic;
  395. /**
  396. @see http://php.net/manual/en/function.sin.php
  397. **/
  398. static function sin(arg:Float):Float;
  399. /**
  400. @see http://php.net/manual/en/function.cos.php
  401. **/
  402. static function cos(arg:Float):Float;
  403. /**
  404. @see http://php.net/manual/en/function.atan2.php
  405. **/
  406. static function atan2(y:Float, x:Float):Float;
  407. /**
  408. @see http://php.net/manual/en/function.tan.php
  409. **/
  410. static function tan(arg:Float):Float;
  411. /**
  412. @see http://php.net/manual/en/function.exp.php
  413. **/
  414. static function exp(arg:Float):Float;
  415. /**
  416. @see http://php.net/manual/en/function.log.php
  417. **/
  418. static function log(arg:Float):Float;
  419. /**
  420. @see http://php.net/manual/en/function.sqrt.php
  421. **/
  422. static function sqrt(arg:Float):Float;
  423. /**
  424. @see http://php.net/manual/en/function.floor.php
  425. **/
  426. static function floor(arg:Float):Float;
  427. /**
  428. @see http://php.net/manual/en/function.ceil.php
  429. **/
  430. static function ceil(arg:Float):Float;
  431. /**
  432. @see http://php.net/manual/en/function.round.php
  433. **/
  434. static function round(val:Float, precision:Int = 0, ?mode:Int):Float;
  435. /**
  436. @see http://php.net/manual/en/function.atan.php
  437. **/
  438. static function atan(arg:Float):Float;
  439. /**
  440. @see http://php.net/manual/en/function.asin.php
  441. **/
  442. static function asin(arg:Float):Float;
  443. /**
  444. @see http://php.net/manual/en/function.acos.php
  445. **/
  446. static function acos(arg:Float):Float;
  447. /**
  448. @see http://php.net/manual/en/function.pow.php
  449. **/
  450. static function pow(base:Float, exp:Float):Float;
  451. /**
  452. @see http://php.net/manual/en/function.mt-rand.php
  453. **/
  454. @:overload(function():Int {})
  455. static function mt_rand(base:Int, exp:Int):Int;
  456. /**
  457. @see http://php.net/manual/en/function.mt-getrandmax.php
  458. **/
  459. static function mt_getrandmax():Int;
  460. /**
  461. @see http://php.net/manual/en/function.random-bytes.php
  462. **/
  463. static function random_bytes(length:Int):String;
  464. /**
  465. @see http://php.net/manual/en/function.random-int.php
  466. **/
  467. static function random_int(min:Int, max:Int):Int;
  468. /**
  469. @see http://php.net/manual/en/function.is-nan.php
  470. **/
  471. static function is_nan(arg:Float):Bool;
  472. /**
  473. @see http://php.net/manual/en/function.is-finite.php
  474. **/
  475. static function is_finite(arg:Float):Bool;
  476. /**
  477. @see http://php.net/manual/en/function.trim.php
  478. **/
  479. static function trim(str:String, ?character_mask:String):String;
  480. /**
  481. @see http://php.net/manual/en/function.rtrim.php
  482. **/
  483. static function rtrim(str:String, ?character_mask:String):String;
  484. /**
  485. @see http://php.net/manual/en/function.ltrim.php
  486. **/
  487. static function ltrim(str:String, ?character_mask:String):String;
  488. /**
  489. @see http://php.net/manual/en/function.getenv.php
  490. **/
  491. static function getenv(varname:String):EitherType<String, Bool>;
  492. /**
  493. @see http://php.net/manual/en/function.putenv.php
  494. **/
  495. static function putenv(setting:String):Bool;
  496. /**
  497. @see http://php.net/manual/en/function.sleep.php
  498. **/
  499. static function sleep(seconds:Int):EitherType<Bool, Int>;
  500. /**
  501. @see http://php.net/manual/en/function.usleep.php
  502. **/
  503. static function usleep(micro_seconds:Int):Void;
  504. /**
  505. @see http://php.net/manual/en/function.setlocale.php
  506. **/
  507. @:overload(function(category:Int, locale:NativeIndexedArray<String>):EitherType<Bool, String> {})
  508. static function setlocale(category:Int, locale:Rest<String>):EitherType<Bool, String>;
  509. /**
  510. @see http://php.net/manual/en/function.getcwd.php
  511. **/
  512. static function getcwd():EitherType<String, Bool>;
  513. /**
  514. @see http://php.net/manual/en/function.chdir.php
  515. **/
  516. static function chdir(directory:String):Bool;
  517. /**
  518. @see http://php.net/manual/en/function.php-uname.php
  519. **/
  520. static function php_uname(mode:String = 'a'):String;
  521. /**
  522. @see http://php.net/manual/en/function.system.php
  523. **/
  524. static function system(command:String, ?return_var:Ref<Int>):EitherType<String, Bool>;
  525. /**
  526. @see http://php.net/manual/en/function.microtime.php
  527. **/
  528. static function microtime(get_as_float:Bool = false):EitherType<Float, String>;
  529. /**
  530. @see http://php.net/manual/en/function.fopen.php
  531. **/
  532. static function fopen(filename:String, mode:String, use_include_path:Bool = false, ?context:Resource):EitherType<Bool, Resource>;
  533. /**
  534. @see http://php.net/manual/en/function.fclose.php
  535. **/
  536. static function fclose(handle:Resource):Bool;
  537. /**
  538. @see http://php.net/manual/en/function.feof.php
  539. **/
  540. static function feof(handle:Resource):Bool;
  541. /**
  542. @see http://php.net/manual/en/function.fseek.php
  543. **/
  544. static function fseek(handle:Resource, offset:Int, ?whence:Int):Int;
  545. /**
  546. @see http://php.net/manual/en/function.ftell.php
  547. **/
  548. static function ftell(handle:Resource):EitherType<Int, Bool>;
  549. /**
  550. @see http://php.net/manual/en/function.rewind.php
  551. **/
  552. static function rewind(handle:Resource):Bool;
  553. /**
  554. @see http://php.net/manual/en/function.fgetc.php
  555. **/
  556. static function fgetc(handle:Resource):EitherType<Bool, String>;
  557. /**
  558. @see http://php.net/manual/en/function.fgets.php
  559. **/
  560. static function fgets(handle:Resource):EitherType<Bool, String>;
  561. /**
  562. @see http://php.net/manual/en/function.fflush.php
  563. **/
  564. static function fflush(handle:Resource):Bool;
  565. /**
  566. @see http://php.net/manual/en/function.flock.php
  567. **/
  568. static function flock(handle:Resource, operation:Int, ?wouldblock:Ref<Int>):Bool;
  569. /**
  570. @see http://php.net/manual/en/function.fwrite.php
  571. **/
  572. static function fwrite(handle:Resource, string:String, ?length:Int):EitherType<Int, Bool>;
  573. /**
  574. @see http://php.net/manual/en/function.fread.php
  575. **/
  576. static function fread(handle:Resource, length:Int):EitherType<Bool, String>;
  577. /**
  578. @see http://php.net/manual/en/function.file-exists.php
  579. **/
  580. static function file_exists(filename:String):Bool;
  581. /**
  582. @see http://php.net/manual/en/function.file-get-contents.php
  583. **/
  584. static function file_get_contents(filename:String, use_include_path:Bool = false, ?context:Resource, offset:Int = 0, ?maxlen:Int):EitherType<String, Bool>;
  585. /**
  586. @see http://php.net/manual/en/function.file-put-contents.php
  587. **/
  588. static function file_put_contents(filename:String, data:Dynamic, flags:Int = 0, ?context:Resource):EitherType<Int, Bool>;
  589. /**
  590. @see http://php.net/manual/en/function.fileatime.php
  591. **/
  592. static function fileatime(filename:String):EitherType<Int, Bool>;
  593. /**
  594. @see http://php.net/manual/en/function.filectime.php
  595. **/
  596. static function filectime(filename:String):EitherType<Int, Bool>;
  597. /**
  598. @see http://php.net/manual/en/function.filemtime.php
  599. **/
  600. static function filemtime(filename:String):EitherType<Int, Bool>;
  601. /**
  602. @see http://php.net/manual/en/function.fileowner.php
  603. **/
  604. static function fileowner(filename:String):EitherType<Int, Bool>;
  605. /**
  606. @see http://php.net/manual/en/function.filesize.php
  607. **/
  608. static function filesize(filename:String):EitherType<Int, Bool>;
  609. /**
  610. @see http://php.net/manual/en/function.clearstatcache.php
  611. **/
  612. static function clearstatcache(clear_realpath_cache:Bool = false, ?filename:String):Bool;
  613. /**
  614. @see http://php.net/manual/en/function.fstat.php
  615. **/
  616. static function fstat(handle:Resource):NativeArray;
  617. /**
  618. @see http://php.net/manual/en/function.stat.php
  619. **/
  620. static function stat(filename:String):EitherType<NativeArray, Bool>;
  621. /**
  622. @see http://php.net/manual/en/function.fnmatch.php
  623. **/
  624. static function fnmatch(pattern:String, string:String, flags:Int = 0):Bool;
  625. /**
  626. @see http://php.net/manual/en/function.pathinfo.php
  627. **/
  628. static function pathinfo(path:String, ?options:Int):EitherType<String, NativeAssocArray<String>>;
  629. /**
  630. @see http://php.net/manual/en/function.realpath.php
  631. **/
  632. static function realpath(path:String):EitherType<String, Bool>;
  633. /**
  634. @see http://php.net/manual/en/function.filetype.php
  635. **/
  636. static function filetype(filename:String):EitherType<String, Bool>;
  637. /**
  638. @see http://php.net/manual/en/function.mkdir.php
  639. **/
  640. static function mkdir(pathname:String, mode:Int = 511, recursive:Bool = false, ?context:Resource):Bool;
  641. /**
  642. @see http://php.net/manual/en/function.link.php
  643. **/
  644. static function link(target:String, link:String):Bool;
  645. /**
  646. @see http://php.net/manual/en/function.symlink.php
  647. **/
  648. static function symlink(target:String, link:String):Bool;
  649. /**
  650. @see http://php.net/manual/en/function.unlink.php
  651. **/
  652. static function unlink(filename:String, ?context:Resource):Bool;
  653. /**
  654. @see http://php.net/manual/en/function.rmdir.php
  655. **/
  656. static function rmdir(dirname:String, ?context:Resource):Bool;
  657. /**
  658. @see http://php.net/manual/en/function.dirname.php
  659. **/
  660. static function dirname(path:String, levels:Int = 1):String;
  661. /**
  662. @see http://php.net/manual/en/function.basename.php
  663. **/
  664. static function basename(path:String, ?suffix:String):String;
  665. /**
  666. @see http://php.net/manual/en/function.glob.php
  667. **/
  668. static function glob(pattern:String, flags:Int = 0):NativeArray;
  669. /**
  670. @see http://php.net/manual/en/function.opendir.php
  671. **/
  672. static function opendir(path:String, ?context:Resource):EitherType<Resource, Bool>;
  673. /**
  674. @see http://php.net/manual/en/function.closedir.php
  675. **/
  676. static function closedir(dir_handle:Resource):Void;
  677. /**
  678. @see http://php.net/manual/en/function.readdir.php
  679. **/
  680. static function readdir(?dir_handle:Resource):EitherType<String, Bool>;
  681. /**
  682. @see http://php.net/manual/en/function.readlink.php
  683. **/
  684. static function readlink(filename:String):EitherType<Bool,String>;
  685. /**
  686. @see http://php.net/manual/en/function.rewinddir.php
  687. **/
  688. static function rewinddir(?dir_handle:Resource):Void;
  689. /**
  690. @see http://php.net/manual/en/function.is-dir.php
  691. **/
  692. static function is_dir(filename:String):Bool;
  693. /**
  694. @see http://php.net/manual/en/function.is-executable.php
  695. **/
  696. static function is_executable(filename:String):Bool;
  697. /**
  698. @see http://php.net/manual/en/function.is-file.php
  699. **/
  700. static function is_file(filename:String):Bool;
  701. /**
  702. @see http://php.net/manual/en/function.is-link.php
  703. **/
  704. static function is_link(filename:String):Bool;
  705. /**
  706. @see http://php.net/manual/en/function.is-readable.php
  707. **/
  708. static function is_readable(filename:String):Bool;
  709. /**
  710. @see http://php.net/manual/en/function.is-writable.php
  711. **/
  712. static function is_writable(filename:String):Bool;
  713. /**
  714. @see http://php.net/manual/en/function.rename.php
  715. **/
  716. static function rename(oldname:String, newname:String, ?context:Resource):Bool;
  717. /**
  718. @see http://php.net/manual/en/function.copy.php
  719. **/
  720. static function copy(source:String, dest:String, ?context:Resource):Bool;
  721. /**
  722. @see http://php.net/manual/en/function.preg-match.php
  723. **/
  724. static function preg_match(pattern:String, subject:String, ?matches:NativeArray, ?flags:Int, ?offset:Int):EitherType<Bool, Int>;
  725. /**
  726. @see http://php.net/manual/en/function.preg-match-all.php
  727. **/
  728. static function preg_match_all(pattern:String, subject:String, ?matches:NativeArray, ?flags:Int, ?offset:Int):EitherType<Bool, Int>;
  729. /**
  730. @see http://php.net/manual/en/function.preg-quote.php
  731. **/
  732. static function preg_quote(str:String, ?delimiter:String):String;
  733. /**
  734. @see http://php.net/manual/en/function.preg-split.php
  735. **/
  736. static function preg_split(pattern:String, subject:String, limit:Int = -1, flags:Int = 0):EitherType<Bool, NativeArray>;
  737. /**
  738. @see http://php.net/manual/en/function.preg-replace.php
  739. **/
  740. static function preg_replace(pattern:EitherType<String, NativeArray>, replacement:EitherType<String, NativeArray>,
  741. subject:EitherType<String, NativeArray>, limit:Int = -1, ?count:Int):EitherType<String, NativeArray>;
  742. /**
  743. @see http://php.net/manual/en/function.preg-last-error.php
  744. **/
  745. static function preg_last_error():Int;
  746. /**
  747. @see http://php.net/manual/en/function.md5.php
  748. **/
  749. static function md5(str:String, raw_output:Bool = false):String;
  750. /**
  751. @see http://php.net/manual/en/function.sha1.php
  752. **/
  753. static function sha1(str:String, raw_output:Bool = false):String;
  754. /**
  755. @see http://php.net/manual/en/function.hash.php
  756. **/
  757. static function hash(algo:String, str:String, raw_output:Bool = false):String;
  758. /**
  759. @see http://php.net/manual/en/function.hash-algos.php
  760. **/
  761. static function hash_algos():NativeIndexedArray<String>;
  762. /**
  763. @see http://php.net/manual/en/function.hash-hmac.php
  764. **/
  765. static function hash_hmac(algo:String, data:String, key:String, binary:Bool = false):EitherType<String, Bool>;
  766. /**
  767. @see http://php.net/manual/en/function.hash-hmac-algos.php
  768. **/
  769. static function hash_hmac_algos():NativeIndexedArray<String>;
  770. /**
  771. @see http://php.net/manual/en/function.hash-hmac-file.php
  772. **/
  773. static function hash_hmac_file(algo:String, data:String, key:String, binary:Bool = false):EitherType<String, Bool>;
  774. /**
  775. @see http://php.net/manual/en/function.pack.php
  776. **/
  777. static function pack(format:String, args:Rest<Dynamic>):String;
  778. /**
  779. @see http://php.net/manual/en/function.unpack.php
  780. **/
  781. static function unpack(format:String, data:String):NativeArray;
  782. /**
  783. @see http://php.net/manual/en/function.chunk-split.php
  784. **/
  785. static function chunk_split(body:String, chunklen:Int = 76, end:String = "\r\n"):String;
  786. /**
  787. @see http://php.net/manual/en/function.urlencode.php
  788. **/
  789. static function urlencode(str:String):String;
  790. /**
  791. @see http://php.net/manual/en/function.urldecode.php
  792. **/
  793. static function urldecode(str:String):String;
  794. /**
  795. @see http://php.net/manual/en/function.rawurlencode.php
  796. **/
  797. static function rawurlencode(str:String):String;
  798. /**
  799. @see http://php.net/manual/en/function.rawurldecode.php
  800. **/
  801. static function rawurldecode(str:String):String;
  802. /**
  803. @see http://php.net/manual/en/function.header.php
  804. **/
  805. static function header(string:String, replace:Bool = true, ?http_response_code:Int):Void;
  806. /**
  807. @see http://php.net/manual/en/function.header-remove.php
  808. **/
  809. static function header_remove(?name:String):Void;
  810. /**
  811. @see http://php.net/manual/en/function.headers-list.php
  812. **/
  813. static function headers_list():NativeIndexedArray<String>;
  814. /**
  815. @see http://php.net/manual/en/function.headers-sent.php
  816. **/
  817. static function headers_sent(?file:Ref<String>, ?line:Ref<Int>):Bool;
  818. /**
  819. @see http://php.net/manual/en/function.setcookie.php
  820. **/
  821. @:overload(function(name:String, value:String = "", ?options:NativeStructArray<{?expires:Int, ?path:String, ?domain:String, ?secure:Bool, ?httponly:Bool, ?samesite:String}>):Bool {})
  822. static function setcookie(name:String, value:String = "", expire:Int = 0, path:String = "", domain:String = "",
  823. secure:Bool = false, httponly:Bool = false):Bool;
  824. /**
  825. @see http://php.net/manual/en/function.html-entity-decode.php
  826. **/
  827. static function html_entity_decode(string:String, ?flags:Int, ?encoding:String):String;
  828. /**
  829. @see http://php.net/manual/en/function.htmlentities.php
  830. **/
  831. static function htmlentities(string:String, ?flags:Int, ?encoding:String, double_encode:Bool = true):String;
  832. /**
  833. @see http://php.net/manual/en/function.htmlspecialchars.php
  834. **/
  835. static function htmlspecialchars(string:String, ?flags:Int, ?encoding:String, double_encode:Bool = true):String;
  836. /**
  837. @see http://php.net/manual/en/function.htmlspecialchars-decode.php
  838. **/
  839. static function htmlspecialchars_decode(string:String, ?flags:Int):String;
  840. /**
  841. @see http://php.net/manual/en/function.str-pad.php
  842. **/
  843. static function str_pad(input:String, pad_length:Int, pad_String:String = ' ', ?pad_type:Int):String;
  844. /**
  845. @see http://php.net/manual/en/function.dechex.php
  846. **/
  847. static function dechex(number:Int):String;
  848. /**
  849. @see http://php.net/manual/en/function.hexdec.php
  850. **/
  851. static function hexdec(hex_string:String):Int;
  852. /**
  853. @see http://php.net/manual/en/function.decbin.php
  854. **/
  855. static function decbin(number:Int):String;
  856. /**
  857. @see http://php.net/manual/en/function.bindec.php
  858. **/
  859. static function bindec(binary_string:String):Float;
  860. /**
  861. @see http://php.net/manual/en/function.bin2hex.php
  862. **/
  863. static function bin2hex(str:String):String;
  864. /**
  865. @see http://php.net/manual/en/function.hex2bin.php
  866. **/
  867. static function hex2bin(str:String):EitherType<String, Bool>;
  868. /**
  869. @see http://php.net/manual/en/function.serialize.php
  870. **/
  871. static function serialize(value:Dynamic):String;
  872. /**
  873. @see http://php.net/manual/en/function.unserialize.php
  874. **/
  875. static function unserialize(str:String, ?options:NativeArray):Dynamic;
  876. /**
  877. @see http://php.net/manual/en/function.extension-loaded.php
  878. **/
  879. static function extension_loaded(name:String):Bool;
  880. /**
  881. @see http://php.net/manual/en/function.strncasecmp.php
  882. **/
  883. static function strncasecmp(str1:String, str2:String, len:Int):Int;
  884. /**
  885. @see http://php.net/manual/en/function.strcasecmp.php
  886. **/
  887. static function strcasecmp(str1:String, str2:String):Int;
  888. /**
  889. @see http://php.net/manual/en/function.fpassthru.php
  890. **/
  891. static function fpassthru(handle:Resource):Int;
  892. /**
  893. @see http://php.net/manual/en/function.json-encode.php
  894. **/
  895. static function json_encode(value:Dynamic, options:Int = 0, depth:Int = 512):EitherType<String, Bool>;
  896. /**
  897. @see http://php.net/manual/en/function.json-decode.php
  898. **/
  899. static function json_decode(json:String, assoc:Bool = false, depth:Int = 512, options:Int = 512):Dynamic;
  900. /**
  901. @see http://php.net/manual/en/function.json-last-error.php
  902. **/
  903. static function json_last_error():Int;
  904. /**
  905. @see http://php.net/manual/en/function.json-last-error-msg.php
  906. **/
  907. static function json_last_error_msg():EitherType<String, Bool>;
  908. /**
  909. @see http://php.net/manual/en/function.spl-object-hash.php
  910. **/
  911. static function spl_object_hash(obj:{}):String;
  912. /**
  913. @see http://php.net/manual/en/function.spl-object-id.php
  914. **/
  915. static function spl_object_id(obj:{}):Int;
  916. /**
  917. @see http://php.net/manual/en/function.spl-autoload-call.php
  918. **/
  919. static function spl_autoload_call(class_name:String):Void;
  920. /**
  921. @see http://php.net/manual/en/function.spl-autoload-extensions.php
  922. **/
  923. static function spl_autoload_extensions(?file_extensions:String):String;
  924. /**
  925. @see http://php.net/manual/en/function.spl-autoload-functions.php
  926. **/
  927. static function spl_autoload_functions():EitherType<NativeIndexedArray<Function>, Bool>;
  928. /**
  929. @see http://php.net/manual/en/function.spl-autoload-register.php
  930. **/
  931. static function spl_autoload_register(?autoload_function:(className:String) -> Void, throw_exception:Bool = true, prepend:Bool = false):Bool;
  932. /**
  933. @see http://php.net/manual/en/function.spl-autoload-unregister.php
  934. **/
  935. static function spl_autoload_unregister(autoload_function:(className:String) -> Void):Bool;
  936. /**
  937. @see http://php.net/manual/en/function.spl-autoload.php
  938. **/
  939. static function spl_autoload(class_name:String, ?file_extensions:String):Void;
  940. /**
  941. @see http://php.net/manual/en/function.utf8-encode.php
  942. **/
  943. static function utf8_encode(data:String):String;
  944. /**
  945. @see http://php.net/manual/en/function.utf8-decode.php
  946. **/
  947. static function utf8_decode(data:String):String;
  948. /**
  949. @see http://php.net/manual/en/function.mb-internal-encoding.php
  950. **/
  951. static function mb_internal_encoding(?encoding:String):EitherType<Bool, String>;
  952. /**
  953. @see http://php.net/manual/en/function.mb-convert-encoding.php
  954. **/
  955. static function mb_convert_encoding(str:String, to_encoding:String, ?from_encoding:Dynamic):String;
  956. /**
  957. @see http://php.net/manual/en/function.mb-check-encoding.php
  958. **/
  959. static function mb_check_encoding(str:String = null, ?encoding:String):Bool;
  960. /**
  961. @see http://php.net/manual/en/function.mb-language.php
  962. **/
  963. @:overload(function(language:String):Bool {})
  964. static function mb_language():String;
  965. /**
  966. @see http://php.net/manual/en/function.mb-scrub.php
  967. **/
  968. static function mb_scrub(str:String, ?encoding:String):String;
  969. /**
  970. @see http://php.net/manual/en/function.mb-split.php
  971. **/
  972. static function mb_split(pattern:String, str:String, ?limit:Int):NativeIndexedArray<String>;
  973. /**
  974. @see http://php.net/manual/en/function.mb-strlen.php
  975. **/
  976. static function mb_strlen(str:String, ?encoding:String):Int;
  977. /**
  978. @see http://php.net/manual/en/function.mb-substr.php
  979. **/
  980. static function mb_substr(str:String, start:Int, length:Int = null, ?encoding:String):String;
  981. /**
  982. @see http://php.net/manual/en/function.mb-substitute-character.php
  983. **/
  984. static function mb_substitute_character(?substchar:EitherType<Int,String>):EitherType<Bool,EitherType<String,Int>>;
  985. /**
  986. @see http://php.net/manual/en/function.mb-chr.php
  987. (Polyfilled for php 7.0)
  988. **/
  989. static function mb_chr(cp:Int, ?encoding:String):String;
  990. /**
  991. @see http://php.net/manual/en/function.mb-ord.php
  992. (Polyfilled for php 7.0)
  993. **/
  994. static function mb_ord(str:String, ?encoding:String):Int;
  995. /**
  996. @see http://php.net/manual/en/function.mb-regex-encoding.php
  997. **/
  998. static function mb_regex_encoding(?encoding:String):EitherType<Bool, String>;
  999. /**
  1000. @see http://php.net/manual/en/function.mb-strtoupper.php
  1001. **/
  1002. static function mb_strtoupper(str:String, ?encoding:String):String;
  1003. /**
  1004. @see http://php.net/manual/en/function.mb-strpos.php
  1005. **/
  1006. static function mb_strpos(haystack:String, needle:String, ?offset:Int, ?encoding:String):EitherType<Int, Bool>;
  1007. /**
  1008. @see http://php.net/manual/en/function.mb-strrpos.php
  1009. **/
  1010. static function mb_strrpos(haystack:String, needle:String, ?offset:Int, ?encoding:String):EitherType<Int, Bool>;
  1011. /**
  1012. @see http://php.net/manual/en/function.mb-strtolower.php
  1013. **/
  1014. static function mb_strtolower(str:String, ?encoding:String):String;
  1015. /**
  1016. @see http://php.net/manual/en/function.proc-open.php
  1017. **/
  1018. static function proc_open(cmd:String, descriptorspec:NativeArray, pipes:NativeIndexedArray<Resource>, ?cwd:String, ?env:NativeArray,
  1019. ?other_options:NativeArray):EitherType<Resource, Bool>;
  1020. /**
  1021. @see http://php.net/manual/en/function.proc-get-status.php
  1022. **/
  1023. static function proc_get_status(process:Resource):EitherType<Bool, NativeAssocArray<Scalar>>;
  1024. /**
  1025. @see http://php.net/manual/en/function.proc-close.php
  1026. **/
  1027. static function proc_close(process:Resource):Int;
  1028. /**
  1029. @see http://php.net/manual/en/function.proc-terminate.php
  1030. **/
  1031. static function proc_terminate(process:Resource, signal:Int = 15):Bool;
  1032. /**
  1033. @see http://php.net/manual/en/function.stream-select.php
  1034. **/
  1035. static function stream_select(read:NativeArray, write:NativeArray, except:NativeArray, tv_sec:Int, tv_usec:Int = 0):Bool;
  1036. /**
  1037. @see http://php.net/manual/en/function.stream-get-contents.php
  1038. **/
  1039. static function stream_get_contents(handle:Resource, maxlength:Int = -1, offset:Int = -1):EitherType<String, Bool>;
  1040. /**
  1041. @see http://php.net/manual/en/function.stream-socket-shutdown.php
  1042. **/
  1043. static function stream_socket_shutdown(stream:Resource, how:Int):Bool;
  1044. /**
  1045. @see http://php.net/manual/en/function.stream-set-timeout.php
  1046. **/
  1047. static function stream_set_timeout(stream:Resource, seconds:Int, microseconds:Int = 0):Bool;
  1048. /**
  1049. @see http://php.net/manual/en/function.stream-set-blocking.php
  1050. **/
  1051. static function stream_set_blocking(stream:Resource, mode:Bool):Bool;
  1052. /**
  1053. @see http://php.net/manual/en/function.stream-socket-accept.php
  1054. **/
  1055. static function stream_socket_accept(server_socket:Resource, ?timeout:Float, ?peername:Ref<String>):EitherType<Resource, Bool>;
  1056. /**
  1057. @see http://php.net/manual/en/function.stream-socket-client.php
  1058. **/
  1059. static function stream_socket_client(remote_socket:String, ?errno:Ref<Int>, ?errstr:Ref<String>, ?timeout:Float, ?flags:Int,
  1060. ?context:Resource):EitherType<Resource, Bool>;
  1061. /**
  1062. @see http://php.net/manual/en/function.stream-socket-server.php
  1063. **/
  1064. static function stream_socket_server(local_socket:String, ?errno:Ref<Int>, ?errstr:Ref<String>, ?flags:Int, ?context:Resource):EitherType<Resource, Bool>;
  1065. /**
  1066. @see http://php.net/manual/en/function.stream-socket-get-name.php
  1067. **/
  1068. static function stream_socket_get_name(stream:Resource, want_peer:Bool):EitherType<String, Bool>;
  1069. /**
  1070. @see http://php.net/manual/en/function.socket-create.php
  1071. **/
  1072. static function socket_create(domain:Int, type:Int, protocol:Int):Resource;
  1073. /**
  1074. @see http://php.net/manual/en/function.socket-connect.php
  1075. **/
  1076. static function socket_connect(stream:Resource, host:String, port:Int):Bool;
  1077. /**
  1078. @see http://php.net/manual/en/function.socket-listen.php
  1079. **/
  1080. static function socket_listen(stream:Resource, connections:Int):Bool;
  1081. /**
  1082. @see http://php.net/manual/en/function.socket-shutdown.php
  1083. **/
  1084. static function socket_shutdown(stream:Resource, rw:Int):Bool;
  1085. /**
  1086. @see http://php.net/manual/en/function.socket-bind.php
  1087. **/
  1088. static function socket_bind(stream:Resource, host:String, port:Int):Bool;
  1089. /**
  1090. @see http://php.net/manual/en/function.socket-accept.php
  1091. **/
  1092. static function socket_accept(stream:Resource):EitherType<Resource, Bool>;
  1093. /**
  1094. @see http://php.net/manual/en/function.socket-getpeername.php
  1095. **/
  1096. static function socket_getpeername(stream:Resource, host:Ref<String>, port:Ref<Int>):Bool;
  1097. /**
  1098. @see http://php.net/manual/en/function.socket-getsockname.php
  1099. **/
  1100. static function socket_getsockname(stream:Resource, host:Ref<String>, port:Ref<Int>):Bool;
  1101. /**
  1102. @see http://php.net/manual/en/function.socket-set-block.php
  1103. **/
  1104. static function socket_set_block(stream:Resource):Bool;
  1105. /**
  1106. @see http://php.net/manual/en/function.socket-set-nonblock.php
  1107. **/
  1108. static function socket_set_nonblock(stream:Resource):Bool;
  1109. /**
  1110. @see http://php.net/manual/en/function.socket-set-option.php
  1111. **/
  1112. static function socket_set_option(stream:Resource, level:Int, option:Int, val:Any):Bool;
  1113. /**
  1114. @see http://php.net/manual/en/function.socket-select.php
  1115. **/
  1116. static function socket_select(read:NativeIndexedArray<Resource>, write:NativeIndexedArray<Resource>, other:NativeIndexedArray<Resource>, tv_sec:Int = 0,
  1117. tv_usec:Int = 0):EitherType<Bool, Int>;
  1118. /**
  1119. @see http://php.net/manual/en/function.socket-read.php
  1120. **/
  1121. static function socket_read(resource:Resource, length:Int, ?type:Int):EitherType<Bool, String>;
  1122. /**
  1123. @see http://php.net/manual/en/function.socket-write.php
  1124. **/
  1125. static function socket_write(resource:Resource, buffer:String, len:Int = 0):EitherType<Bool, Int>;
  1126. /**
  1127. @see http://php.net/manual/en/function.socket-import-stream.php
  1128. **/
  1129. static function socket_import_stream(resource:Resource):EitherType<Bool, Resource>;
  1130. /**
  1131. @see http://php.net/manual/en/function.socket-export-stream.php
  1132. **/
  1133. static function socket_export_stream(resource:Resource):EitherType<Bool, Resource>;
  1134. /**
  1135. @see http://php.net/manual/en/function.socket-close.php
  1136. **/
  1137. static function socket_close(resource:Resource):Void;
  1138. /**
  1139. @see http://php.net/manual/en/function.ini-get.php
  1140. **/
  1141. static function ini_get(var_name:String):EitherType<Bool, String>;
  1142. /**
  1143. @see http://php.net/manual/en/function.ini-set.php
  1144. **/
  1145. static function ini_set(var_name:String, newvalue:String):EitherType<Bool, String>;
  1146. /**
  1147. @see http://php.net/manual/en/function.sqlite-error-string.php
  1148. **/
  1149. static function sqlite_error_string(error_code:Int):String;
  1150. /**
  1151. @see http://php.net/manual/en/function.sqlite-escape-string.php
  1152. **/
  1153. static function sqlite_escape_string(item:String):String;
  1154. /**
  1155. @see http://php.net/manual/en/function.set-time-limit.php
  1156. **/
  1157. static function set_time_limit(seconds:Int):Bool;
  1158. /**
  1159. @see http://php.net/manual/en/function.function-exists.php
  1160. **/
  1161. static function function_exists(function_name:String):Bool;
  1162. /**
  1163. @see http://php.net/manual/en/function.getallheaders.php
  1164. **/
  1165. static function getallheaders():NativeAssocArray<Dynamic>;
  1166. /**
  1167. @see http://php.net/manual/en/function.ucfirst.php
  1168. **/
  1169. static function ucfirst(string:String):String;
  1170. /**
  1171. @see http://php.net/manual/en/function.ucwords.php
  1172. **/
  1173. static function ucwords(str:String, ?delimiters:String):String;
  1174. /**
  1175. @see http://php.net/manual/en/function.base64-encode.php
  1176. **/
  1177. static function base64_encode(data:String):String;
  1178. /**
  1179. @see http://php.net/manual/en/function.base64-decode.php
  1180. **/
  1181. static function base64_decode(data:String, strict:Bool = false):EitherType<String, Bool>;
  1182. /**
  1183. @see http://php.net/manual/en/function.gethostname.php
  1184. **/
  1185. static function gethostname():EitherType<String, Bool>;
  1186. /**
  1187. @see http://php.net/manual/en/function.gethostbyname.php
  1188. **/
  1189. static function gethostbyname(hostname:String):String;
  1190. /**
  1191. @see http://php.net/manual/en/function.gethostbyaddr.php
  1192. **/
  1193. static function gethostbyaddr(ip_address:String):EitherType<String, Bool>;
  1194. /**
  1195. @see http://php.net/manual/en/function.getprotobyname.php
  1196. **/
  1197. static function getprotobyname(name:String):EitherType<Int, Bool>;
  1198. /**
  1199. @see http://php.net/manual/en/function.mktime.php
  1200. **/
  1201. static function mktime(?hour:Int, ?minute:Int, ?second:Int, ?month:Int, ?day:Int, ?year:Int, ?is_dst:Int):EitherType<Int, Bool>;
  1202. /**
  1203. @see http://php.net/manual/en/function.gmmktime.php
  1204. **/
  1205. static function gmmktime(?hour:Int, ?minute:Int, ?second:Int, ?month:Int, ?day:Int, ?year:Int, ?is_dst:Int):Int;
  1206. /**
  1207. @see http://php.net/manual/en/function.date.php
  1208. **/
  1209. static function date(format:String, ?timestamp:Int):EitherType<String, Bool>;
  1210. /**
  1211. @see http://php.net/manual/en/function.gmdate.php
  1212. **/
  1213. static function gmdate(format:String, ?timestamp:Int):EitherType<String, Bool>;
  1214. /**
  1215. @see http://php.net/manual/en/function.time.php
  1216. **/
  1217. static function time():Int;
  1218. /**
  1219. @see http://php.net/manual/en/function.strftime.php
  1220. **/
  1221. static function strftime(format:String, ?timestamp:Int):EitherType<String, Bool>;
  1222. /**
  1223. @see http://php.net/manual/en/function.strtotime.php
  1224. **/
  1225. static function strtotime(time:String, ?now:Int):EitherType<Int, Bool>;
  1226. /**
  1227. @see http://php.net/manual/en/function.flush.php
  1228. **/
  1229. static function flush():Void;
  1230. /**
  1231. @see http://php.net/manual/en/function.session-cache-limiter.php
  1232. **/
  1233. static function session_cache_limiter(?cache_limiter:String):String;
  1234. /**
  1235. @see http://php.net/manual/en/function.session-cache-expire.php
  1236. **/
  1237. static function session_cache_expire(?new_cache_expire:Int):Int;
  1238. /**
  1239. @see http://php.net/manual/en/function.session-decode.php
  1240. **/
  1241. static function session_decode(data:String):Bool;
  1242. /**
  1243. @see http://php.net/manual/en/function.session-destroy.php
  1244. **/
  1245. static function session_destroy():Bool;
  1246. /**
  1247. @see http://php.net/manual/en/function.session-encode.php
  1248. **/
  1249. static function session_encode():String;
  1250. /**
  1251. @see http://php.net/manual/en/function.session-name.php
  1252. **/
  1253. static function session_name(?name:String):String;
  1254. /**
  1255. @see http://php.net/manual/en/function.session-start.php
  1256. **/
  1257. static function session_start(?options:NativeArray):Bool;
  1258. /**
  1259. @see http://php.net/manual/en/function.session-status.php
  1260. **/
  1261. static function session_status():Int;
  1262. /**
  1263. @see http://php.net/manual/en/function.session-unset.php
  1264. **/
  1265. static function session_unset():Void;
  1266. /**
  1267. @see http://php.net/manual/en/function.session-write-close.php
  1268. **/
  1269. static function session_write_close():Void;
  1270. /**
  1271. @see http://php.net/manual/en/function.session-id.php
  1272. **/
  1273. static function session_id(?id:String):String;
  1274. /**
  1275. @see http://php.net/manual/en/function.session-save-path.php
  1276. **/
  1277. static function session_save_path(?path:String):String;
  1278. /**
  1279. @see http://php.net/manual/en/function.session-module-name.php
  1280. **/
  1281. static function session_module_name(?module:String):String;
  1282. /**
  1283. @see http://php.net/manual/en/function.session-regenerate-id.php
  1284. **/
  1285. static function session_regenerate_id(delete_old_session:Bool = false):Bool;
  1286. /**
  1287. @see http://php.net/manual/en/function.session-set-cookie-params.php
  1288. **/
  1289. @:overload(function(options:NativeStructArray<{?lifetime:Int, ?path:String, ?domain:String, ?secure:Bool, ?httponly:Bool, ?samesite:String}>):Bool {})
  1290. static function session_set_cookie_params(lifetime:Int, ?path:String, ?domain:String, secure:Bool = false, httponly:Bool = false):Bool;
  1291. /**
  1292. @see http://php.net/manual/en/function.session-get-cookie-params.php
  1293. **/
  1294. static function session_get_cookie_params():NativeAssocArray<Dynamic>;
  1295. /**
  1296. @see http://php.net/manual/en/function.session-set-save-handler.php
  1297. **/
  1298. @:overload(function(sessionhandler:SessionHandlerInterface, register_shutdown:Bool = true):Bool {})
  1299. static function session_set_save_handler(open:String->String->Bool, close:Void->Bool, read:String->String, write:String->String->Bool,
  1300. destroy:String->Bool, gc:Int->Bool, ?create_sid:Void->String, ?validate_sid:Function, ?update_timestamp:Function):Bool;
  1301. /**
  1302. @see http://php.net/manual/en/function.mail.php
  1303. **/
  1304. static function mail(to:String, subject:String, message:String, ?additional_headers:String, ?additional_parameters:String):Bool;
  1305. /**
  1306. @see http://php.net/manual/en/function.require.php
  1307. **/
  1308. static function require(include_path:String):Void;
  1309. /**
  1310. @see http://php.net/manual/en/function.require-once.php
  1311. **/
  1312. static function require_once(include_path:String):Void;
  1313. /**
  1314. @see http://php.net/manual/en/function.include.php
  1315. **/
  1316. static function include(include_path:String):Void;
  1317. /**
  1318. @see http://php.net/manual/en/function.include-once.php
  1319. **/
  1320. static function include_once(include_path:String):Void;
  1321. /**
  1322. @see http://php.net/manual/en/function.set-include-path.php
  1323. **/
  1324. static function set_include_path(new_include_path:String):String;
  1325. /**
  1326. @see http://php.net/manual/en/function.get-include-path.php
  1327. **/
  1328. static function get_include_path():String;
  1329. /**
  1330. @see http://php.net/manual/en/function.gzcompress.php
  1331. **/
  1332. static function gzcompress(data:String, ?level:Int, ?encoding:Int):EitherType<String, Bool>;
  1333. /**
  1334. @see http://php.net/manual/en/function.gzuncompress.php
  1335. **/
  1336. static function gzuncompress(data:String, ?length:Int):EitherType<String, Bool>;
  1337. /**
  1338. @see http://php.net/manual/en/function.mime-content-type.php
  1339. **/
  1340. static function mime_content_type(filename:String):EitherType<String, Bool>;
  1341. /**
  1342. @see http://php.net/manual/en/function.move-uploaded-file.php
  1343. **/
  1344. static function move_uploaded_file(filename:String, destination:String):Bool;
  1345. /**
  1346. @see http://php.net/manual/en/function.is-uploaded-file.php
  1347. **/
  1348. static function is_uploaded_file(filename:String):Bool;
  1349. /**
  1350. @see http://php.net/manual/en/function.gc-collect-cycles.php
  1351. **/
  1352. static function gc_collect_cycles():Int;
  1353. /**
  1354. @see http://php.net/manual/en/function.cli-set-process-title.php
  1355. **/
  1356. static function cli_set_process_title(title:String):Bool;
  1357. /**
  1358. @see http://php.net/manual/en/function.http-response-code.php
  1359. **/
  1360. static function http_response_code(?response_code:Int):EitherType<Int, Bool>;
  1361. /**
  1362. @see http://php.net/manual/en/function.version-compare.php
  1363. **/
  1364. @:overload(function(version1:String, version2:String, comparisonOperator:String):Bool {})
  1365. static function version_compare(version1:String, version2:String):Int;
  1366. /**
  1367. @see http://php.net/manual/en/function.ob-clean.php
  1368. **/
  1369. static function ob_clean():Void;
  1370. /**
  1371. @see http://php.net/manual/en/function.ob-end-clean.php
  1372. **/
  1373. static function ob_end_clean():Bool;
  1374. /**
  1375. @see http://php.net/manual/en/function.ob-end-flush.php
  1376. **/
  1377. static function ob_end_flush():Bool;
  1378. /**
  1379. @see http://php.net/manual/en/function.ob-flush.php
  1380. **/
  1381. static function ob_flush():Void;
  1382. /**
  1383. @see http://php.net/manual/en/function.ob-get-clean.php
  1384. **/
  1385. static function ob_get_clean():EitherType<String, Bool>;
  1386. /**
  1387. @see http://php.net/manual/en/function.ob-get-contents.php
  1388. **/
  1389. static function ob_get_contents():EitherType<String, Bool>;
  1390. /**
  1391. @see http://php.net/manual/en/function.ob-get-flush.php
  1392. **/
  1393. static function ob_get_flush():EitherType<String, Bool>;
  1394. /**
  1395. @see http://php.net/manual/en/function.ob-get-length.php
  1396. **/
  1397. static function ob_get_length():EitherType<Int, Bool>;
  1398. /**
  1399. @see http://php.net/manual/en/function.ob-get-level.php
  1400. **/
  1401. static function ob_get_level():Int;
  1402. /**
  1403. @see http://php.net/manual/en/function.ob-get-status.php
  1404. **/
  1405. static function ob_get_status(full_status:Bool = false):NativeArray;
  1406. /**
  1407. @see http://php.net/manual/en/function.ob-implicit-flush.php
  1408. **/
  1409. static function ob_implicit_flush(flag:Int = 1):Void;
  1410. /**
  1411. @see http://php.net/manual/en/function.ob-list-handlers.php
  1412. **/
  1413. static function ob_list_handlers():NativeIndexedArray<String>;
  1414. /**
  1415. @see http://php.net/manual/en/function.ob-start.php
  1416. **/
  1417. static function ob_start(output_callback: (String, ?Int) -> String = null, chunk_size:Int = 0, ?flags:Int):Bool;
  1418. /**
  1419. @see http://php.net/manual/en/function.strip-tags.php
  1420. **/
  1421. static function strip_tags(str: String, ?allowable_tags:EitherType<String, Array<String>>):String;
  1422. /**
  1423. @see http://php.net/manual/en/function.parse-ini-file.php
  1424. **/
  1425. static function parse_ini_file(filename:String, process_sections:Bool = false, ?scanner_mode:Int): EitherType<NativeAssocArray<Dynamic>, Bool>;
  1426. /**
  1427. @see http://php.net/manual/en/function.parse-ini-string.php
  1428. **/
  1429. static function parse_ini_string(ini:String, process_sections:Bool = false, ?scanner_mode:Int): EitherType<NativeAssocArray<Dynamic>, Bool>;
  1430. /**
  1431. @see http://php.net/manual/en/function.opcache-compile-file.php
  1432. **/
  1433. static function opcache_compile_file(file:String):Bool;
  1434. /**
  1435. @see http://php.net/manual/en/function.opcache-get-configuration.php
  1436. **/
  1437. static function opcache_get_configuration():NativeAssocArray<Dynamic>;
  1438. /**
  1439. @see http://php.net/manual/en/function.opcache-get-status.php
  1440. **/
  1441. static function opcache_get_status(get_scripts:Bool = true):EitherType<NativeAssocArray<Dynamic>, Bool>;
  1442. /**
  1443. @see http://php.net/manual/en/function.opcache-invalidate.php
  1444. **/
  1445. static function opcache_invalidate(script:String, force:Bool = false):Bool;
  1446. /**
  1447. @see http://php.net/manual/en/function.opcache-is-script-cached.php
  1448. **/
  1449. static function opcache_is_script_cached(file:String):Bool;
  1450. /**
  1451. @see http://php.net/manual/en/function.opcache-reset.php
  1452. **/
  1453. static function opcache_reset():Bool;
  1454. /**
  1455. @see http://php.net/manual/en/function.touch.php
  1456. **/
  1457. static function touch(filename:String, ?time:Int, ?atime: Int):Bool;
  1458. /**
  1459. @see http://php.net/manual/en/function.checkdnsrr.php
  1460. **/
  1461. static function checkdnsrr(host:String, type:String = "MX"):Bool;
  1462. /**
  1463. @see http://php.net/manual/en/function.dns-get-record.php
  1464. **/
  1465. static function dns_get_record(hostname:String, ?type:Int, ?authns:Ref<NativeIndexedArray<NativeAssocArray<Dynamic>>>,
  1466. ?addtl:Ref<NativeIndexedArray<NativeAssocArray<Dynamic>>>, raw:Bool = false):EitherType<NativeIndexedArray<NativeAssocArray<Dynamic>>, Bool>;
  1467. /**
  1468. @see http://php.net/manual/en/function.idn-to-ascii.php
  1469. **/
  1470. static function idn_to_ascii(domain:String, ?options:Int, ?variant:Int, ?idna_info:Ref<NativeAssocArray<Dynamic>>):EitherType<String, Bool>;
  1471. /**
  1472. @see http://php.net/manual/en/function.idn-to-utf8.php
  1473. **/
  1474. static function idn_to_utf8(domain:String, ?options:Int, ?variant:Int, ?idna_info:Ref<NativeAssocArray<Dynamic>>):EitherType<String, Bool>;
  1475. /**
  1476. @see http://php.net/manual/en/function.intl-error-name.php
  1477. **/
  1478. static function intl_error_name(error_code:Int):String;
  1479. /**
  1480. @see http://php.net/manual/en/function.intl-get-error-code.php
  1481. **/
  1482. static function intl_get_error_code():Int;
  1483. /**
  1484. @see http://php.net/manual/en/function.intl-get-error-message.php
  1485. **/
  1486. static function intl_get_error_message():String;
  1487. /**
  1488. @see http://php.net/manual/en/function.intl-is-failure.php
  1489. **/
  1490. static function intl_is_failure(error_code:Int):Bool;
  1491. /**
  1492. @see http://php.net/manual/en/function.filter-has-var.php
  1493. **/
  1494. static function filter_has_var(input_type:Int, var_name:String):Bool;
  1495. /**
  1496. @see http://php.net/manual/en/function.filter-id.php
  1497. **/
  1498. static function filter_id(name:String):EitherType<Int, Bool>;
  1499. /**
  1500. @see http://php.net/manual/en/function.filter-input.php
  1501. **/
  1502. static function filter_input(type:Int, var_name:String, ?filter:Int, ?options: EitherType<NativeAssocArray<Dynamic>, Int>):Dynamic;
  1503. /**
  1504. @see http://php.net/manual/en/function.filter-list.php
  1505. **/
  1506. static function filter_list():NativeIndexedArray<String>;
  1507. /**
  1508. @see http://php.net/manual/en/function.filter-var.php
  1509. **/
  1510. static function filter_var(value: Any, ?filter:Int, ?options: EitherType<NativeAssocArray<Dynamic>, Int>):Dynamic;
  1511. /**
  1512. @see http://php.net/manual/en/function.number-format.php
  1513. **/
  1514. static function number_format(num:Float, ?decimals:Int, ?decimal_separator:String, ?thousands_separator:String):String;
  1515. /**
  1516. @see http://php.net/manual/en/function.empty.php
  1517. **/
  1518. static function empty(variable:Any):Bool;
  1519. /**
  1520. @see http://php.net/manual/en/function.quoted-printable-decode.php
  1521. **/
  1522. static function quoted_printable_decode(string:String):String;
  1523. /**
  1524. @see http://php.net/manual/en/function.quoted-printable-encode.php
  1525. **/
  1526. static function quoted_printable_encode(string:String):String;
  1527. /**
  1528. @see http://php.net/manual/en/function.easter-date.php
  1529. **/
  1530. static function easter_date(?year:Int, ?mode:Int): Int;
  1531. /**
  1532. @see http://php.net/manual/en/function.easter-days.php
  1533. **/
  1534. static function easter_days(?year:Int, ?mode:Int): Int;
  1535. /**
  1536. @see http://php.net/manual/en/function.sys-get-temp-dir.php
  1537. **/
  1538. static function sys_get_temp_dir():String;
  1539. /**
  1540. @see http://php.net/manual/en/function.tempnam.php
  1541. **/
  1542. static function tempnam(directory:String, prefix:String):EitherType<String, Bool>;
  1543. /**
  1544. @see http://php.net/manual/en/function.tmpfile.php
  1545. **/
  1546. static function tmpfile():EitherType<Resource, Bool>;
  1547. /**
  1548. @see http://php.net/manual/en/function.ftp-alloc.php
  1549. **/
  1550. static function ftp_alloc(ftp: Resource, size: Int, ?response: Ref<String>): Bool;
  1551. /**
  1552. @see http://php.net/manual/en/function.ftp-append.php
  1553. **/
  1554. static function ftp_append(ftp: Resource, remote_filename: String, local_filename: String, ?mode: Int): Bool;
  1555. /**
  1556. @see http://php.net/manual/en/function.ftp-cdup.php
  1557. **/
  1558. static function ftp_cdup(ftp: Resource): Bool;
  1559. /**
  1560. @see http://php.net/manual/en/function.ftp-chdir.php
  1561. **/
  1562. static function ftp_chdir(ftp: Resource, directory: String): Bool;
  1563. /**
  1564. @see http://php.net/manual/en/function.ftp-chmod.php
  1565. **/
  1566. static function ftp_chmod(ftp: Resource, permissions: Int, filename: String): EitherType<Int, Bool>;
  1567. /**
  1568. @see http://php.net/manual/en/function.ftp-close.php
  1569. **/
  1570. static function ftp_close(ftp: Resource): Bool;
  1571. /**
  1572. @see http://php.net/manual/en/function.ftp-connect.php
  1573. **/
  1574. static function ftp_connect(hostname: String, port: Int = 21, timeout: Int = 90): EitherType<Resource, Bool>;
  1575. /**
  1576. @see http://php.net/manual/en/function.ftp-delete.php
  1577. **/
  1578. static function ftp_delete(ftp: Resource, filename: String): Bool;
  1579. /**
  1580. @see http://php.net/manual/en/function.ftp-exec.php
  1581. **/
  1582. static function ftp_exec(ftp: Resource, command: String): Bool;
  1583. /**
  1584. @see http://php.net/manual/en/function.ftp-fget.php
  1585. **/
  1586. static function ftp_fget(ftp: Resource, stream: Resource, remote_filename: String, ?mode: Int, offset: Int = 0): Bool;
  1587. /**
  1588. @see http://php.net/manual/en/function.ftp-fput.php
  1589. **/
  1590. static function ftp_fput(ftp: Resource, remote_filename: String, stream: Resource, ?mode: Int, offset: Int = 0): Bool;
  1591. /**
  1592. @see http://php.net/manual/en/function.ftp-get.php
  1593. **/
  1594. static function ftp_get(ftp: Resource, local_filename: String, remote_filename: String, offset: Int = 0): Bool;
  1595. /**
  1596. @see http://php.net/manual/en/function.ftp-get-option.php
  1597. **/
  1598. static function ftp_get_option(ftp: Resource, option: Int): EitherType<Int, Bool>;
  1599. /**
  1600. @see http://php.net/manual/en/function.ftp-login.php
  1601. **/
  1602. static function ftp_login(ftp: Resource, username: String, password: String): Bool;
  1603. /**
  1604. @see http://php.net/manual/en/function.ftp-mdtm.php
  1605. **/
  1606. static function ftp_mdtm(ftp: Resource, filename: String): Int;
  1607. /**
  1608. @see http://php.net/manual/en/function.ftp-mkdir.php
  1609. **/
  1610. static function ftp_mkdir(ftp: Resource, directory: String): EitherType<String, Bool>;
  1611. /**
  1612. @see http://php.net/manual/en/function.ftp-mlsd.php
  1613. **/
  1614. static function ftp_mlsd(ftp: Resource, directory: String): EitherType<NativeIndexedArray<NativeAssocArray<String>>, Bool>;
  1615. /**
  1616. @see http://php.net/manual/en/function.ftp-nb-continue.php
  1617. **/
  1618. static function ftp_nb_continue(ftp: Resource): Int;
  1619. /**
  1620. @see http://php.net/manual/en/function.ftp-nb-fget.php
  1621. **/
  1622. static function ftp_nb_fget(ftp: Resource, stream: Resource, remote_filename: String, ?mode: Int, offset: Int = 0): Int;
  1623. /**
  1624. @see http://php.net/manual/en/function.ftp-nb-fput.php
  1625. **/
  1626. static function ftp_nb_fput(ftp: Resource, remote_filename: String, stream: Resource, ?mode: Int, offset: Int = 0): Int;
  1627. /**
  1628. @see http://php.net/manual/en/function.ftp-nb-get.php
  1629. **/
  1630. static function ftp_nb_get(ftp: Resource, local_filename: String, remote_filename: String, offset: Int = 0): Int;
  1631. /**
  1632. @see http://php.net/manual/en/function.ftp-nb-put.php
  1633. **/
  1634. static function ftp_nb_put(ftp: Resource, remote_filename: String, local_filename: String, offset: Int = 0): EitherType<Int, Bool>;
  1635. /**
  1636. @see http://php.net/manual/en/function.ftp-nlist.php
  1637. **/
  1638. static function ftp_nlist(ftp: Resource, directory: String): EitherType<NativeIndexedArray<String>, Bool>;
  1639. /**
  1640. @see http://php.net/manual/en/function.ftp-pasv.php
  1641. **/
  1642. static function ftp_pasv(ftp: Resource, enable: Bool): Bool;
  1643. /**
  1644. @see http://php.net/manual/en/function.ftp-put.php
  1645. **/
  1646. static function ftp_put(ftp: Resource, remote_filename: String, local_filename: String, offset: Int = 0): Bool;
  1647. /**
  1648. @see http://php.net/manual/en/function.ftp-pwd.php
  1649. **/
  1650. static function ftp_pwd(ftp: Resource): EitherType<String, Bool>;
  1651. /**
  1652. @see http://php.net/manual/en/function.ftp-raw.php
  1653. **/
  1654. static function ftp_raw(ftp: Resource, command: String): NativeIndexedArray<String>;
  1655. /**
  1656. @see http://php.net/manual/en/function.ftp-rawlist.php
  1657. **/
  1658. static function ftp_rawlist(ftp: Resource, directory: String, recursive: Bool = false): EitherType<NativeIndexedArray<String>, Bool>;
  1659. /**
  1660. @see http://php.net/manual/en/function.ftp-rename.php
  1661. **/
  1662. static function ftp_rename(ftp: Resource, from: String, to: String): Bool;
  1663. /**
  1664. @see http://php.net/manual/en/function.ftp-rmdir.php
  1665. **/
  1666. static function ftp_rmdir(ftp: Resource, directory: String): Bool;
  1667. /**
  1668. @see http://php.net/manual/en/function.ftp-set-option.php
  1669. **/
  1670. static function ftp_set_option(ftp: Resource, option: Int, value: EitherType<Int, Bool>): Bool;
  1671. /**
  1672. @see http://php.net/manual/en/function.ftp-site.php
  1673. **/
  1674. static function ftp_site(ftp: Resource, command: String): Bool;
  1675. /**
  1676. @see http://php.net/manual/en/function.ftp-size.php
  1677. **/
  1678. static function ftp_size(ftp: Resource, filename: String): Int;
  1679. /**
  1680. @see http://php.net/manual/en/function.ftp-ssl-connect.php
  1681. **/
  1682. static function ftp_ssl_connect(hostname: String, port: Int = 21, timeout: Int = 90): EitherType<Resource, Bool>;
  1683. /**
  1684. @see http://php.net/manual/en/function.ftp-systype.php
  1685. **/
  1686. static function ftp_systype(ftp: Resource): EitherType<String, Bool>;
  1687. /**
  1688. @see http://php.net/manual/en/function.connection-aborted.php
  1689. **/
  1690. static function connection_aborted(): Int;
  1691. /**
  1692. @see http://php.net/manual/en/function.connection-status.php
  1693. **/
  1694. static function connection_status(): Int;
  1695. /**
  1696. @see http://php.net/manual/en/function.ignore-user-abort.php
  1697. **/
  1698. static function ignore_user_abort(enable: Null<Bool> = null): Int;
  1699. /**
  1700. @see http://php.net/manual/en/function.highlight-file.php
  1701. **/
  1702. static function highlight_file(filename: String, returns: Bool = false): EitherType<String, Bool>;
  1703. /**
  1704. @see http://php.net/manual/en/function.highlight-string.php
  1705. **/
  1706. static function highlight_string(string: String, returns: Bool = false): EitherType<String, Bool>;
  1707. /**
  1708. @see http://php.net/manual/en/function.php-strip-whitespace.php
  1709. **/
  1710. static function php_strip_whitespace(filename: String): String;
  1711. }