Global.hx 60 KB

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