Explorar o código

[php] Add externs for output control functions (#9902)

* [php] Add externs for output control functions

* [php] Fix a duplicate function extern
Cédric Belin %!s(int64=4) %!d(string=hai) anos
pai
achega
71e286099f
Modificáronse 2 ficheiros con 80 adicións e 0 borrados
  1. 15 0
      std/php/Const.hx
  2. 65 0
      std/php/Global.hx

+ 15 - 0
std/php/Const.hx

@@ -431,4 +431,19 @@ extern class Const {
 	static final ZLIB_SYNC_FLUSH:Int;
 	static final ZLIB_FULL_FLUSH:Int;
 	static final ZLIB_FINISH:Int;
+
+	/**
+		@see http://php.net/manual/en/outcontrol.constants.php
+	**/
+	static final PHP_OUTPUT_HANDLER_CLEAN:Int;
+	static final PHP_OUTPUT_HANDLER_CLEANABLE:Int;
+	static final PHP_OUTPUT_HANDLER_CONT:Int;
+	static final PHP_OUTPUT_HANDLER_END:Int;
+	static final PHP_OUTPUT_HANDLER_FINAL:Int;
+	static final PHP_OUTPUT_HANDLER_FLUSH:Int;
+	static final PHP_OUTPUT_HANDLER_FLUSHABLE:Int;
+	static final PHP_OUTPUT_HANDLER_REMOVABLE:Int;
+	static final PHP_OUTPUT_HANDLER_START:Int;
+	static final PHP_OUTPUT_HANDLER_STDFLAGS:Int;
+	static final PHP_OUTPUT_HANDLER_WRITE:Int;
 }

+ 65 - 0
std/php/Global.hx

@@ -1622,4 +1622,69 @@ extern class Global {
 	**/
 	@:overload(function(version1:String, version2:String, comparisonOperator:String):Bool {})
 	static function version_compare(version1:String, version2:String):Int;
+
+	/**
+		@see http://php.net/manual/en/function.ob-clean.php
+	**/
+	static function ob_clean():Void;
+
+	/**
+		@see http://php.net/manual/en/function.ob-end-clean.php
+	**/
+	static function ob_end_clean():Bool;
+
+	/**
+		@see http://php.net/manual/en/function.ob-end-flush.php
+	**/
+	static function ob_end_flush():Bool;
+
+	/**
+		@see http://php.net/manual/en/function.ob-flush.php
+	**/
+	static function ob_flush():Void;
+
+	/**
+		@see http://php.net/manual/en/function.ob-get-clean.php
+	**/
+	static function ob_get_clean():EitherType<String, Bool>;
+
+	/**
+		@see http://php.net/manual/en/function.ob-get-contents.php
+	**/
+	static function ob_get_contents():EitherType<String, Bool>;
+
+	/**
+		@see http://php.net/manual/en/function.ob-get-flush.php
+	**/
+	static function ob_get_flush():EitherType<String, Bool>;
+
+	/**
+		@see http://php.net/manual/en/function.ob-get-length.php
+	**/
+	static function ob_get_length():EitherType<Int, Bool>;
+
+	/**
+		@see http://php.net/manual/en/function.ob-get-level.php
+	**/
+	static function ob_get_level():Int;
+
+	/**
+		@see http://php.net/manual/en/function.ob-get-status.php
+	**/
+	static function ob_get_status(full_status:Bool = false):NativeArray;
+
+	/**
+		@see http://php.net/manual/en/function.ob-implicit-flush.php
+	**/
+	static function ob_implicit_flush(flag:Int = 1):Void;
+
+	/**
+		@see http://php.net/manual/en/function.ob-list-handlers.php
+	**/
+	static function ob_list_handlers():NativeIndexedArray<String>;
+
+	/**
+		@see http://php.net/manual/en/function.ob-start.php
+	**/
+	static function ob_start(output_callback: (String, ?Int) -> String = null, chunk_size:Int = 0, ?flags:Int):Bool;
 }