Browse Source

Remove hx4compat stuff (part 1) (#11386)

* destroy

* update haxelib submodule

* submodule

* submodule ffs

* cppia

* remove echoServer

* remove more things

* more

* use patched utest for now

* remove one more

* try utest2

* fix test

* explicitly pass `null` to the `type` argument of `utest.Assert.raises()`

* [php] update test #9924 for compatibility with the latest utest

* [tests] type-hint Vfs.getContent

* fix Vfs.getContent one more time

* fix display tests

* switch to utest master

---------

Co-authored-by: Aleksandr Kuzmenko <[email protected]>
Simon Krajewski 1 year ago
parent
commit
b24f35d456
56 changed files with 93 additions and 4868 deletions
  1. 0 228
      std/cpp/_std/sys/db/Mysql.hx
  2. 0 203
      std/cpp/_std/sys/db/Sqlite.hx
  3. 0 6
      std/cpp/cppia/HostClasses.hx
  4. 0 59
      std/cs/_std/sys/db/Sqlite.hx
  5. 0 354
      std/cs/db/AdoNet.hx
  6. 0 36
      std/hl/_std/sys/db/Connection.hx
  7. 0 250
      std/hl/_std/sys/db/Mysql.hx
  8. 0 36
      std/hl/_std/sys/db/ResultSet.hx
  9. 0 283
      std/hl/_std/sys/db/Sqlite.hx
  10. 0 56
      std/java/_std/sys/db/Mysql.hx
  11. 0 42
      std/java/_std/sys/db/Sqlite.hx
  12. 0 318
      std/java/db/Jdbc.hx
  13. 0 409
      std/neko/Web.hx
  14. 0 213
      std/neko/_std/sys/db/Mysql.hx
  15. 0 199
      std/neko/_std/sys/db/Sqlite.hx
  16. 0 482
      std/php/Web.hx
  17. 0 268
      std/php/_std/sys/db/Mysql.hx
  18. 0 218
      std/php/_std/sys/db/Sqlite.hx
  19. 0 100
      std/php/db/Mysqli.hx
  20. 0 38
      std/php/db/Mysqli_driver.hx
  21. 0 62
      std/php/db/Mysqli_result.hx
  22. 0 57
      std/php/db/Mysqli_stmt.hx
  23. 0 32
      std/php/db/Mysqli_warning.hx
  24. 0 109
      std/php/db/PDO.hx
  25. 0 30
      std/php/db/PDOException.hx
  26. 0 48
      std/php/db/PDOStatement.hx
  27. 0 50
      std/php/db/SQLite3.hx
  28. 0 36
      std/php/db/SQLite3Result.hx
  29. 0 38
      std/php/db/SQLite3Stmt.hx
  30. 0 36
      std/sys/db/Connection.hx
  31. 0 37
      std/sys/db/Mysql.hx
  32. 0 70
      std/sys/db/ResultSet.hx
  33. 0 41
      std/sys/db/Sqlite.hx
  34. 1 13
      tests/RunCi.hx
  35. 0 1
      tests/echoServer/.gitignore
  36. 0 6
      tests/echoServer/EchoServer.hx
  37. 0 2
      tests/echoServer/build.hxml
  38. 0 7
      tests/echoServer/www/crossdomain.xml
  39. 2 2
      tests/server/src/cases/display/issues/Issue8381.hx
  40. 2 2
      tests/server/src/cases/display/issues/Issue8602.hx
  41. 2 2
      tests/server/src/cases/display/issues/Issue8991.hx
  42. 2 2
      tests/server/src/cases/display/issues/Issue9012.hx
  43. 1 1
      tests/server/src/cases/display/issues/Issue9705.hx
  44. 2 2
      tests/server/src/utils/Vfs.hx
  45. 0 4
      tests/sys/src/Main.hx
  46. 0 27
      tests/sys/src/db/SqliteSetup.hx
  47. 0 60
      tests/sys/src/db/TestSqliteConnection.hx
  48. 0 62
      tests/sys/src/db/TestSqliteResultSet.hx
  49. 0 39
      tests/unit/src/RunExe.hx
  50. 0 17
      tests/unit/src/RunJava.hx
  51. 1 1
      tests/unit/src/unit/Test.hx
  52. 0 81
      tests/unit/src/unit/TestHttp.hx
  53. 0 8
      tests/unit/src/unit/TestMain.hx
  54. 72 60
      tests/unit/src/unit/TestPhp.hx
  55. 8 8
      tests/unit/src/unit/issues/Issue10876.hx
  56. 0 17
      tests/unit/src/unit/issues/Issue5270.hx

+ 0 - 228
std/cpp/_std/sys/db/Mysql.hx

@@ -1,228 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-@:keep
-private class D {
-	@:native("_hx_mysql_connect")
-	extern public static function connect(params:Dynamic):Dynamic;
-
-	@:native("_hx_mysql_select_db")
-	extern public static function select_db(handle:Dynamic, db:String):Void;
-
-	@:native("_hx_mysql_request")
-	extern public static function request(handle:Dynamic, req:String):Dynamic;
-
-	@:native("_hx_mysql_close")
-	extern public static function close(handle:Dynamic):Dynamic;
-
-	@:native("_hx_mysql_escape")
-	extern public static function escape(handle:Dynamic, str:String):String;
-
-	@:native("_hx_mysql_result_get_length")
-	extern public static function result_get_length(handle:Dynamic):Int;
-
-	@:native("_hx_mysql_result_get_nfields")
-	extern public static function result_get_nfields(handle:Dynamic):Int;
-
-	@:native("_hx_mysql_result_next")
-	extern public static function result_next(handle:Dynamic):Dynamic;
-
-	@:native("_hx_mysql_result_get")
-	extern public static function result_get(handle:Dynamic, i:Int):String;
-
-	@:native("_hx_mysql_result_get_int")
-	extern public static function result_get_int(handle:Dynamic, i:Int):Int;
-
-	@:native("_hx_mysql_result_get_float")
-	extern public static function result_get_float(handle:Dynamic, i:Int):Float;
-
-	@:native("_hx_mysql_result_get_fields_names")
-	extern public static function result_fields_names(handle:Dynamic):Array<String>;
-
-	@:native("_hx_mysql_set_conversion")
-	extern public static function set_conv_funs(charsToBytes:cpp.Callable<Dynamic->Dynamic>, intToDate:cpp.Callable<Float->Dynamic>):Void;
-
-	public static function charsToBytes(data:Dynamic):Dynamic
-		return haxe.io.Bytes.ofData(data);
-
-	public static function secondsToDate(seconds:Float):Dynamic
-		return Date.fromTime(seconds * 1000);
-}
-
-private class MysqlResultSet implements sys.db.ResultSet {
-	public var length(get, null):Int;
-	public var nfields(get, null):Int;
-
-	private var __r:Dynamic;
-	private var cache:Dynamic;
-
-	public function new(r:Dynamic) {
-		__r = r;
-	}
-
-	private function get_length() {
-		return D.result_get_length(__r);
-	}
-
-	private function get_nfields() {
-		return D.result_get_nfields(__r);
-	}
-
-	public function hasNext() {
-		if (cache == null)
-			cache = next();
-		return (cache != null);
-	}
-
-	public function next():Dynamic {
-		var c = cache;
-		if (c != null) {
-			cache = null;
-			return c;
-		}
-		c = D.result_next(__r);
-		return c;
-	}
-
-	public function results():List<Dynamic> {
-		var l = new List();
-		while (hasNext())
-			l.add(next());
-		return l;
-	}
-
-	public function getResult(n:Int) {
-		return D.result_get(__r, n);
-	}
-
-	public function getIntResult(n:Int):Int {
-		return D.result_get_int(__r, n);
-	}
-
-	public function getFloatResult(n:Int):Float {
-		return D.result_get_float(__r, n);
-	}
-
-	public function getFieldsNames():Array<String> {
-		var a = D.result_fields_names(__r);
-		return a;
-	}
-}
-
-private class MysqlConnection implements sys.db.Connection {
-	private var __c:Dynamic;
-
-	public function new(c:Dynamic) {
-		__c = c;
-		D.set_conv_funs(cpp.Function.fromStaticFunction(D.charsToBytes), cpp.Function.fromStaticFunction(D.secondsToDate));
-	}
-
-	public function request(s:String):sys.db.ResultSet {
-		var r = D.request(this.__c, s);
-		return new MysqlResultSet(r);
-	}
-
-	public function close() {
-		D.close(__c);
-	}
-
-	public function escape(s:String) {
-		return D.escape(__c, s);
-	}
-
-	public function quote(s:String) {
-		return "'" + escape(s) + "'";
-	}
-
-	public function addValue(s:StringBuf, v:Dynamic) {
-		if (v == null) {
-			s.add(v);
-		} else if (Std.isOfType(v, Bool)) {
-			s.add(v ? 1 : 0);
-		} else {
-			var t:Int = untyped v.__GetType();
-			if (t == 0xff)
-				s.add(v);
-			else if (t == 2)
-				s.add(untyped v.__GetInt() ? "1".code : "0".code);
-			else {
-				s.addChar("'".code);
-				s.add(escape(Std.string(v)));
-				s.addChar("'".code);
-			}
-		}
-	}
-
-	public function lastInsertId() {
-		return request("SELECT LAST_INSERT_ID()").getIntResult(0);
-	}
-
-	public function dbName() {
-		return "MySQL";
-	}
-
-	public function startTransaction() {
-		request("START TRANSACTION");
-	}
-
-	public function commit() {
-		request("COMMIT");
-	}
-
-	public function rollback() {
-		request("ROLLBACK");
-	}
-
-	private static var __use_date = Date;
-}
-
-@:buildXml('<include name="${HXCPP}/src/hx/libs/mysql/Build.xml"/>')
-@:coreApi class Mysql {
-	public static function connect(params:{
-		host:String,
-		?port:Int,
-		user:String,
-		pass:String,
-		?socket:String,
-		?database:String
-	}):sys.db.Connection {
-		var o = {
-			host: params.host,
-			port: if (params.port == null) 3306 else params.port,
-			user: params.user,
-			pass: params.pass,
-			socket: if (params.socket == null) null else params.socket
-		};
-		var c = D.connect(o);
-		if (params.database != null) {
-			try {
-				D.select_db(c, params.database);
-			} catch (e:Dynamic) {
-				D.close(c);
-				cpp.Lib.rethrow(e);
-			}
-		}
-		return new MysqlConnection(c);
-	}
-}

+ 0 - 203
std/cpp/_std/sys/db/Sqlite.hx

@@ -1,203 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-private class SqliteConnection implements Connection {
-	var c:Dynamic;
-
-	public function new(file:String) {
-		c = _connect(file);
-	}
-
-	public function close() {
-		_close(c);
-	}
-
-	public function request(s:String):ResultSet {
-		try {
-			return new SqliteResultSet(_request(c, s));
-		} catch (e:String) {
-			throw "Error while executing " + s + " (" + e + ")";
-		}
-	}
-
-	public function escape(s:String) {
-		return s.split("'").join("''");
-	}
-
-	public function quote(s:String) {
-		if (s.indexOf("\000") >= 0) {
-			var hexChars = new Array<String>();
-			for (i in 0...s.length)
-				hexChars.push(StringTools.hex(StringTools.fastCodeAt(s, i), 2));
-			return "x'" + hexChars.join("") + "'";
-		}
-		return "'" + s.split("'").join("''") + "'";
-	}
-
-	public function addValue(s:StringBuf, v:Dynamic) {
-		if (v == null) {
-			s.add(v);
-		} else if (Std.isOfType(v, Bool)) {
-			s.add(v ? 1 : 0);
-		} else {
-			var t:Int = untyped v.__GetType();
-			if (t == 0xff)
-				s.add(v);
-			else if (t == 2)
-				s.add(untyped v.__GetInt());
-			else
-				s.add(quote(Std.string(v)));
-		}
-	}
-
-	public function lastInsertId():Int {
-		return _last_id(c);
-	}
-
-	public function dbName() {
-		return "SQLite";
-	}
-
-	public function startTransaction() {
-		request("BEGIN TRANSACTION");
-	}
-
-	public function commit() {
-		request("COMMIT");
-	}
-
-	public function rollback() {
-		request("ROLLBACK");
-	}
-
-	@:native("_hx_sqlite_connect")
-	extern public static function _connect(filename:String):Dynamic;
-
-	@:native("_hx_sqlite_request")
-	extern public static function _request(handle:Dynamic, req:String):Dynamic;
-
-	@:native("_hx_sqlite_close")
-	extern public static function _close(handle:Dynamic):Void;
-
-	@:native("_hx_sqlite_last_insert_id")
-	extern public static function _last_id(handle:Dynamic):Int;
-}
-
-private class SqliteResultSet implements ResultSet {
-	public var length(get, null):Int;
-	public var nfields(get, null):Int;
-
-	var r:Dynamic;
-	var cache:List<Dynamic>;
-
-	public function new(r:Dynamic) {
-		cache = new List();
-		this.r = r;
-		hasNext(); // execute the request
-	}
-
-	function get_length() {
-		if (nfields != 0) {
-			while (true) {
-				var c = result_next(r);
-				if (c == null)
-					break;
-				cache.add(c);
-			}
-			return cache.length;
-		}
-		return result_get_length(r);
-	}
-
-	function get_nfields() {
-		return result_get_nfields(r);
-	}
-
-	public function hasNext() {
-		var c = next();
-		if (c == null)
-			return false;
-		cache.push(c);
-		return true;
-	}
-
-	public function next():Dynamic {
-		var c = cache.pop();
-		if (c != null)
-			return c;
-		return result_next(r);
-	}
-
-	public function results():List<Dynamic> {
-		var l = new List();
-		while (true) {
-			var c = next();
-			if (c == null)
-				break;
-			l.add(c);
-		}
-		return l;
-	}
-
-	public function getResult(n:Int) {
-		return new String(result_get(r, n));
-	}
-
-	public function getIntResult(n:Int):Int {
-		return result_get_int(r, n);
-	}
-
-	public function getFloatResult(n:Int):Float {
-		return result_get_float(r, n);
-	}
-
-	public function getFieldsNames():Array<String> {
-		throw new haxe.exceptions.NotImplementedException();
-	}
-
-	@:native("_hx_sqlite_result_next")
-	extern public static function result_next(handle:Dynamic):Dynamic;
-
-	@:native("_hx_sqlite_result_get_length")
-	extern public static function result_get_length(handle:Dynamic):Int;
-
-	@:native("_hx_sqlite_result_get_nfields")
-	extern public static function result_get_nfields(handle:Dynamic):Int;
-
-	@:native("_hx_sqlite_result_get")
-	extern public static function result_get(handle:Dynamic, i:Int):String;
-
-	@:native("_hx_sqlite_result_get_int")
-	extern public static function result_get_int(handle:Dynamic, i:Int):Int;
-
-	@:native("_hx_sqlite_result_get_float")
-	extern public static function result_get_float(handle:Dynamic, i:Int):Float;
-}
-
-@:buildXml('<include name="${HXCPP}/src/hx/libs/sqlite/Build.xml"/>')
-@:coreApi class Sqlite {
-	public static function open(file:String):Connection {
-		return new SqliteConnection(file);
-	}
-}

+ 0 - 6
std/cpp/cppia/HostClasses.hx

@@ -59,8 +59,6 @@ class HostClasses {
 		"cpp.Finalizable",
 		"cpp.Finalizable",
 		"Std",
 		"Std",
 		"StringBuf",
 		"StringBuf",
-		"sys.db.Mysql",
-		"sys.db.Sqlite",
 		"sys.FileSystem",
 		"sys.FileSystem",
 		"sys.io.File",
 		"sys.io.File",
 		"sys.io.FileInput",
 		"sys.io.FileInput",
@@ -180,10 +178,6 @@ class HostClasses {
 		externs.set("haxe._Int32.___Int32", true);
 		externs.set("haxe._Int32.___Int32", true);
 		// Hidded in implementation classes
 		// Hidded in implementation classes
 		// externs.set("sys.db.RecordType",true);
 		// externs.set("sys.db.RecordType",true);
-		externs.set("sys.db._Sqlite.SqliteConnection", true);
-		externs.set("sys.db._Sqlite.SqliteResultSet", true);
-		externs.set("sys.db._Mysql.MysqlConnection", true);
-		externs.set("sys.db._Mysql.MysqlResultSet", true);
 		externs.set("sys.net._Socket.SocketInput", true);
 		externs.set("sys.net._Socket.SocketInput", true);
 		externs.set("sys.net._Socket.SocketOutput", true);
 		externs.set("sys.net._Socket.SocketOutput", true);
 		externs.set("sys.ssl._Socket.SocketInput", true);
 		externs.set("sys.ssl._Socket.SocketInput", true);

+ 0 - 59
std/cs/_std/sys/db/Sqlite.hx

@@ -1,59 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-class Sqlite {
-	static var type:Class<cs.system.data.IDbConnection>;
-
-	public static function open(file:String):sys.db.Connection {
-		var cnxString = 'Data Source=$file';
-		if (type == null) {
-			var t = null;
-			var assemblies = cs.system.AppDomain.CurrentDomain.GetAssemblies();
-			for (i in 0...assemblies.Length) {
-				var a = assemblies[i];
-				t = a.GetType('Mono.Data.Sqlite.SqliteConnection');
-				if (t == null)
-					t = a.GetType('System.Data.SQLite.SQLiteConnection');
-				if (t != null) {
-					break;
-				}
-			}
-
-			if (t == null) {
-				var asm = cs.system.reflection.Assembly.Load('Mono.Data.Sqlite');
-				t = asm.GetType('Mono.Data.Sqlite.SqliteConnection');
-			}
-
-			if (t != null)
-				type = cast cs.Lib.fromNativeType(t);
-		}
-
-		if (type == null) {
-			throw "No ADO.NET SQLite provider was found!";
-		}
-		var ret = Type.createInstance(type, [cnxString]);
-		ret.Open();
-		return cs.db.AdoNet.create(ret, 'SQLite');
-	}
-}

+ 0 - 354
std/cs/db/AdoNet.hx

@@ -1,354 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package cs.db;
-
-import sys.db.*;
-import cs.system.data.*;
-
-class AdoNet {
-	public static function create(cnx:IDbConnection, dbName:String):Connection {
-		return new AdoConnection(cnx, dbName);
-	}
-}
-
-private class AdoConnection implements Connection {
-	private static var ids = 0;
-
-	private var id:Int;
-
-	private var cnx:IDbConnection;
-	// escape handling
-	private var escapeRegex:EReg;
-	private var escapes:Array<IDbDataParameter>;
-	private var name:String;
-	private var command:IDbCommand;
-	private var transaction:IDbTransaction;
-
-	public function new(cnx, name:String) {
-		this.id = cs.system.threading.Interlocked.Increment(ids);
-		this.cnx = cnx;
-		this.name = name;
-		this.escapes = [];
-		this.command = cnx.CreateCommand();
-		this.escapeRegex = ~/@HX_ESCAPE(\d+)_(\d+)/;
-	}
-
-	public function close():Void {
-		cnx.Close();
-	}
-
-	public function escape(s:String):String {
-		var param = command.CreateParameter();
-		var name = "@HX_ESCAPE" + id + "_" + escapes.push(param) + "";
-		param.ParameterName = name;
-		param.Value = s;
-		return name;
-	}
-
-	public function quote(s:String):String {
-		var param = command.CreateParameter();
-		var name = "@HX_ESCAPE" + id + "_" + escapes.push(param) + "";
-		param.ParameterName = name;
-		param.Value = s;
-		return name;
-	}
-
-	public function addValue(s:StringBuf, v:Dynamic) {
-		if (Std.isOfType(v, Date)) {
-			v = Std.string(v);
-		} else if (Std.isOfType(v, haxe.io.Bytes)) {
-			var bt:haxe.io.Bytes = v;
-			v = bt.getData();
-		}
-		var param = command.CreateParameter();
-		var name = "@HX_ESCAPE" + id + "_" + escapes.push(param) + "";
-		param.ParameterName = name;
-		param.Value = v;
-		s.add(name);
-	}
-
-	public function lastInsertId():Int {
-		var ret = cnx.CreateCommand();
-		ret.CommandText = switch (name) {
-			case 'SQLite':
-				'SELECT last_insert_rowid()';
-			case _:
-				'SELECT @@IDENTITY';
-		}
-		ret.CommandType = CommandType.Text;
-		var r = cast ret.ExecuteScalar();
-		ret.Dispose();
-
-		return r;
-	}
-
-	public function dbName():String {
-		return name;
-	}
-
-	public function startTransaction():Void {
-		if (this.transaction != null)
-			throw 'Transaction already active';
-		this.transaction = cnx.BeginTransaction();
-	}
-
-	public function commit():Void {
-		if (this.transaction == null)
-			throw 'No transaction was initiated';
-		this.transaction.Commit();
-	}
-
-	public function rollback():Void {
-		if (this.transaction == null)
-			throw 'No transaction was initiated';
-		this.transaction.Rollback();
-	}
-
-	private static function getFirstStatement(s:String) {
-		var buf = new StringBuf();
-		var hasData = false;
-		var chr = 0, i = 0;
-		inline function getch()
-			return chr = StringTools.fastCodeAt(s, i++);
-		while (!StringTools.isEof(getch())) {
-			inline function peek() {
-				var c = StringTools.fastCodeAt(s, i);
-				if (StringTools.isEof(c))
-					break;
-				return c;
-			}
-			switch (chr) {
-				case ' '.code | '\t'.code | '\n'.code:
-					if (hasData)
-						return buf.toString();
-				case '-'.code if (peek() == '-'.code):
-					if (hasData)
-						return buf.toString();
-					while (!StringTools.isEof(getch())) {
-						if (chr == '\n'.code)
-							break;
-					}
-				case '#'.code:
-					if (hasData)
-						return buf.toString();
-					while (!StringTools.isEof(getch())) {
-						if (chr == '\n'.code)
-							break;
-					}
-				case '/'.code if (peek() == '*'.code):
-					i++;
-					if (hasData)
-						return buf.toString();
-					while (!StringTools.isEof(getch())) {
-						if (chr == '*'.code && peek() == '/'.code) {
-							i++;
-							break;
-						}
-					}
-				case _:
-					hasData = true;
-					buf.addChar(chr);
-			}
-		}
-		return buf.toString();
-	}
-
-	public function request(s:String):ResultSet {
-		var newst = new StringBuf();
-		// cycle through the request string, adding any @HX_ESCAPE reference to the command
-		var ret:ResultSet = null;
-		var r = escapeRegex;
-		var myid = id + "", escapes = escapes, elen = escapes.length;
-		var cmd = this.command;
-		try {
-			while (r.match(s)) {
-				var id = r.matched(1);
-				#if debug
-				if (id != myid)
-					throw "Request quotes are only valid for one single request; They can't be cached.";
-				#end
-
-				newst.add(r.matchedLeft());
-				var eid = Std.parseInt(r.matched(2));
-				#if debug
-				if (eid == null || eid > elen)
-					throw "Invalid request quote ID " + eid;
-				#end
-				cmd.Parameters.Add(escapes[eid - 1]);
-				newst.add(escapes[eid - 1].ParameterName);
-				s = r.matchedRight();
-			}
-			newst.add(s);
-
-			s = newst.toString();
-			cmd.CommandText = s;
-
-			var stmt = getFirstStatement(s).toLowerCase();
-			if (stmt == 'select') {
-				ret = new AdoResultSet(cmd.ExecuteReader());
-			} else {
-				cmd.ExecuteNonQuery();
-				ret = EmptyResultSet.empty;
-			}
-
-			if (escapes.length != 0)
-				this.escapes = [];
-			this.id = cs.system.threading.Interlocked.Increment(ids);
-			cmd.Dispose();
-			this.command = cnx.CreateCommand();
-			return ret;
-		} catch (e:Dynamic) {
-			if (escapes.length != 0)
-				this.escapes = [];
-			this.id = cs.system.threading.Interlocked.Increment(ids);
-			try {
-				cmd.Dispose();
-			} catch (e:Dynamic) {}
-			this.command = cnx.CreateCommand();
-			cs.Lib.rethrow(e);
-		}
-		return null;
-	}
-}
-
-private class AdoResultSet implements ResultSet {
-	public var length(get, null):Int;
-	public var nfields(get, null):Int;
-
-	private var reader:IDataReader;
-	private var didNext:Bool;
-	private var names:Array<String>;
-	private var types:Array<Class<Dynamic>>;
-
-	public function new(reader) {
-		this.reader = reader;
-		this.names = [for (i in 0...reader.FieldCount) reader.GetName(i)];
-		this.types = [for (i in 0...names.length) cs.Lib.fromNativeType(reader.GetFieldType(i))];
-	}
-
-	private function get_length() {
-		return reader.Depth;
-	}
-
-	private function get_nfields() {
-		return names.length;
-	}
-
-	public function hasNext():Bool {
-		didNext = true;
-		return reader.Read();
-	}
-
-	public function next():Dynamic {
-		if (!didNext && !hasNext())
-			return null;
-		didNext = false;
-		var ret = {}, names = names, types = types;
-		for (i in 0...names.length) {
-			var name = names[i], t = types[i], val:Dynamic = null;
-			if (reader.IsDBNull(i)) {
-				val = null;
-			} else if (t == cs.system.Single) {
-				val = reader.GetDouble(i);
-			} else if (t == cs.system.DateTime || t == cs.system.TimeSpan) {
-				var d = reader.GetDateTime(i);
-				if (d != null)
-					val = @:privateAccess Date.fromNative(d);
-			} else if (t == cs.system.DBNull) {
-				val = null;
-			} else if (t == cs.system.Byte) {
-				var v2:cs.StdTypes.UInt8 = reader.GetValue(i);
-				val = cast(v2, Int);
-			} else if (Std.string(t) == 'System.Byte[]') {
-				val = haxe.io.Bytes.ofData(reader.GetValue(i));
-			} else {
-				val = reader.GetValue(i);
-			}
-			if (Std.isOfType(val, cs.system.DBNull))
-				val = null;
-			Reflect.setField(ret, name, val);
-		}
-		return ret;
-	}
-
-	public function results():List<Dynamic> {
-		var l = new List();
-		while (hasNext())
-			l.add(next());
-		return l;
-	}
-
-	public function getResult(n:Int):String {
-		return reader.GetString(n);
-	}
-
-	public function getIntResult(n:Int):Int {
-		return reader.GetInt32(n);
-	}
-
-	public function getFloatResult(n:Int):Float {
-		return reader.GetDouble(n);
-	}
-
-	public function getFieldsNames():Null<Array<String>> {
-		return names;
-	}
-}
-
-private class EmptyResultSet implements ResultSet {
-	public static var empty = new EmptyResultSet();
-
-	public function new() {}
-
-	public var length(get, null):Int;
-	public var nfields(get, null):Int;
-
-	private function get_length() {
-		return 0;
-	}
-
-	private function get_nfields() {
-		return 0;
-	}
-
-	public function hasNext():Bool
-		return false;
-
-	public function next():Dynamic
-		return null;
-
-	public function results():List<Dynamic>
-		return new List();
-
-	public function getResult(n:Int):String
-		return null;
-
-	public function getIntResult(n:Int):Int
-		return 0;
-
-	public function getFloatResult(n:Int):Float
-		return 0;
-
-	public function getFieldsNames():Null<Array<String>>
-		return null;
-}

+ 0 - 36
std/hl/_std/sys/db/Connection.hx

@@ -1,36 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-interface Connection {
-	function request(s:String):ResultSet;
-	function close():Void;
-	function escape(s:String):String;
-	function quote(s:String):String;
-	function addValue(s:StringBuf, v:Dynamic):Void;
-	function lastInsertId():Int;
-	function dbName():String;
-	function startTransaction():Void;
-	function commit():Void;
-	function rollback():Void;
-}

+ 0 - 250
std/hl/_std/sys/db/Mysql.hx

@@ -1,250 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-private class MysqlParams {
-	public var host:hl.Bytes;
-	public var user:hl.Bytes;
-	public var pass:hl.Bytes;
-	public var socket:hl.Bytes;
-	public var port:Int;
-
-	public function new() {}
-}
-
-private typedef ConnectionHandler = hl.Abstract<"mysql_cnx">;
-private typedef ResultHandler = hl.Abstract<"mysql_result">;
-
-@:hlNative("mysql")
-private class MysqlResultSet implements sys.db.ResultSet {
-	public var length(get, null):Int;
-	public var nfields(get, null):Int;
-
-	private var r:ResultHandler;
-	private var cache:Dynamic;
-
-	function new(r) {
-		this.r = r;
-	}
-
-	private function get_length() {
-		return result_get_length(r);
-	}
-
-	private function get_nfields() {
-		return result_get_nfields(r);
-	}
-
-	public function hasNext() {
-		if (cache == null)
-			cache = next();
-		return (cache != null);
-	}
-
-	public function next():Dynamic {
-		var c = cache;
-		if (c != null) {
-			cache = null;
-			return c;
-		}
-		c = result_next(r);
-		return c;
-	}
-
-	public function results():List<Dynamic> {
-		var l = new List();
-		while (hasNext())
-			l.add(next());
-		return l;
-	}
-
-	public function getResult(n:Int) {
-		var v = result_get(r, n);
-		if (v == null)
-			return null;
-		return @:privateAccess String.fromUTF8(v);
-	}
-
-	public function getIntResult(n:Int):Int {
-		return result_get_int(r, n);
-	}
-
-	public function getFloatResult(n:Int):Float {
-		return result_get_float(r, n);
-	}
-
-	public function getFieldsNames():Array<String> {
-		var a = result_get_fields_names(r);
-		return [for (v in a) @:privateAccess String.fromUTF8(v)];
-	}
-
-	static function result_get_length(r:ResultHandler):Int {
-		return 0;
-	}
-
-	static function result_get_nfields(r:ResultHandler):Int {
-		return 0;
-	}
-
-	static function result_next(r:ResultHandler):Dynamic {
-		return null;
-	}
-
-	static function result_get(r:ResultHandler, n:Int):hl.Bytes {
-		return null;
-	}
-
-	static function result_get_int(r:ResultHandler, n:Int):Int {
-		return 0;
-	}
-
-	static function result_get_float(r:ResultHandler, n:Int):Float {
-		return 0.;
-	}
-
-	static function result_get_fields_names(r:ResultHandler):hl.NativeArray<hl.Bytes> {
-		return null;
-	}
-}
-
-@:hlNative("mysql")
-private class MysqlConnection implements Connection {
-	var h:ConnectionHandler;
-
-	function new(h) {
-		this.h = h;
-	}
-
-	public function close() {
-		if (h != null)
-			close_wrap(h);
-		h = null;
-	}
-
-	public function request(s:String) @:privateAccess {
-		var len = 0;
-		var b = s.bytes.utf16ToUtf8(0, len);
-		return new MysqlResultSet(request_wrap(h, b, len));
-	}
-
-	public function escape(s:String) @:privateAccess {
-		var len = 0;
-		var utf = s.bytes.utf16ToUtf8(0, len);
-		return String.fromUTF8(escape_wrap(h, utf, len));
-	}
-
-	public function quote(s:String) {
-		return "'" + escape(s) + "'";
-	}
-
-	public function addValue(s:StringBuf, v:Dynamic) {
-		if (v == null) {
-			s.add(null);
-			return;
-		}
-		var t = hl.Type.getDynamic(v).kind;
-		if (t == HI32 || t == HF64)
-			s.add(v);
-		else if (t == HBool)
-			s.addChar(if (v) "1".code else "0".code);
-		else {
-			s.addChar("'".code);
-			s.add(escape(Std.string(v)));
-			s.addChar("'".code);
-		}
-	}
-
-	public function lastInsertId() {
-		return request("SELECT LAST_INSERT_ID()").getIntResult(0);
-	}
-
-	public function dbName() {
-		return "MySQL";
-	}
-
-	public function startTransaction() {
-		request("START TRANSACTION");
-	}
-
-	public function commit() {
-		request("COMMIT");
-	}
-
-	public function rollback() {
-		request("ROLLBACK");
-	}
-
-	static function close_wrap(h:ConnectionHandler) {}
-
-	static function connect_wrap(p:MysqlParams):ConnectionHandler {
-		return null;
-	}
-
-	static function select_db_wrap(h:ConnectionHandler, db:hl.Bytes):Bool {
-		return false;
-	}
-
-	@:hlNative("mysql", "request")
-	static function request_wrap(h:ConnectionHandler, rq:hl.Bytes, rqLen:Int):ResultHandler {
-		return null;
-	}
-
-	@:hlNative("mysql", "escape")
-	static function escape_wrap(h:ConnectionHandler, str:hl.Bytes, len:Int):hl.Bytes {
-		return null;
-	}
-
-	static function setConvFuns(fstring:Dynamic, fbytes:Dynamic, fdate:Dynamic, fjson:Dynamic) {};
-}
-
-class Mysql {
-	static var INIT_DONE = false;
-
-	public static function connect(params:{
-		host:String,
-		?port:Int,
-		user:String,
-		pass:String,
-		?socket:String,
-		?database:String
-	}):sys.db.Connection@:privateAccess {
-		if (!INIT_DONE) {
-			INIT_DONE = true;
-			MysqlConnection.setConvFuns(function(v:hl.Bytes) return @:privateAccess String.fromUTF8(v),
-			function(v:hl.Bytes, len:Int) return new haxe.io.Bytes(v, len), function(t) return Date.fromTime(1000. * t),
-			function(v:hl.Bytes) return haxe.Json.parse(@:privateAccess String.fromUTF8(v)));
-		}
-		var p = new MysqlParams();
-		p.host = params.host == null ? null : params.host.toUtf8();
-		p.user = params.user.toUtf8();
-		p.pass = params.pass.toUtf8();
-		p.socket = params.socket == null ? null : params.socket.toUtf8();
-		p.port = params.port == null ? 3306 : params.port;
-		var cnx = new MysqlConnection(MysqlConnection.connect_wrap(p));
-		if (params.database != null && !MysqlConnection.select_db_wrap(cnx.h, params.database.toUtf8())) {
-			cnx.close();
-			throw "Failed to select database " + params.database;
-		}
-		return cnx;
-	}
-}

+ 0 - 36
std/hl/_std/sys/db/ResultSet.hx

@@ -1,36 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-interface ResultSet {
-	var length(get, null):Int;
-	var nfields(get, null):Int;
-
-	function hasNext():Bool;
-	function next():Dynamic;
-	function results():List<Dynamic>;
-	function getResult(n:Int):String;
-	function getIntResult(n:Int):Int;
-	function getFloatResult(n:Int):Float;
-	function getFieldsNames():Null<Array<String>>;
-}

+ 0 - 283
std/hl/_std/sys/db/Sqlite.hx

@@ -1,283 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-import haxe.crypto.BaseCode;
-
-private typedef SqliteConnectionHandle = hl.Abstract<"sqlite_database">;
-private typedef SqliteResultHandle = hl.Abstract<"sqlite_result">;
-
-@:hlNative("sqlite")
-private class SqliteLib {
-	public static function connect(path:hl.Bytes):SqliteConnectionHandle {
-		return null;
-	}
-
-	public static function close(c:SqliteConnectionHandle):Void {}
-
-	public static function request(c:SqliteConnectionHandle, sql:hl.Bytes):SqliteResultHandle {
-		return null;
-	}
-
-	public static function last_id(c:SqliteConnectionHandle):Int {
-		return 0;
-	}
-
-	public static function result_next(c:SqliteResultHandle):hl.NativeArray<Dynamic> {
-		return null;
-	}
-
-	public static function result_get(c:SqliteResultHandle, n:Int):Null<hl.Bytes> {
-		return null;
-	}
-
-	public static function result_get_int(c:SqliteResultHandle, n:Int):Null<Int> {
-		return 0;
-	}
-
-	public static function result_get_float(c:SqliteResultHandle, n:Int):Null<Float> {
-		return .0;
-	}
-
-	public static function result_get_length(c:SqliteResultHandle):Null<Int> {
-		return 0;
-	}
-
-	public static function result_get_nfields(c:SqliteResultHandle):Int {
-		return 0;
-	}
-
-	public static function result_get_fields(c:SqliteResultHandle):hl.NativeArray<hl.Bytes> {
-		return null;
-	}
-}
-
-@:access(Sys)
-@:access(String)
-private class SqliteConnection implements Connection {
-	var c:SqliteConnectionHandle;
-
-	public function new(file:String) {
-		c = SqliteLib.connect(file.bytes);
-	}
-
-	public function close():Void {
-		SqliteLib.close(c);
-	}
-
-	public function request(s:String):ResultSet {
-		try {
-			var r:SqliteResultHandle = SqliteLib.request(c, s.bytes);
-
-			return new SqliteResultSet(r);
-		} catch (e:String) {
-			throw 'Error while executing $s ($e)';
-		}
-
-		return null;
-	}
-
-	public function escape(s:String):String {
-		return s.split("'").join("''");
-	}
-
-	public function quote(s:String):String {
-		if (s.indexOf("\000") >= 0)
-			return "x'" + BaseCode.encode(s, "0123456789ABCDEF") + "'";
-
-		return "'" + s.split("'").join("''") + "'";
-	}
-
-	public function addValue(s:StringBuf, v:Dynamic):Void {
-		switch (Type.typeof(v)) {
-			case TNull, TInt:
-				s.add(v);
-			case TBool:
-				s.add(v ? 1 : 0);
-			case TClass(haxe.io.Bytes):
-				s.add("x'");
-				s.add((v : haxe.io.Bytes).toHex());
-				s.add("'");
-			case _:
-				s.add(quote(Std.string(v)));
-		}
-	}
-
-	public function lastInsertId():Int {
-		return SqliteLib.last_id(c);
-	}
-
-	public function dbName():String {
-		return "SQLite";
-	}
-
-	public function startTransaction():Void {
-		request("BEGIN TRANSACTION");
-	}
-
-	public function commit():Void {
-		request("COMMIT");
-	}
-
-	public function rollback():Void {
-		request("ROLLBACK");
-	}
-}
-
-@:access(String)
-private class SqliteResultSet implements ResultSet {
-	public var length(get, null):Int;
-	public var nfields(get, null):Int;
-
-	var names:Array<String>;
-	var cache:List<Dynamic>;
-
-	var r:SqliteResultHandle;
-
-	public function new(r:SqliteResultHandle) {
-		cache = new List();
-		this.r = r;
-		hasNext(); // execute the request
-	}
-
-	function get_length():Int {
-		if (nfields != 0) {
-			while (true) {
-				var c = doNext();
-				if (c == null)
-					break;
-
-				cache.add(c);
-			}
-
-			return cache.length;
-		}
-
-		return SqliteLib.result_get_length(r);
-	}
-
-	function get_nfields():Int {
-		return SqliteLib.result_get_nfields(r);
-	}
-
-	public function hasNext():Bool {
-		var c = next();
-		if (c == null)
-			return false;
-
-		cache.push(c);
-
-		return true;
-	}
-
-	public function next():Dynamic {
-		var c = cache.pop();
-		if (c != null)
-			return c;
-
-		return doNext();
-	}
-
-	private function doNext():Dynamic {
-		var o:Dynamic = {};
-		var a = SqliteLib.result_next(r);
-		if (a == null)
-			return null;
-
-		var names = getFieldsNames();
-		var i = 0;
-		var l = names.length;
-		while (i < l) {
-			var n:String = names[i];
-			var v:Dynamic = a[i];
-			switch (hl.Type.getDynamic(v).kind) {
-				case hl.Type.TypeKind.HArray:
-					var pair:hl.NativeArray<Dynamic> = v;
-					var bytes:hl.Bytes = pair[0];
-					var len:Int = pair[1];
-					var data = new haxe.io.BytesData(bytes, len);
-					Reflect.setField(o, n, haxe.io.Bytes.ofData(data));
-
-				case hl.Type.TypeKind.HBytes:
-					Reflect.setField(o, n, String.fromUCS2(v));
-
-				default:
-					Reflect.setField(o, n, v);
-			}
-			i++;
-		}
-		return o;
-	}
-
-	public function results():List<Dynamic> {
-		var l = new List();
-		while (true) {
-			var c = next();
-			if (c == null)
-				break;
-
-			l.add(c);
-		}
-
-		return l;
-	}
-
-	public function getResult(n:Int):String {
-		var bytes = SqliteLib.result_get(r, n);
-		if (bytes == null)
-			return null;
-
-		return String.fromUCS2(bytes);
-	}
-
-	public function getIntResult(n:Int):Int {
-		return SqliteLib.result_get_int(r, n);
-	}
-
-	public function getFloatResult(n:Int):Float {
-		return SqliteLib.result_get_float(r, n);
-	}
-
-	public function getFieldsNames():Array<String> {
-		if (this.names != null)
-			return this.names;
-
-		this.names = [];
-		var names = SqliteLib.result_get_fields(r);
-		var i = 0;
-		var l = names.length;
-		while (i < l) {
-			var name = String.fromUCS2(names[i]);
-			this.names.push(name);
-			i++;
-		}
-
-		return this.names;
-	}
-}
-
-@:coreApi class Sqlite {
-	public static function open(file:String):Connection {
-		return new SqliteConnection(file);
-	}
-}

+ 0 - 56
std/java/_std/sys/db/Mysql.hx

@@ -1,56 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-class Mysql {
-	static var init = false;
-
-	public static function connect(params:{
-		host:String,
-		?port:Int,
-		user:String,
-		pass:String,
-		?socket:String,
-		?database:String
-	}):sys.db.Connection {
-		if (!init) {
-			java.lang.Class.forName("com.mysql.jdbc.Driver");
-			init = true;
-		}
-		var url = new StringBuf();
-		url.add('jdbc:mysql:');
-		if (params.socket != null) {
-			url.add(params.socket);
-		} else {
-			url.add('//');
-			url.add(params.host);
-			if (params.port != null)
-				url.add(':${params.port}');
-		}
-		if (params.database != null) {
-			url.add('/${params.database}');
-		}
-		var cnx = java.sql.DriverManager.getConnection(url.toString(), params.user, params.pass);
-		return java.db.Jdbc.create(cnx);
-	}
-}

+ 0 - 42
std/java/_std/sys/db/Sqlite.hx

@@ -1,42 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-class Sqlite {
-	static var init = false;
-
-	public static function open(file:String):sys.db.Connection {
-		if (!init) {
-			try
-				java.lang.Class.forName("org.sqlite.JDBC")
-			catch (e:Dynamic)
-				throw e;
-			init = true;
-		}
-		try {
-			var cnx = java.sql.DriverManager.getConnection("jdbc:sqlite:" + file);
-			return java.db.Jdbc.create(cnx);
-		} catch (e:Dynamic)
-			throw e;
-	}
-}

+ 0 - 318
std/java/db/Jdbc.hx

@@ -1,318 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package java.db;
-
-import haxe.io.Bytes;
-import java.sql.Types;
-import java.util.concurrent.atomic.AtomicInteger;
-
-@:native('haxe.java.db.Jdbc')
-class Jdbc {
-	public static function create(cnx:java.sql.Connection):sys.db.Connection {
-		return new JdbcConnection(cnx);
-	}
-}
-
-@:native('haxe.java.db.JdbcConnection')
-private class JdbcConnection implements sys.db.Connection {
-	private static var ids = new AtomicInteger(0);
-
-	private var id:Int;
-
-	private var cnx:java.sql.Connection;
-	private var _lastInsertId:Int;
-	// escape handling
-	private var escapeRegex:EReg;
-	private var escapes:Array<Dynamic>;
-
-	public function new(cnx) {
-		this.id = ids.getAndIncrement();
-		this.cnx = cnx;
-		this.escapes = [];
-		this.escapeRegex = ~/@@HX_ESCAPE(\d+)_(\d+)@@/;
-	}
-
-	public function close() {
-		try
-			this.cnx.close()
-		catch (e:Dynamic)
-			throw e;
-	}
-
-	public function escape(s:String):String {
-		return "@@HX_ESCAPE" + id + "_" + escapes.push(s) + "@@";
-	}
-
-	public function quote(s:String):String {
-		return "@@HX_ESCAPE" + id + "_" + escapes.push(s) + "@@";
-	}
-
-	public function addValue(s:StringBuf, v:Dynamic) {
-		if (Std.isOfType(v, Date)) {
-			v = Std.string(v);
-		} else if (Std.isOfType(v, Bytes)) {
-			var bt:Bytes = v;
-			v = bt.getData();
-		}
-		s.add("@@HX_ESCAPE");
-		s.add(id);
-		s.add("_");
-		s.add(escapes.push(v));
-		s.add("@@");
-	}
-
-	public function lastInsertId():Int {
-		return _lastInsertId;
-	}
-
-	public function dbName():String {
-		try {
-			var ret = cnx.getMetaData().getDriverName();
-			var retc = ret.toLowerCase();
-			if (retc.indexOf("mysql") != -1)
-				return "MySQL";
-			else if (retc.indexOf("sqlite") != -1)
-				return "SQLite";
-			return ret;
-		} catch (e:Dynamic) {
-			throw e;
-		}
-	}
-
-	public function startTransaction() {
-		try {
-			cnx.setAutoCommit(false);
-		} catch (e:Dynamic)
-			throw e;
-	}
-
-	public function commit() {
-		try {
-			cnx.commit();
-		} catch (e:Dynamic) {
-			throw e;
-		}
-	}
-
-	public function rollback() {
-		try
-			cnx.rollback()
-		catch (e:Dynamic)
-			throw e;
-	}
-
-	public function request(s:String):sys.db.ResultSet {
-		var newst = new StringBuf();
-		var sentArray = [];
-
-		// cycle through the request string, adding any @@HX_ESCAPE@@ reference to the sentArray
-		var r = escapeRegex;
-		var myid = id + "", escapes = escapes, elen = escapes.length;
-		try {
-			while (r.match(s)) {
-				var id = r.matched(1);
-				if (id != myid)
-					throw "Request quotes are only valid for one single request; They can't be cached.";
-
-				newst.add(r.matchedLeft());
-				var eid = Std.parseInt(r.matched(2));
-				if (eid == null || eid > elen)
-					throw "Invalid request quote ID " + eid;
-				sentArray.push(escapes[eid - 1]);
-				newst.add("?");
-				s = r.matchedRight();
-			}
-			newst.add(s);
-			var stmt = cnx.prepareStatement(newst.toString(),
-				#if jvm java.sql.Statement.RETURN_GENERATED_KEYS #else java.sql.Statement.Statement_Statics.RETURN_GENERATED_KEYS #end);
-			for (i in 0...sentArray.length) {
-				stmt.setObject(i + 1, sentArray[i]);
-			}
-
-			var ret = null, dbName = dbName();
-			if (stmt.execute()) {
-				// is a result set
-				var rs = stmt.getResultSet();
-				ret = new JdbcResultSet(rs, dbName, stmt.getMetaData());
-			} else {
-				// is an update
-				var affected = stmt.getUpdateCount();
-				if (affected == 1) {
-					var autogen = stmt.getGeneratedKeys();
-					if (autogen.next()) {
-						this._lastInsertId = autogen.getInt(1);
-					}
-				}
-				ret = new JdbcResultSet(null, dbName, null);
-			}
-
-			if (escapes.length != 0)
-				escapes = [];
-			this.id = ids.getAndIncrement();
-			return ret;
-		} catch (e:Dynamic) {
-			if (escapes.length != 0)
-				escapes = [];
-			this.id = ids.getAndIncrement();
-			throw e;
-		}
-	}
-}
-
-@:native('haxe.java.db.JdbcResultSet')
-private class JdbcResultSet implements sys.db.ResultSet {
-	@:isVar public var length(get, null):Int;
-	public var nfields(get, null):Int;
-
-	private var rs:java.sql.ResultSet;
-	private var names:Array<String>;
-	private var types:java.NativeArray<Int>;
-	private var dbName:String;
-	private var didNext:Bool;
-
-	public function new(rs, dbName, meta:java.sql.ResultSetMetaData) {
-		this.dbName = dbName;
-		this.rs = rs;
-		if (meta != null) {
-			try {
-				var count = meta.getColumnCount();
-				var names = [], types = new NativeArray(count);
-				for (i in 0...count) {
-					names.push(meta.getColumnName(i + 1));
-					types[i] = meta.getColumnType(i + 1);
-				}
-				this.types = types;
-				this.names = names;
-			} catch (e:Dynamic)
-				throw e;
-		}
-	}
-
-	private function get_length():Int {
-		if (length == 0) {
-			try {
-				var cur = rs.getRow();
-				rs.last();
-				this.length = rs.getRow();
-				rs.absolute(cur);
-			} catch (e:Dynamic)
-				throw e;
-		}
-		return length;
-	}
-
-	private function get_nfields():Int {
-		return names == null ? 0 : names.length;
-	}
-
-	public function hasNext():Bool {
-		try {
-			didNext = true;
-			return rs != null && rs.next();
-		} catch (e:Dynamic) {
-			return throw e;
-		}
-	}
-
-	public function next():Dynamic {
-		try {
-			if (rs == null)
-				return null;
-			if (didNext) {
-				didNext = false;
-			} else {
-				if (!rs.next()) {
-					return null;
-				}
-			}
-			var ret = {}, names = names, types = types;
-			for (i in 0...names.length) {
-				var name = names[i], t = types[i], val:Dynamic = null;
-				if (t == Types.FLOAT) {
-					val = rs.getDouble(i + 1);
-				} else if (t == Types.DATE || t == Types.TIME) {
-					if (dbName == "SQLite") {
-						var str = rs.getString(i + 1);
-						if (str != null) {
-							var d:Date = Date.fromString(str);
-							val = d;
-						}
-					} else {
-						var d:java.sql.Date = rs.getDate(i + 1);
-						if (d != null)
-							val = Date.fromTime(cast d.getTime());
-					}
-				} else if (t == Types.LONGVARBINARY || t == Types.VARBINARY || t == Types.BINARY || t == Types.BLOB) {
-					var b = rs.getBytes(i + 1);
-					if (b != null)
-						val = Bytes.ofData(b);
-				} else {
-					val = rs.getObject(i + 1);
-				}
-				Reflect.setField(ret, name, val);
-			}
-			return ret;
-		} catch (e:Dynamic)
-			throw e;
-	}
-
-	public function results():List<Dynamic> {
-		var l = new List();
-		if (rs == null)
-			return l;
-
-		try {
-			while (hasNext())
-				l.add(next());
-		} catch (e:Dynamic)
-			throw e;
-		return l;
-	}
-
-	public function getResult(n:Int):String {
-		try {
-			return rs.getString(n);
-		} catch (e:Dynamic)
-			throw e;
-	}
-
-	public function getIntResult(n:Int):Int {
-		try {
-			return rs.getInt(n);
-		} catch (e:Dynamic) {
-			return throw e;
-		};
-	}
-
-	public function getFloatResult(n:Int):Float {
-		try {
-			return rs.getFloat(n);
-		} catch (e:Dynamic) {
-			return throw e;
-		};
-	}
-
-	public function getFieldsNames():Null<Array<String>> {
-		return this.names;
-	}
-}

+ 0 - 409
std/neko/Web.hx

@@ -1,409 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package neko;
-
-import haxe.ds.List;
-
-/**
-	This class is used for accessing the local Web server and the current
-	client request and information.
-**/
-class Web {
-	/**
-		Returns the GET and POST parameters.
-	**/
-	public static function getParams() {
-		var p = _get_params();
-		var h = new haxe.ds.StringMap<String>();
-		var k = "";
-		while (p != null) {
-			untyped k.__s = p[0];
-			h.set(k, new String(p[1]));
-			p = untyped p[2];
-		}
-		return h;
-	}
-
-	/**
-		Returns an Array of Strings built using GET / POST values.
-		If the URL contains the parameters `[a[]=foo;a[]=hello;a[5]=bar;a[3]=baz]` then
-		`neko.Web.getParamValues("a")` will return `["foo","hello",null,"baz",null,"bar"]`
-	**/
-	public static function getParamValues(param:String):Array<String> {
-		var reg = new EReg("^" + param + "(\\[|%5B)([0-9]*?)(\\]|%5D)=(.*?)$", "");
-		var res = new Array<String>();
-		var explore = function(data:String) {
-			if (data == null || data.length == 0)
-				return;
-			for (part in data.split("&")) {
-				if (reg.match(part)) {
-					var idx = reg.matched(2);
-					var val = StringTools.urlDecode(reg.matched(4));
-					if (idx == "")
-						res.push(val);
-					else
-						res[Std.parseInt(idx)] = val;
-				}
-			}
-		}
-		explore(StringTools.replace(getParamsString(), ";", "&"));
-		explore(getPostData());
-		if (res.length == 0)
-			return null;
-		return res;
-	}
-
-	/**
-		Returns the local server host name.
-	**/
-	public static function getHostName() {
-		return new String(_get_host_name());
-	}
-
-	/**
-		Surprisingly returns the client IP address.
-	**/
-	public static function getClientIP() {
-		return new String(_get_client_ip());
-	}
-
-	/**
-		Returns the original request URL (before any server internal redirections)
-	**/
-	public static function getURI() {
-		return new String(_get_uri());
-	}
-
-	/**
-		Tell the client to redirect to the given url ("Location" header)
-	**/
-	public static function redirect(url:String) {
-		_cgi_redirect(untyped url.__s);
-	}
-
-	/**
-		Set an output header value. If some data have been printed, the headers have
-		already been sent so this will raise an exception.
-	**/
-	public static function setHeader(h:String, v:String) {
-		_cgi_set_header(untyped h.__s, untyped v.__s);
-	}
-
-	/**
-		Set the HTTP return code. Same remark as setHeader.
-	**/
-	public static function setReturnCode(r:Int) {
-		_set_return_code(r);
-	}
-
-	/**
-		Retrieve a client header value sent with the request.
-	**/
-	public static function getClientHeader(k:String) {
-		var v = _get_client_header(untyped k.__s);
-		if (v == null)
-			return null;
-		return new String(v);
-	}
-
-	/**
-		Retrieve all the client headers.
-	**/
-	public static function getClientHeaders() {
-		var v = _get_client_headers();
-		var a = new List();
-		while (v != null) {
-			a.add({header: new String(v[0]), value: new String(v[1])});
-			v = cast v[2];
-		}
-		return a;
-	}
-
-	/**
-		Returns all the GET parameters String.
-	**/
-	public static function getParamsString() {
-		var p = _get_params_string();
-		return if (p == null) "" else new String(p);
-	}
-
-	/**
-		Returns all the POST data. POST Data is always parsed as
-		being `application/x-www-form-urlencoded` and is stored into
-		the getParams hashtable. POST Data is maximimized to 256K
-		unless the content type is `multipart/form-data`. In that
-		case, you will have to use `getMultipart` or `parseMultipart`
-		methods.
-	**/
-	public static function getPostData() {
-		var v = _get_post_data();
-		if (v == null)
-			return null;
-		return new String(v);
-	}
-
-	/**
-		Returns an hashtable of all Cookies sent by the client.
-		Modifying the hashtable will not modify the cookie, use `setCookie` instead.
-	**/
-	public static function getCookies():Map<String, String> {
-		var p = _get_cookies();
-		var h = new haxe.ds.StringMap<String>();
-		var k = "";
-		while (p != null) {
-			untyped k.__s = p[0];
-			h.set(k, new String(p[1]));
-			p = untyped p[2];
-		}
-		return h;
-	}
-
-	/**
-		Set a Cookie value in the HTTP headers. Same remark as `setHeader`.
-	**/
-	public static function setCookie(key:String, value:String, ?expire:Date, ?domain:String, ?path:String, ?secure:Bool, ?httpOnly:Bool) {
-		var buf = new StringBuf();
-		buf.add(value);
-		if (expire != null)
-			addPair(buf, "expires=", DateTools.format(expire, "%a, %d-%b-%Y %H:%M:%S GMT"));
-		addPair(buf, "domain=", domain);
-		addPair(buf, "path=", path);
-		if (secure)
-			addPair(buf, "secure", "");
-		if (httpOnly)
-			addPair(buf, "HttpOnly", "");
-		var v = buf.toString();
-		_set_cookie(untyped key.__s, untyped v.__s);
-	}
-
-	static function addPair(buf:StringBuf, name:String, value:String) {
-		if (value == null)
-			return;
-		buf.add("; ");
-		buf.add(name);
-		buf.add(value);
-	}
-
-	/**
-		Returns an object with the authorization sent by the client (Basic scheme only).
-	**/
-	public static function getAuthorization():{user:String, pass:String} {
-		var h = getClientHeader("Authorization");
-		var reg = ~/^Basic ([^=]+)=*$/;
-		if (h != null && reg.match(h)) {
-			var val = reg.matched(1);
-			untyped val = new String(_base_decode(val.__s, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".__s));
-			var a = val.split(":");
-			if (a.length != 2) {
-				throw "Unable to decode authorization.";
-			}
-			return {user: a[0], pass: a[1]};
-		}
-		return null;
-	}
-
-	/**
-		Get the current script directory in the local filesystem.
-	**/
-	public static function getCwd() {
-		return new String(_get_cwd());
-	}
-
-	/**
-		Set the main entry point function used to handle requests.
-		Setting it back to null will disable code caching.
-	**/
-	public static function cacheModule(f:Void->Void) {
-		_set_main(f);
-	}
-
-	/**
-		Get the multipart parameters as an hashtable. The data
-		cannot exceed the maximum size specified.
-	**/
-	public static function getMultipart(maxSize:Int):Map<String, String> {
-		var h = new haxe.ds.StringMap();
-		var buf:haxe.io.BytesBuffer = null;
-		var curname = null;
-		parseMultipart(function(p, _) {
-			if (curname != null)
-				h.set(curname, neko.Lib.stringReference(buf.getBytes()));
-			curname = p;
-			buf = new haxe.io.BytesBuffer();
-			maxSize -= p.length;
-			if (maxSize < 0)
-				throw "Maximum size reached";
-		}, function(str, pos, len) {
-			maxSize -= len;
-			if (maxSize < 0)
-				throw "Maximum size reached";
-			buf.addBytes(str, pos, len);
-		});
-		if (curname != null)
-			h.set(curname, neko.Lib.stringReference(buf.getBytes()));
-		return h;
-	}
-
-	/**
-		Parse the multipart data. Call `onPart` when a new part is found
-		with the part name and the filename if present
-		and `onData` when some part data is read. You can this way
-		directly save the data on hard drive in the case of a file upload.
-	**/
-	public static function parseMultipart(onPart:String->String->Void, onData:haxe.io.Bytes->Int->Int->Void):Void {
-		_parse_multipart(function(p, f) {
-			onPart(new String(p), if (f == null) null else new String(f));
-		}, function(buf, pos, len) {
-			onData(untyped new haxe.io.Bytes(__dollar__ssize(buf), buf), pos, len);
-		});
-	}
-
-	/**
-		Flush the data sent to the client. By default on Apache, outgoing data is buffered so
-		this can be useful for displaying some long operation progress.
-	**/
-	public static function flush():Void {
-		_flush();
-	}
-
-	/**
-		Get the HTTP method used by the client. This API requires Neko 1.7.1+.
-	**/
-	public static function getMethod():String {
-		return new String(_get_http_method());
-	}
-
-	/**
-		Write a message into the web server log file. This API requires Neko 1.7.1+.
-	**/
-	public static function logMessage(msg:String) {
-		_log_message(untyped msg.__s);
-	}
-
-	public static var isModNeko(default, null):Bool;
-	public static var isTora(default, null):Bool;
-
-	static var _set_main:Dynamic;
-	static var _get_host_name:Dynamic;
-	static var _get_client_ip:Dynamic;
-	static var _get_uri:Dynamic;
-	static var _cgi_redirect:Dynamic;
-	static var _cgi_set_header:Dynamic;
-	static var _set_return_code:Dynamic;
-	static var _get_client_header:Dynamic;
-	static var _get_params_string:Dynamic;
-	static var _get_post_data:Dynamic;
-	static var _get_params:Dynamic;
-	static var _get_cookies:Dynamic;
-	static var _set_cookie:Dynamic;
-	static var _get_cwd:Dynamic;
-	static var _parse_multipart:Dynamic;
-	static var _flush:Dynamic;
-	static var _get_client_headers:Dynamic;
-	static var _get_http_method:Dynamic;
-	static var _base_decode = Lib.load("std", "base_decode", 2);
-	static var _log_message:Dynamic;
-
-	static function __init__() {
-		var get_env = Lib.load("std", "get_env", 1);
-		var ver = untyped get_env("MOD_NEKO".__s);
-		untyped isModNeko = (ver != null);
-		if (isModNeko) {
-			var lib = "mod_neko" + if (ver == untyped "1".__s) "" else ver;
-			_set_main = Lib.load(lib, "cgi_set_main", 1);
-			_get_host_name = Lib.load(lib, "get_host_name", 0);
-			_get_client_ip = Lib.load(lib, "get_client_ip", 0);
-			_get_uri = Lib.load(lib, "get_uri", 0);
-			_cgi_redirect = Lib.load(lib, "redirect", 1);
-			_cgi_set_header = Lib.load(lib, "set_header", 2);
-			_set_return_code = Lib.load(lib, "set_return_code", 1);
-			_get_client_header = Lib.load(lib, "get_client_header", 1);
-			_get_params_string = Lib.load(lib, "get_params_string", 0);
-			_get_post_data = Lib.load(lib, "get_post_data", 0);
-			_get_params = Lib.load(lib, "get_params", 0);
-			_get_cookies = Lib.load(lib, "get_cookies", 0);
-			_set_cookie = Lib.load(lib, "set_cookie", 2);
-			_get_cwd = Lib.load(lib, "cgi_get_cwd", 0);
-			_get_http_method = Lib.loadLazy(lib, "get_http_method", 0);
-			_parse_multipart = Lib.loadLazy(lib, "parse_multipart_data", 2);
-			_flush = Lib.loadLazy(lib, "cgi_flush", 0);
-			_get_client_headers = Lib.loadLazy(lib, "get_client_headers", 0);
-			_log_message = Lib.loadLazy(lib, "log_message", 1);
-			isTora = try Lib.load(lib, "tora_infos", 0) != null catch (e:Dynamic) false;
-		} else {
-			var a0 = untyped __dollar__loader.args[0];
-			if (a0 != null)
-				a0 = new String(a0);
-			_set_main = function(f) {};
-			_get_host_name = function() {
-				return untyped "localhost".__s;
-			};
-			_get_client_ip = function() {
-				return untyped "127.0.0.1".__s;
-			};
-			_get_uri = function() {
-				return untyped (if (a0 == null) "/" else a0).__s;
-			};
-			_cgi_redirect = function(v) {
-				Lib.print("Location: " + v + "\n");
-			};
-			_cgi_set_header = function(h, v) {};
-			_set_return_code = function(i) {};
-			_get_client_header = function(h) {
-				return null;
-			};
-			_get_client_headers = function() {
-				return null;
-			};
-			_get_params_string = function() {
-				return untyped (if (a0 == null) "" else a0).__s;
-			};
-			_get_post_data = function() {
-				return null;
-			};
-			_get_params = function() {
-				var l = null;
-				if (a0 == null)
-					return null;
-				for (p in a0.split(";")) {
-					var k = p.split("=");
-					if (k.length == 2)
-						l = untyped [k[0].__s, k[1].__s, l];
-				}
-				return l;
-			};
-			_get_cookies = function() {
-				return null;
-			}
-			_set_cookie = function(k, v) {};
-			_get_cwd = Lib.load("std", "get_cwd", 0);
-			_get_http_method = function() return untyped "GET".__s;
-			_parse_multipart = function(a, b) {
-				throw "Not supported";
-			};
-			_flush = function() {};
-			_log_message = function(s) {};
-			isTora = false;
-		}
-	}
-}

+ 0 - 213
std/neko/_std/sys/db/Mysql.hx

@@ -1,213 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-private class D {
-	static function load(fun, args):Dynamic {
-		return neko.Lib.load(lib, fun, args);
-	}
-
-	static var lib = try {
-		neko.Lib.load("mysql5", "connect", 1);
-		"mysql5";
-	} catch (e:Dynamic) "mysql";
-	public static var connect = load("connect", 1);
-	public static var select_db = load("select_db", 2);
-	public static var request = load("request", 2);
-	public static var close = load("close", 1);
-	public static var escape = load("escape", 2);
-	public static var set_conv_funs = load("set_conv_funs", 4);
-	public static var result_get_length = load("result_get_length", 1);
-	public static var result_get_nfields = load("result_get_nfields", 1);
-	public static var result_next = load("result_next", 1);
-	public static var result_get = load("result_get", 2);
-	public static var result_get_int = load("result_get_int", 2);
-	public static var result_get_float = load("result_get_float", 2);
-	public static var result_fields_names = neko.Lib.loadLazy(lib, "result_get_fields_names", 1);
-}
-
-private class MysqlResultSet implements sys.db.ResultSet {
-	public var length(get, null):Int;
-	public var nfields(get, null):Int;
-
-	private var __r:Dynamic;
-	private var cache:Dynamic;
-
-	public function new(r) {
-		__r = r;
-	}
-
-	private function get_length() {
-		return D.result_get_length(__r);
-	}
-
-	private function get_nfields() {
-		return D.result_get_nfields(__r);
-	}
-
-	public function hasNext() {
-		if (cache == null)
-			cache = next();
-		return (cache != null);
-	}
-
-	public function next():Dynamic {
-		var c = cache;
-		if (c != null) {
-			cache = null;
-			return c;
-		}
-		c = D.result_next(__r);
-		return c;
-	}
-
-	public function results():List<Dynamic> {
-		var l = new List();
-		while (hasNext())
-			l.add(next());
-		return l;
-	}
-
-	public function getResult(n:Int) {
-		return new String(D.result_get(__r, n));
-	}
-
-	public function getIntResult(n:Int):Int {
-		return D.result_get_int(__r, n);
-	}
-
-	public function getFloatResult(n:Int):Float {
-		return D.result_get_float(__r, n);
-	}
-
-	public function getFieldsNames():Array<String> {
-		var a = D.result_fields_names(__r);
-		untyped {
-			var i = 0;
-			var l = __dollar__asize(a);
-			while (i < l) {
-				a[i] = new String(a[i]);
-				i += 1;
-			}
-			a = Array.new1(cast a, l);
-		}
-		return a;
-	}
-}
-
-private class MysqlConnection implements sys.db.Connection {
-	private var __c:Dynamic;
-
-	public function new(c) {
-		__c = c;
-		D.set_conv_funs(c, function(s) return new String(s), function(d) return untyped Date.new1(d), function(b) return haxe.io.Bytes.ofData(b));
-	}
-
-	public function request(s:String):sys.db.ResultSet {
-		try {
-			var r = D.request(this.__c, untyped s.__s);
-			return new MysqlResultSet(r);
-		} catch (e:Dynamic) {
-			untyped if (__dollar__typeof(e) == __dollar__tobject && __dollar__typeof(e.msg) == __dollar__tstring)
-				e = e.msg;
-			untyped __dollar__rethrow(e);
-			return null;
-		}
-	}
-
-	public function close() {
-		D.close(__c);
-	}
-
-	public function escape(s:String) {
-		return new String(D.escape(__c, untyped s.__s));
-	}
-
-	public function quote(s:String) {
-		return "'" + escape(s) + "'";
-	}
-
-	public function addValue(s:StringBuf, v:Dynamic) {
-		var t = untyped __dollar__typeof(v);
-		if (untyped (t == __dollar__tint || t == __dollar__tnull))
-			s.add(v);
-		else if (untyped t == __dollar__tbool)
-			s.addChar(if (v) "1".code else "0".code);
-		else {
-			s.addChar("'".code);
-			s.add(escape(Std.string(v)));
-			s.addChar("'".code);
-		}
-	}
-
-	public function lastInsertId() {
-		return request("SELECT LAST_INSERT_ID()").getIntResult(0);
-	}
-
-	public function dbName() {
-		return "MySQL";
-	}
-
-	public function startTransaction() {
-		request("START TRANSACTION");
-	}
-
-	public function commit() {
-		request("COMMIT");
-	}
-
-	public function rollback() {
-		request("ROLLBACK");
-	}
-
-	private static var __use_date = Date;
-}
-
-@:coreApi class Mysql {
-	public static function connect(params:{
-		host:String,
-		?port:Int,
-		user:String,
-		pass:String,
-		?socket:String,
-		?database:String
-	}):sys.db.Connection {
-		var o = untyped {
-			host: params.host.__s,
-			port: if (params.port == null) 3306 else params.port,
-			user: params.user.__s,
-			pass: params.pass.__s,
-			socket: if (params.socket == null) null else params.socket.__s
-		};
-		var c = D.connect(o);
-		if (params.database != null) {
-			try {
-				D.select_db(c, untyped params.database.__s);
-			} catch (e:Dynamic) {
-				D.close(c);
-				neko.Lib.rethrow(e);
-			}
-		}
-		return new MysqlConnection(c);
-	}
-}

+ 0 - 199
std/neko/_std/sys/db/Sqlite.hx

@@ -1,199 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-private class SqliteConnection implements Connection {
-	var c:Dynamic;
-
-	public function new(file:String) {
-		c = _connect(untyped file.__s);
-	}
-
-	public function close() {
-		_close(c);
-	}
-
-	public function request(s:String):ResultSet {
-		try {
-			return new SqliteResultSet(_request(c, untyped s.__s));
-		} catch (e:String) {
-			throw "Error while executing " + s + " (" + e + ")";
-		}
-	}
-
-	public function escape(s:String) {
-		return s.split("'").join("''");
-	}
-
-	public function quote(s:String) {
-		if (s.indexOf("\000") >= 0)
-			return "x'" + new String(untyped _encode(s.__s, "0123456789ABCDEF".__s)) + "'";
-		return "'" + s.split("'").join("''") + "'";
-	}
-
-	public function addValue(s:StringBuf, v:Dynamic) {
-		var t = untyped __dollar__typeof(v);
-		if (untyped (t == __dollar__tint || t == __dollar__tnull))
-			s.add(v);
-		else if (untyped t == __dollar__tbool)
-			s.add(if (v) 1 else 0);
-		else
-			s.add(quote(Std.string(v)));
-	}
-
-	public function lastInsertId() {
-		return _last_id(c);
-	}
-
-	public function dbName() {
-		return "SQLite";
-	}
-
-	public function startTransaction() {
-		request("BEGIN TRANSACTION");
-	}
-
-	public function commit() {
-		request("COMMIT");
-	}
-
-	public function rollback() {
-		request("ROLLBACK");
-	}
-
-	static var _encode = neko.Lib.load("std", "base_encode", 2);
-	static var _connect = neko.Lib.load("sqlite", "connect", 1);
-	static var _close = neko.Lib.load("sqlite", "close", 1);
-	static var _request = neko.Lib.load("sqlite", "request", 2);
-	static var _last_id = neko.Lib.load("sqlite", "last_insert_id", 1);
-}
-
-private class SqliteResultSet implements ResultSet {
-	public var length(get, null):Int;
-	public var nfields(get, null):Int;
-
-	var r:Dynamic;
-	var cache:List<Dynamic>;
-
-	public function new(r) {
-		cache = new List();
-		this.r = r;
-		hasNext(); // execute the request
-	}
-
-	function get_length() {
-		if (nfields != 0) {
-			while (true) {
-				var c = doNext();
-				if (c == null)
-					break;
-				cache.add(c);
-			}
-			return cache.length;
-		}
-		return result_get_length(r);
-	}
-
-	function get_nfields() {
-		return result_get_nfields(r);
-	}
-
-	public function hasNext() {
-		var c = next();
-		if (c == null)
-			return false;
-		cache.push(c);
-		return true;
-	}
-
-	public function next():Dynamic {
-		var c = cache.pop();
-		if (c != null)
-			return c;
-		return doNext();
-	}
-
-	private function doNext():Dynamic {
-		var c = result_next(r);
-		if (c == null)
-			return null;
-		untyped {
-			var f = __dollar__objfields(c);
-			var i = 0;
-			var l = __dollar__asize(f);
-			while (i < l) {
-				var v = __dollar__objget(c, f[i]);
-				if (__dollar__typeof(v) == __dollar__tstring)
-					__dollar__objset(c, f[i], new String(v));
-				i = i + 1;
-			}
-		}
-		return c;
-	}
-
-	public function results():List<Dynamic> {
-		var l = new List();
-		while (true) {
-			var c = next();
-			if (c == null)
-				break;
-			l.add(c);
-		}
-		return l;
-	}
-
-	public function getResult(n:Int) {
-		return new String(result_get(r, n));
-	}
-
-	public function getIntResult(n:Int):Int {
-		return result_get_int(r, n);
-	}
-
-	public function getFloatResult(n:Int):Float {
-		return result_get_float(r, n);
-	}
-
-	public function getFieldsNames():Array<String> {
-		if(hasNext()) {
-			return switch cache.first() {
-				case null: null;
-				case row: Reflect.fields(row);
-			}
-		}
-		return null;
-	}
-
-	static var result_next = neko.Lib.load("sqlite", "result_next", 1);
-	static var result_get_length = neko.Lib.load("sqlite", "result_get_length", 1);
-	static var result_get_nfields = neko.Lib.load("sqlite", "result_get_nfields", 1);
-	static var result_get = neko.Lib.load("sqlite", "result_get", 2);
-	static var result_get_int = neko.Lib.load("sqlite", "result_get_int", 2);
-	static var result_get_float = neko.Lib.load("sqlite", "result_get_float", 2);
-}
-
-@:coreApi class Sqlite {
-	public static function open(file:String):Connection {
-		return new SqliteConnection(file);
-	}
-}

+ 0 - 482
std/php/Web.hx

@@ -1,482 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package php;
-
-import haxe.io.Bytes;
-import haxe.ds.Map;
-import php.Syntax.*;
-import php.Global.*;
-import php.SuperGlobal.*;
-
-/**
-	This class is used for accessing the local Web server and the current
-	client request and information.
-**/
-@:deprecated('php.Web is deprecated and will be removed from standard library. See php.SuperGlobal and php.Global for alternatives.')
-class Web {
-	/**
-		Returns the GET and POST parameters.
-	**/
-	public static function getParams():Map<String, String> {
-		#if force_std_separator
-		var h = Lib.hashOfAssociativeArray(_POST);
-		var params = getParamsString();
-		if (params == "")
-			return h;
-		for (p in ~/[;&]/g.split(params)) {
-			var a = p.split("=");
-			var n = a.shift();
-			h.set(StringTools.urlDecode(n), StringTools.urlDecode(a.join("=")));
-		}
-		return h;
-		#else
-		return Lib.hashOfAssociativeArray(array_merge(_GET, _POST));
-		#end
-	}
-
-	/**
-		Returns an Array of Strings built using GET / POST values.
-		If you have in your URL the parameters `a[]=foo;a[]=hello;a[5]=bar;a[3]=baz` then
-		`php.Web.getParamValues("a")` will return `["foo","hello",null,"baz",null,"bar"]`.
-	**/
-	public static function getParamValues(param:String):Array<String> {
-		var reg = new EReg("^" + param + "(\\[|%5B)([0-9]*?)(\\]|%5D)=(.*?)$", "");
-		var res = new Array<String>();
-		var explore = function(data:String) {
-			if (data == null || Global.strlen(data) == 0)
-				return;
-			for (part in data.split("&")) {
-				if (reg.match(part)) {
-					var idx = reg.matched(2);
-					var val = StringTools.urlDecode(reg.matched(4));
-					if (idx == "")
-						res.push(val);
-					else
-						res[Std.parseInt(idx)] = val;
-				}
-			}
-		}
-		explore(StringTools.replace(getParamsString(), ";", "&"));
-		explore(getPostData());
-
-		if (res.length == 0) {
-			var post:haxe.ds.StringMap<Dynamic> = Lib.hashOfAssociativeArray(_POST);
-			var data = post.get(param);
-			if (is_array(data)) {
-				foreach(data, function(key:Int, value:String) {
-					res[key] = value;
-				});
-			}
-		}
-
-		if (res.length == 0)
-			return null;
-		return res;
-	}
-
-	/**
-		Returns the local server host name.
-	**/
-	public static inline function getHostName():String {
-		return _SERVER['SERVER_NAME'];
-	}
-
-	/**
-		Surprisingly returns the client IP address.
-	**/
-	public static inline function getClientIP():String {
-		return _SERVER['REMOTE_ADDR'];
-	}
-
-	/**
-		Returns the original request URL (before any server internal redirections).
-	**/
-	public static function getURI():String {
-		var s:String = _SERVER['REQUEST_URI'];
-		return s.split("?")[0];
-	}
-
-	/**
-		Tell the client to redirect to the given url ("Location" header).
-	**/
-	public static function redirect(url:String) {
-		header("Location: " + url);
-	}
-
-	/**
-		Set an output header value. If some data have been printed, the headers have
-		already been sent so this will raise an exception.
-	**/
-	public static inline function setHeader(h:String, v:String) {
-		header('$h: $v');
-	}
-
-	/**
-		Set the HTTP return code. Same remark as `php.Web.setHeader()`.
-		See status code explanation here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
-	**/
-	public static function setReturnCode(r:Int) {
-		var code:String;
-		switch (r) {
-			case 100:
-				code = "100 Continue";
-			case 101:
-				code = "101 Switching Protocols";
-			case 200:
-				code = "200 OK";
-			case 201:
-				code = "201 Created";
-			case 202:
-				code = "202 Accepted";
-			case 203:
-				code = "203 Non-Authoritative Information";
-			case 204:
-				code = "204 No Content";
-			case 205:
-				code = "205 Reset Content";
-			case 206:
-				code = "206 Partial Content";
-			case 300:
-				code = "300 Multiple Choices";
-			case 301:
-				code = "301 Moved Permanently";
-			case 302:
-				code = "302 Found";
-			case 303:
-				code = "303 See Other";
-			case 304:
-				code = "304 Not Modified";
-			case 305:
-				code = "305 Use Proxy";
-			case 307:
-				code = "307 Temporary Redirect";
-			case 400:
-				code = "400 Bad Request";
-			case 401:
-				code = "401 Unauthorized";
-			case 402:
-				code = "402 Payment Required";
-			case 403:
-				code = "403 Forbidden";
-			case 404:
-				code = "404 Not Found";
-			case 405:
-				code = "405 Method Not Allowed";
-			case 406:
-				code = "406 Not Acceptable";
-			case 407:
-				code = "407 Proxy Authentication Required";
-			case 408:
-				code = "408 Request Timeout";
-			case 409:
-				code = "409 Conflict";
-			case 410:
-				code = "410 Gone";
-			case 411:
-				code = "411 Length Required";
-			case 412:
-				code = "412 Precondition Failed";
-			case 413:
-				code = "413 Request Entity Too Large";
-			case 414:
-				code = "414 Request-URI Too Long";
-			case 415:
-				code = "415 Unsupported Media Type";
-			case 416:
-				code = "416 Requested Range Not Satisfiable";
-			case 417:
-				code = "417 Expectation Failed";
-			case 500:
-				code = "500 Internal Server Error";
-			case 501:
-				code = "501 Not Implemented";
-			case 502:
-				code = "502 Bad Gateway";
-			case 503:
-				code = "503 Service Unavailable";
-			case 504:
-				code = "504 Gateway Timeout";
-			case 505:
-				code = "505 HTTP Version Not Supported";
-			default:
-				code = Std.string(r);
-		}
-		header("HTTP/1.1 " + code, true, r);
-	}
-
-	/**
-		Retrieve a client header value sent with the request.
-	**/
-	public static function getClientHeader(k:String):String {
-		return loadClientHeaders().get(str_replace('-', '_', strtoupper(k)));
-	}
-
-	private static var _clientHeaders:Map<String, String>;
-
-	/**
-		Based on https://github.com/ralouphie/getallheaders
-	**/
-	static function loadClientHeaders():Map<String, String> {
-		if (_clientHeaders != null)
-			return _clientHeaders;
-
-		_clientHeaders = new Map();
-
-		if (function_exists('getallheaders')) {
-			foreach(getallheaders(), function(key:String, value:Dynamic) {
-				_clientHeaders.set(str_replace('-', '_', strtoupper(key)), Std.string(value));
-			});
-			return _clientHeaders;
-		}
-
-		var copyServer = Syntax.assocDecl({
-			CONTENT_TYPE: 'Content-Type',
-			CONTENT_LENGTH: 'Content-Length',
-			CONTENT_MD5: 'Content-Md5'
-		});
-		foreach(_SERVER, function(key:String, value:Dynamic) {
-			if ((substr(key, 0, 5) : String) == 'HTTP_') {
-				key = substr(key, 5);
-				if (!isset(copyServer[key]) || !isset(_SERVER[key])) {
-					_clientHeaders[key] = Std.string(value);
-				}
-			} else if (isset(copyServer[key])) {
-				_clientHeaders[key] = Std.string(value);
-			}
-		});
-		if (!_clientHeaders.exists('AUTHORIZATION')) {
-			if (isset(_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
-				_clientHeaders['AUTHORIZATION'] = Std.string(_SERVER['REDIRECT_HTTP_AUTHORIZATION']);
-			} else if (isset(_SERVER['PHP_AUTH_USER'])) {
-				var basic_pass = isset(_SERVER['PHP_AUTH_PW']) ? Std.string(_SERVER['PHP_AUTH_PW']) : '';
-				_clientHeaders['AUTHORIZATION'] = 'Basic ' + base64_encode(_SERVER['PHP_AUTH_USER'] + ':' + basic_pass);
-			} else if (isset(_SERVER['PHP_AUTH_DIGEST'])) {
-				_clientHeaders['AUTHORIZATION'] = Std.string(_SERVER['PHP_AUTH_DIGEST']);
-			}
-		}
-
-		return _clientHeaders;
-	}
-
-	/**
-		Retrieve all the client headers.
-	**/
-	public static function getClientHeaders():List<{value:String, header:String}> {
-		var headers = loadClientHeaders();
-		var result = new List();
-		for (key in headers.keys()) {
-			result.push({value: headers.get(key), header: key});
-		}
-		return result;
-	}
-
-	/**
-		Retrieve all the client headers as `haxe.ds.Map`.
-	**/
-	public static function getClientHeadersMap():Map<String, String> {
-		return loadClientHeaders().copy();
-	}
-
-	/**
-		Returns all the GET parameters `String`
-	**/
-	public static function getParamsString():String {
-		if (isset(_SERVER['QUERY_STRING']))
-			return _SERVER['QUERY_STRING'];
-		else
-			return "";
-	}
-
-	/**
-		Returns all the POST data. POST Data is always parsed as
-		being application/x-www-form-urlencoded and is stored into
-		the getParams hashtable. POST Data is maximimized to 256K
-		unless the content type is multipart/form-data. In that
-		case, you will have to use `php.Web.getMultipart()` or
-		`php.Web.parseMultipart()` methods.
-	**/
-	public static function getPostData():Null<String> {
-		var h = fopen("php://input", "r");
-		var bsize = 8192;
-		var max = 32;
-		var data:String = null;
-		var counter = 0;
-		while (!feof(h) && counter < max) {
-			data = Syntax.concat(data, fread(h, bsize));
-			counter++;
-		}
-		fclose(h);
-		return data;
-	}
-
-	/**
-		Returns an hashtable of all Cookies sent by the client.
-		Modifying the hashtable will not modify the cookie, use `php.Web.setCookie()`
-		instead.
-	**/
-	public static function getCookies():Map<String, String> {
-		return Lib.hashOfAssociativeArray(_COOKIE);
-	}
-
-	/**
-		Set a Cookie value in the HTTP headers. Same remark as `php.Web.setHeader()`.
-	**/
-	public static function setCookie(key:String, value:String, ?expire:Date, ?domain:String, ?path:String, ?secure:Bool, ?httpOnly:Bool) {
-		var t = expire == null ? 0 : Std.int(expire.getTime() / 1000.0);
-		if (path == null)
-			path = '/';
-		if (domain == null)
-			domain = '';
-		if (secure == null)
-			secure = false;
-		if (httpOnly == null)
-			httpOnly = false;
-		setcookie(key, value, t, path, domain, secure, httpOnly);
-	}
-
-	/**
-		Returns an object with the authorization sent by the client (Basic scheme only).
-	**/
-	public static function getAuthorization():{user:String, pass:String} {
-		if (!isset(_SERVER['PHP_AUTH_USER']))
-			return null;
-		return {user: _SERVER['PHP_AUTH_USER'], pass: _SERVER['PHP_AUTH_PW']};
-	}
-
-	/**
-		Get the current script directory in the local filesystem.
-	**/
-	public static inline function getCwd():String {
-		return dirname(_SERVER['SCRIPT_FILENAME']) + "/";
-	}
-
-	/**
-		Get the multipart parameters as an hashtable. The data
-		cannot exceed the maximum size specified.
-	**/
-	public static function getMultipart(maxSize:Int):Map<String, String> {
-		var h = new haxe.ds.StringMap();
-		var buf:StringBuf = null;
-		var curname = null;
-		parseMultipart(function(p, _) {
-			if (curname != null)
-				h.set(curname, buf.toString());
-			curname = p;
-			buf = new StringBuf();
-			maxSize -= Global.strlen(p);
-			if (maxSize < 0)
-				throw "Maximum size reached";
-		}, function(str, pos, len) {
-			maxSize -= len;
-			if (maxSize < 0)
-				throw "Maximum size reached";
-			buf.addSub(str.toString(), pos, len);
-		});
-		if (curname != null)
-			h.set(curname, buf.toString());
-		return h;
-	}
-
-	/**
-		Parse the multipart data. Call `onPart` when a new part is found
-		with the part name and the filename if present
-		and `onData` when some part data is readed. You can this way
-		directly save the data on hard drive in the case of a file upload.
-	**/
-	public static function parseMultipart(onPart:String->String->Void, onData:Bytes->Int->Int->Void):Void {
-		Syntax.foreach(_POST, function(key:String, value:Dynamic) {
-			onPart(key, "");
-			onData(Bytes.ofString(value), 0, strlen(value));
-		});
-
-		if (!isset(_FILES))
-			return;
-		Syntax.foreach(_FILES, function(part:String, data:NativeAssocArray<Dynamic>) {
-			function handleFile(tmp:String, file:String, err:Int) {
-				var fileUploaded = true;
-				if (err > 0) {
-					switch (err) {
-						case 1:
-							throw "The uploaded file exceeds the max size of " + ini_get('upload_max_filesize');
-						case 2:
-							throw "The uploaded file exceeds the max file size directive specified in the HTML form (max is" + ini_get('post_max_size') + ")";
-						case 3:
-							throw "The uploaded file was only partially uploaded";
-						case 4:
-							fileUploaded = false; // No file was uploaded
-						case 6:
-							throw "Missing a temporary folder";
-						case 7:
-							throw "Failed to write file to disk";
-						case 8:
-							throw "File upload stopped by extension";
-					}
-				}
-				if (fileUploaded) {
-					onPart(part, file);
-					if ("" != file) {
-						var h = fopen(tmp, "r");
-						var bsize = 8192;
-						while (!feof(h)) {
-							var buf:String = fread(h, bsize);
-							var size:Int = strlen(buf);
-							onData(Bytes.ofString(buf), 0, size);
-						}
-						fclose(h);
-					}
-				}
-			}
-			if (is_array(data['name'])) {
-				for (index in array_keys(data['name'])) {
-					handleFile(data['tmp_name'][index], data['name'][index], data['error'][index]);
-				};
-			} else {
-				handleFile(data['tmp_name'], data['name'], data['error']);
-			}
-		});
-	}
-
-	/**
-		Flush the data sent to the client. By default on Apache, outgoing data is buffered so
-		this can be useful for displaying some long operation progress.
-	**/
-	public static inline function flush():Void {
-		Global.flush();
-	}
-
-	/**
-		Get the HTTP method used by the client.
-	**/
-	public static function getMethod():String {
-		if (isset(_SERVER['REQUEST_METHOD']))
-			return _SERVER['REQUEST_METHOD'];
-		else
-			return null;
-	}
-
-	public static var isModNeko(default, null):Bool;
-
-	static function __init__() {
-		isModNeko = !Lib.isCli();
-	}
-}

+ 0 - 268
std/php/_std/sys/db/Mysql.hx

@@ -1,268 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-import php.*;
-import sys.db.*;
-import php.db.*;
-import php.db.Mysqli_result;
-
-@:coreApi class Mysql {
-	public static function connect(params:{
-		host:String,
-		?port:Int,
-		user:String,
-		pass:String,
-		?socket:String,
-		?database:String
-	}):Connection {
-		return new MysqlConnection(params);
-	}
-}
-
-private class MysqlConnection implements Connection {
-	var db:Mysqli;
-
-	public function new(params:{
-		host:String,
-		?port:Int,
-		user:String,
-		pass:String,
-		?socket:String,
-		?database:String
-	}):Void {
-		if (params.port == null)
-			params.port = Std.parseInt(Global.ini_get('mysqli.default_port'));
-		if (params.socket == null)
-			params.socket = Global.ini_get('mysqli.default_socket');
-		if (params.database == null)
-			params.database = "";
-
-		db = new Mysqli(params.host, params.user, params.pass, params.database, params.port, params.socket);
-	}
-
-	public function request(s:String):ResultSet {
-		var result = db.query(s);
-		if (result == false)
-			throw 'Failed to perform db query: ' + db.error;
-		if (result == true) {
-			return new WriteMysqlResultSet(db.affected_rows);
-		}
-
-		return new MysqlResultSet(result);
-	}
-
-	public function close():Void {
-		db.close();
-	}
-
-	public function escape(s:String):String {
-		return db.escape_string(s);
-	}
-
-	public function quote(s:String):String {
-		if (s.indexOf("\000") >= 0)
-			return "x'" + Global.bin2hex(s) + "'";
-		return "'" + db.escape_string(s) + "'";
-	}
-
-	public function addValue(s:StringBuf, v:Dynamic):Void {
-		if (Global.is_int(v) || Global.is_null(v)) {
-			s.add(v);
-		} else if (Global.is_bool(v)) {
-			s.add(v ? 1 : 0);
-		} else {
-			s.add(quote(Std.string(v)));
-		}
-	}
-
-	public function lastInsertId():Int {
-		return db.insert_id;
-	}
-
-	public function dbName():String {
-		return 'MySQL';
-	}
-
-	public function startTransaction():Void {
-		var success = db.begin_transaction();
-		if (!success)
-			throw 'Failed to start transaction: ' + db.error;
-	}
-
-	public function commit():Void {
-		var success = db.commit();
-		if (!success)
-			throw 'Failed to commit transaction: ' + db.error;
-	}
-
-	public function rollback():Void {
-		var success = db.rollback();
-		if (!success)
-			throw 'Failed to rollback transaction: ' + db.error;
-	}
-}
-
-private class MysqlResultSet implements ResultSet {
-	static var hxAnonClassName = Boot.getHxAnon().phpClassName;
-
-	public var length(get, null):Int;
-	public var nfields(get, null):Int;
-
-	var result:Mysqli_result;
-	var fetchedRow:NativeAssocArray<Scalar>;
-	var fieldsInfo:NativeAssocArray<MysqliFieldInfo>;
-
-	public function new(result:Mysqli_result) {
-		this.result = result;
-	}
-
-	public function hasNext():Bool {
-		if (fetchedRow == null)
-			fetchNext();
-		return fetchedRow != null;
-	}
-
-	public function next():Dynamic {
-		if (fetchedRow == null)
-			fetchNext();
-		return withdrawFetched();
-	}
-
-	public function results():List<Dynamic> {
-		var list = new List();
-
-		result.data_seek(0);
-		var row = result.fetch_object(hxAnonClassName);
-		while (row != null) {
-			row = correctObjectTypes(row);
-			list.add(row);
-			row = result.fetch_object(hxAnonClassName);
-		}
-
-		return list;
-	}
-
-	public function getResult(n:Int):String {
-		if (fetchedRow == null)
-			fetchNext();
-		return Global.array_values(fetchedRow)[n];
-	}
-
-	public function getIntResult(n:Int):Int {
-		return Syntax.int(getResult(n));
-	}
-
-	public function getFloatResult(n:Int):Float {
-		return Syntax.float(getResult(n));
-	}
-
-	public function getFieldsNames():Null<Array<String>> {
-		var fields = result.fetch_fields();
-		return [for (field in fields) field.name];
-	}
-
-	function fetchNext() {
-		var row = result.fetch_assoc();
-		if (row != null)
-			fetchedRow = correctArrayTypes(row);
-	}
-
-	function withdrawFetched():Dynamic {
-		if (fetchedRow == null)
-			return null;
-		var row = fetchedRow;
-		fetchedRow = null;
-		return Boot.createAnon(row);
-	}
-
-	function correctArrayTypes(row:NativeAssocArray<String>):NativeAssocArray<Scalar> {
-		var fieldsInfo = getFieldsInfo();
-		Syntax.foreach(row, function(field:String, value:String) {
-			row[field] = correctType(value, fieldsInfo[field].type);
-		});
-		return cast row;
-	}
-
-	function correctObjectTypes(row:{}):{} {
-		var fieldsInfo = getFieldsInfo();
-		Syntax.foreach(row, function(field:String, value:String) {
-			value = correctType(value, fieldsInfo[field].type);
-			Syntax.setField(row, field, value);
-		});
-		return row;
-	}
-
-	inline function getFieldsInfo():NativeAssocArray<MysqliFieldInfo> {
-		if (fieldsInfo == null) {
-			fieldsInfo = cast Syntax.arrayDecl();
-			Syntax.foreach(result.fetch_fields(), function(_, info) {
-				fieldsInfo[info.name] = info;
-			});
-		}
-		return fieldsInfo;
-	}
-
-	function correctType(value:String, type:Int):Scalar {
-		if (value == null)
-			return null;
-		if (type == Const.MYSQLI_TYPE_BIT || type == Const.MYSQLI_TYPE_TINY || type == Const.MYSQLI_TYPE_SHORT || type == Const.MYSQLI_TYPE_LONG
-			|| type == Const.MYSQLI_TYPE_INT24 || type == Const.MYSQLI_TYPE_CHAR) {
-			return Syntax.int(value);
-		}
-		if (type == Const.MYSQLI_TYPE_DECIMAL
-			|| type == Const.MYSQLI_TYPE_NEWDECIMAL
-			|| type == Const.MYSQLI_TYPE_FLOAT
-			|| type == Const.MYSQLI_TYPE_DOUBLE) {
-			return Syntax.float(value);
-		}
-		return value;
-	}
-
-	function get_length()
-		return result.num_rows;
-
-	function get_nfields()
-		return result.field_count;
-}
-
-private class WriteMysqlResultSet extends MysqlResultSet {
-	var affectedRows:Int = 0;
-
-	public function new(affectedRows:Int) {
-		super(null);
-		this.affectedRows = affectedRows;
-	}
-
-	override public function hasNext():Bool {
-		return false;
-	}
-
-	override function fetchNext() {}
-
-	override function get_length()
-		return affectedRows;
-
-	override function get_nfields()
-		return 0;
-}

+ 0 - 218
std/php/_std/sys/db/Sqlite.hx

@@ -1,218 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-import php.*;
-import php.Global.*;
-import php.db.*;
-import sys.db.*;
-
-@:coreApi class Sqlite {
-	public static function open(file:String):Connection {
-		return new SQLiteConnection(file);
-	}
-}
-
-private class SQLiteConnection implements Connection {
-	var db:SQLite3;
-
-	public function new(file:String) {
-		db = new SQLite3(file);
-		db.enableExceptions(true);
-	}
-
-	public function request(s:String):ResultSet {
-		var result = db.query(s);
-		return new SQLiteResultSet(result);
-	}
-
-	public function close():Void {
-		db.close();
-	}
-
-	public function escape(s:String):String {
-		return SQLite3.escapeString(s);
-	}
-
-	public function quote(s:String):String {
-		if (s.indexOf("\000") >= 0)
-			return "x'" + Global.bin2hex(s) + "'";
-		return "'" + SQLite3.escapeString(s) + "'";
-	}
-
-	public function addValue(s:StringBuf, v:Dynamic):Void {
-		if (Global.is_int(v) || Global.is_null(v)) {
-			s.add(v);
-		} else if (Global.is_bool(v)) {
-			s.add(v ? 1 : 0);
-		} else {
-			s.add(quote(Std.string(v)));
-		}
-	}
-
-	public function lastInsertId():Int {
-		return Syntax.int(db.lastInsertRowID());
-	}
-
-	public function dbName():String {
-		return 'SQLite';
-	}
-
-	public function startTransaction():Void {
-		db.query('BEGIN TRANSACTION');
-	}
-
-	public function commit():Void {
-		db.query('COMMIT');
-	}
-
-	public function rollback():Void {
-		db.query('ROLLBACK');
-	}
-}
-
-private class SQLiteResultSet implements ResultSet {
-	public var length(get, null):Int;
-	public var nfields(get, null):Int;
-
-	var cache = new NativeIndexedArray<{}>();
-	var result:SQLite3Result;
-	var resultIsDepleted = false;
-	var fieldsInfo:NativeAssocArray<Int>;
-
-	public function new(result:SQLite3Result) {
-		this.result = result;
-	}
-
-	public function hasNext():Bool {
-		return switch next() {
-			case null: false;
-			case row:
-				array_unshift(cache, row);
-				row;
-		}
-	}
-
-	public function next():Dynamic {
-		return switch array_shift(cache) {
-			case null: fetchNext();
-			case row: row;
-		}
-	}
-
-	function fetchNext():Null<{}> {
-		return resultIsDepleted ? null : switch result.fetchArray(Const.SQLITE3_ASSOC) {
-			case false:
-				resultIsDepleted = true;
-				result.finalize();
-				null;
-			case row:
-				Boot.createAnon(correctArrayTypes(row));
-		}
-	}
-
-	public function cacheAll():NativeIndexedArray<{}> {
-		var row = fetchNext();
-		while(row != null) {
-			cache.push(row);
-			row = fetchNext();
-		}
-		return cache;
-	}
-
-	public function results():List<Dynamic> {
-		var list = new List();
-		for(row in cacheAll()) {
-			list.add(row);
-		}
-		return list;
-	}
-
-	function getColumn(n:Int):Any {
-		return array_values(Syntax.array(current()))[n];
-	}
-
-	public function getResult(n:Int):String {
-		return Syntax.string(getColumn(n));
-	}
-
-	public function getIntResult(n:Int):Int {
-		return Syntax.int(getColumn(n));
-	}
-
-	public function getFloatResult(n:Int):Float {
-		return Syntax.float(getColumn(n));
-	}
-
-	public function getFieldsNames():Null<Array<String>> {
-		var fieldsInfo = getFieldsInfo();
-		return Global.array_keys(fieldsInfo);
-	}
-
-	function current():Null<{}> {
-		return switch reset(cache) {
-			case false:
-				switch next() {
-					case null: null;
-					case row:
-						cache.push(row);
-						row;
-				}
-			case row: row;
-		}
-	}
-
-	function correctArrayTypes(row:NativeAssocArray<String>):NativeAssocArray<Scalar> {
-		var fieldsInfo = getFieldsInfo();
-		Syntax.foreach(row, function(field:String, value:String) {
-			row[field] = correctType(value, fieldsInfo[field]);
-		});
-		return cast row;
-	}
-
-	inline function getFieldsInfo():NativeAssocArray<Int> {
-		if (fieldsInfo == null) {
-			fieldsInfo = cast Syntax.arrayDecl();
-			for (i in 0...nfields) {
-				fieldsInfo[result.columnName(i)] = result.columnType(i);
-			}
-		}
-		return fieldsInfo;
-	}
-
-	function correctType(value:String, type:Int):Scalar {
-		if (value == null)
-			return null;
-		if (type == Const.SQLITE3_INTEGER)
-			return Syntax.int(value);
-		if (type == Const.SQLITE3_FLOAT)
-			return Syntax.float(value);
-		return value;
-	}
-
-	function get_length():Int
-		return count(cacheAll());
-
-	function get_nfields():Int
-		return result.numColumns();
-}

+ 0 - 100
std/php/db/Mysqli.hx

@@ -1,100 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package php.db;
-
-import haxe.extern.*;
-import php.*;
-import haxe.Constraints.Function;
-
-/**
-	@see http://php.net/manual/en/class.mysqli.php
-**/
-@:native('Mysqli')
-extern class Mysqli {
-	var affected_rows(default, null):Int;
-	var client_info(default, null):String;
-	var client_version(default, null):Int;
-	var connect_errno(default, null):Int;
-	var connect_error(default, null):String;
-	var errno(default, null):Int;
-	var error_list(default, null):NativeAssocArray<Scalar>;
-	var error(default, null):String;
-	var field_count(default, null):Int;
-	var host_info(default, null):String;
-	var protocol_version(default, null):String;
-	var server_info(default, null):String;
-	var server_version(default, null):Int;
-	var info(default, null):String;
-	var insert_id(default, null):EitherType<Int, String>;
-	var sqlstate(default, null):String;
-	var thread_id(default, null):Int;
-	var warning_count(default, null):Int;
-
-	static function poll(read:Ref<NativeArray>, error:Ref<NativeArray>, reject:Ref<NativeArray>, sec:Int, ?usec:Int):Int;
-
-	function new(?host:String, ?username:String, ?passwd:String, dbname:String = "", ?port:Int, ?socket:String):Void;
-	function autocommit(mode:Bool):Bool;
-	function begin_transaction(?flags:Int, ?name:String):Bool;
-	function change_user(user:String, password:String, database:String):Bool;
-	function character_set_name():String;
-	function close():Bool;
-	function commit(?flags:Int, ?name:String):Bool;
-	function debug(message:String):Bool;
-	function dump_debug_info():Bool;
-	function get_charset():{
-		charset:String,
-		collation:String,
-		dir:String,
-		min_length:Int,
-		number:Int,
-		state:Int
-	};
-	function get_client_info():String;
-	function get_connection_stats():Bool;
-	function get_warnings():Mysqli_warning;
-	function init():Mysqli;
-	function kill(processid:Int):Bool;
-	function more_results():Bool;
-	function multi_query(query:String):Bool;
-	function next_result():Bool;
-	function options(option:Int, value:Scalar):Bool;
-	function ping():Bool;
-	function prepare(query:String):Mysqli_stmt;
-	function query(query:String, ?resultmode:Int):EitherType<Bool, Mysqli_result>;
-	function real_connect(?host:String, ?username:String, ?passwd:String, ?dbname:String, ?port:Int, ?socket:String, ?flags:Int):Bool;
-	function escape_string(escapestr:String):String;
-	function real_query(query:String):Bool;
-	function reap_async_query():Mysqli_result;
-	function refresh(options:Int):Bool;
-	function rollback(?flags:Int, ?name:String):Bool;
-	function rpl_query_type(query:String):Int;
-	function select_db(dbname:String):Bool;
-	function send_query(query:String):Bool;
-	function set_charset(charset:String):Bool;
-	function set_local_infile_handler(read_func:Function):Bool;
-	function ssl_set(key:String, cert:String, ca:String, capath:String, cipher:String):Bool;
-	function stat():String;
-	function stmt_init():Mysqli_stmt;
-	function store_result(?option:Int):Mysqli_result;
-	function use_result():Mysqli_result;
-}

+ 0 - 38
std/php/db/Mysqli_driver.hx

@@ -1,38 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package php.db;
-
-import php.NativeArray;
-
-@:native('Mysqli_driver')
-extern class Mysqli_driver {
-	var client_info(default, null):String;
-	var client_version(default, null):String;
-	var driver_version(default, null):String;
-	var embedded(default, null):String;
-	var reconnect(default, null):Bool;
-	var report_mode(default, null):Int;
-
-	function embedded_server_end():Void;
-	function embedded_server_start(start:Bool, arguments:NativeArray, groups:NativeArray):Bool;
-}

+ 0 - 62
std/php/db/Mysqli_result.hx

@@ -1,62 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package php.db;
-
-import php.*;
-import haxe.extern.*;
-
-/**
-	@see http://php.net/manual/en/class.mysqli-result.php
-**/
-@:native('Myslqi_result')
-extern class Mysqli_result implements Traversable {
-	var current_field(default, null):Int;
-	var field_count(default, null):Int;
-	var lengths(default, null):EitherType<Bool, NativeIndexedArray<Int>>;
-	var num_rows(default, null):Int;
-
-	function data_seek(offset:Int):Bool;
-	function fetch_all(?resulttype:Int):NativeArray;
-	function fetch_array(?resulttype:Int):NativeArray;
-	function fetch_assoc():NativeAssocArray<String>;
-	function fetch_field_direct(fieldnr:Int):MysqliFieldInfo;
-	function fetch_field():MysqliFieldInfo;
-	function fetch_fields():NativeIndexedArray<MysqliFieldInfo>;
-	function fetch_object(?class_name:String = "stdClass", ?params:NativeArray):{};
-	function fetch_row():NativeIndexedArray<String>;
-	function field_seek(fieldnr:Int):Bool;
-	function free():Void;
-}
-
-typedef MysqliFieldInfo = {
-	name:String,
-	orgname:String,
-	table:String,
-	orgtable:String,
-	max_length:Int,
-	length:Int,
-	charsetnr:Int,
-	flags:Int,
-	type:Int,
-	decimals:Int
-}

+ 0 - 57
std/php/db/Mysqli_stmt.hx

@@ -1,57 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package php.db;
-
-import haxe.extern.*;
-import php.*;
-
-@:native('Mysqli_stmt')
-extern class Mysqli_stmt {
-	var affected_rows(default, null):Int;
-	var errno(default, null):Int;
-	var error_list(default, null):NativeArray;
-	var error(default, null):String;
-	var field_count(default, null):Int;
-	var insert_id(default, null):Int;
-	var num_rows(default, null):Int;
-	var param_count(default, null):Int;
-	var sqlstate(default, null):String;
-
-	function new(link:Mysqli, ?query:String):Void;
-	function attr_get(attr:Int):Int;
-	function attr_set(attr:Int, mode:Int):Bool;
-	function bind_param(types:String, var1:Ref<Dynamic>, args:Rest<Ref<Dynamic>>):Bool;
-	function bind_result(var1:Ref<Dynamic>, args:Rest<Ref<Dynamic>>):Bool;
-	function close():Bool;
-	function data_seek(offset:Int):Void;
-	function execute():Bool;
-	function fetch():Bool;
-	function free_result():Void;
-	function get_result():Mysqli_result;
-	function get_warnings(stmt:Mysqli_stmt):{};
-	function prepare(query:String):Bool;
-	function reset():Bool;
-	function result_metadata():Mysqli_result;
-	function send_long_data(param_nr:Int, data:String):Bool;
-	function store_result():Bool;
-}

+ 0 - 32
std/php/db/Mysqli_warning.hx

@@ -1,32 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package php.db;
-
-@:native('Mysqli_warning')
-extern class Mysqli_warning {
-	var message(default, null):String;
-	var sqlstate(default, null):Dynamic;
-	var errno(default, null):Int;
-
-	function next():Void;
-}

+ 0 - 109
std/php/db/PDO.hx

@@ -1,109 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package php.db;
-
-import php.*;
-
-@:native('PDO')
-extern class PDO {
-	@:phpClassConst static final PARAM_BOOL:Int;
-	@:phpClassConst static final PARAM_NULL:Int;
-	@:phpClassConst static final PARAM_INT:Int;
-	@:phpClassConst static final PARAM_STR:Int;
-	@:phpClassConst static final PARAM_LOB:Int;
-	@:phpClassConst static final PARAM_STMT:Int;
-	@:phpClassConst static final PARAM_INPUT_OUTPUT:Int;
-	@:phpClassConst static final FETCH_LAZY:Int;
-	@:phpClassConst static final FETCH_ASSOC:Int;
-	@:phpClassConst static final FETCH_NAMED:Int;
-	@:phpClassConst static final FETCH_NUM:Int;
-	@:phpClassConst static final FETCH_BOTH:Int;
-	@:phpClassConst static final FETCH_OBJ:Int;
-	@:phpClassConst static final FETCH_BOUND:Int;
-	@:phpClassConst static final FETCH_COLUMN:Int;
-	@:phpClassConst static final FETCH_CLASS:Int;
-	@:phpClassConst static final FETCH_INTO:Int;
-	@:phpClassConst static final FETCH_FUNC:Int;
-	@:phpClassConst static final FETCH_GROUP:Int;
-	@:phpClassConst static final FETCH_UNIQUE:Int;
-	@:phpClassConst static final FETCH_KEY_PAIR:Int;
-	@:phpClassConst static final FETCH_CLASSTYPE:Int;
-	@:phpClassConst static final FETCH_SERIALIZE:Int;
-	@:phpClassConst static final FETCH_PROPS_LATE:Int;
-	@:phpClassConst static final ATTR_AUTOCOMMIT:Int;
-	@:phpClassConst static final ATTR_PREFETCH:Int;
-	@:phpClassConst static final ATTR_TIMEOUT:Int;
-	@:phpClassConst static final ATTR_ERRMODE:Int;
-	@:phpClassConst static final ATTR_SERVER_VERSION:Int;
-	@:phpClassConst static final ATTR_CLIENT_VERSION:Int;
-	@:phpClassConst static final ATTR_SERVER_INFO:Int;
-	@:phpClassConst static final ATTR_CONNECTION_STATUS:Int;
-	@:phpClassConst static final ATTR_CASE:Int;
-	@:phpClassConst static final ATTR_CURSOR_NAME:Int;
-	@:phpClassConst static final ATTR_CURSOR:Int;
-	@:phpClassConst static final ATTR_DRIVER_NAME:Int;
-	@:phpClassConst static final ATTR_ORACLE_NULLS:Int;
-	@:phpClassConst static final ATTR_PERSISTENT:Int;
-	@:phpClassConst static final ATTR_STATEMENT_CLASS:Int;
-	@:phpClassConst static final ATTR_DEFAULT_FETCH_MODE:Int;
-	@:phpClassConst static final ATTR_FETCH_TABLE_NAMES:Int;
-	@:phpClassConst static final ATTR_STRINGIFY_FETCHES:Int;
-	@:phpClassConst static final ATTR_EMULATE_PREPARES:Int;
-	@:phpClassConst static final ERRMODE_SILENT:Int;
-	@:phpClassConst static final ERRMODE_WARNING:Int;
-	@:phpClassConst static final ERRMODE_EXCEPTION:Int;
-	@:phpClassConst static final CASE_NATURAL:Int;
-	@:phpClassConst static final CASE_LOWER:Int;
-	@:phpClassConst static final CASE_UPPER:Int;
-	@:phpClassConst static final NULL_NATURAL:Int;
-	@:phpClassConst static final FETCH_ORI_PRIOR:Int;
-	@:phpClassConst static final FETCH_ORI_FIRST:Int;
-	@:phpClassConst static final FETCH_ORI_LAST:Int;
-	@:phpClassConst static final FETCH_ORI_ABS:Int;
-	@:phpClassConst static final FETCH_ORI_REL:Int;
-	@:phpClassConst static final CURSOR_FWDONLY:Int;
-	@:phpClassConst static final CURSOR_SCROLL:Int;
-	@:phpClassConst static final ERR_NONE:String;
-	@:phpClassConst static final PARAM_EVT_ALLOC:Int;
-	@:phpClassConst static final PARAM_EVT_FREE:Int;
-	@:phpClassConst static final PARAM_EVT_EXEC_PRE:Int;
-	@:phpClassConst static final PARAM_EVT_EXEC_POST:Int;
-	@:phpClassConst static final PARAM_EVT_FETCH_PRE:Int;
-	@:phpClassConst static final PARAM_EVT_FETCH_POST:Int;
-	@:phpClassConst static final PARAM_EVT_NORMALIZE:Int;
-
-	function new(dns:String, ?username:String, ?password:String, ?options:NativeArray):Void;
-	function beginTransaction():Bool;
-	function commit():Bool;
-	function errorCode():Dynamic;
-	function errorInfo():NativeArray;
-	function exec(statement:String):Int;
-	function getAttribute(attribute:Int):Dynamic;
-	static function getAvailableDrivers():NativeIndexedArray<String>;
-	function lastInsertId(?name:String):String;
-	function prepare(statement:String, ?driver_options:NativeArray):PDOStatement;
-	function query(statement:String, ?mode:Int):PDOStatement;
-	function quote(String:String, ?parameter_type:Int = 2):String;
-	function rollBack():Bool;
-	function setAttribute(attribute:Int, value:Dynamic):Bool;
-}

+ 0 - 30
std/php/db/PDOException.hx

@@ -1,30 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package php.db;
-
-import php.RuntimeException;
-
-@:native('PDOException')
-extern class PDOException extends RuntimeException {
-	var errorInfo:NativeArray;
-}

+ 0 - 48
std/php/db/PDOStatement.hx

@@ -1,48 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package php.db;
-
-import php.*;
-
-@:native('PDOStatement')
-extern class PDOStatement {
-	function bindColumn(column:Dynamic, param:Dynamic, ?type:Int, ?maxlen:Int, ?driverdata:Dynamic):Bool;
-	function bindParam(parameter:Dynamic, variable:Dynamic, ?data_type:Int, ?length:Int, ?driver_options:Dynamic):Bool;
-	function bindValue(parameter:Dynamic, value:Dynamic, ?data_type:Int):Bool;
-	function closeCursor():Bool;
-	function columnCount():Int;
-	function debugDumpParams():Bool;
-	function errorCode():String;
-	function errorInfo():NativeArray;
-	function execute(?input_parameters:NativeArray):Bool;
-	function fetch(?fetch_style:Int = 4, ?cursor_orientation:Int = 0, ?cursor_offset:Int = 0):Dynamic;
-	function fetchAll(?fetch_style:Int, ?fetch_argument:Dynamic, ?ctor_args:NativeArray):NativeArray;
-	function fetchColumn(?column_number:Int = 0):String;
-	function fetchObject(?class_name:String, ?ctor_args:NativeArray):Dynamic;
-	function getAttribute(attribute:Int):Dynamic;
-	function getColumnMeta(column:Int):NativeArray;
-	function nextRowset():Bool;
-	function rowCount():Int;
-	function setAttribute(attribute:Int, value:Dynamic):Bool;
-	function setFetchMode(mode:Int, ?fetch:Dynamic, ?ctorargs:NativeArray):Bool;
-}

+ 0 - 50
std/php/db/SQLite3.hx

@@ -1,50 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package php.db;
-
-import haxe.Constraints;
-import php.*;
-import haxe.extern.EitherType;
-
-@:native('SQLite3')
-extern class SQLite3 {
-	static function version():NativeArray;
-	static function escapeString(value:String):String;
-	function busyTimeout(msecs:Int):Bool;
-	function changes():Int;
-	function close():Bool;
-	function new(filename:String, ?flags:Int, encryption_key:String = null):Void;
-	function createAggregate(name:String, step_callback:Function, final_callback:Function, argument_count:Int = -1):Bool;
-	function createCollation(name:String, callback:Function):Bool;
-	function createFunction(name:String, callback:Function, argument_count:Int = -1):Bool;
-	function enableExceptions(enableExceptions:Bool = false):Bool;
-	function exec(query:String):Bool;
-	function lastErrorCode():Int;
-	function lastErrorMsg():String;
-	function lastInsertRowID():Int;
-	function loadExtension(shared_library:String):Bool;
-	function open(filename:String, ?flags:Int, encryption_key:String = null):Void;
-	function prepare(query:String):SQLite3Stmt;
-	function query(query:String):EitherType<Bool, SQLite3Result>;
-	function querySingle(query:String, entire_row:Bool = false):Dynamic;
-}

+ 0 - 36
std/php/db/SQLite3Result.hx

@@ -1,36 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package php.db;
-
-import php.*;
-import haxe.extern.EitherType;
-
-@:native('SQLite3Result')
-extern class SQLite3Result {
-	function columnName(column_number:Int):String;
-	function columnType(column_number:Int):Int;
-	function fetchArray(?mode:Int):EitherType<Bool, NativeAssocArray<String>>;
-	function finalize():Bool;
-	function numColumns():Int;
-	function reset():Bool;
-}

+ 0 - 38
std/php/db/SQLite3Stmt.hx

@@ -1,38 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package php.db;
-
-import php.*;
-import haxe.extern.EitherType;
-
-@:native('SQLite3Stmt')
-extern class SQLite3Stmt {
-	function bindParam(sql_param:EitherType<String, Int>, param:Ref<Dynamic>, ?type:Int):Bool;
-	function bindValue(sql_param:EitherType<String, Int>, value:Dynamic, ?type:Int):Bool;
-	function clear():Bool;
-	function close():Bool;
-	function execute():SQLite3Result;
-	function paramCount():Int;
-	function readOnly():Bool;
-	function reset():Bool;
-}

+ 0 - 36
std/sys/db/Connection.hx

@@ -1,36 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-interface Connection {
-	function request(s:String):ResultSet;
-	function close():Void;
-	function escape(s:String):String;
-	function quote(s:String):String;
-	function addValue(s:StringBuf, v:Dynamic):Void;
-	function lastInsertId():Int;
-	function dbName():String;
-	function startTransaction():Void;
-	function commit():Void;
-	function rollback():Void;
-}

+ 0 - 37
std/sys/db/Mysql.hx

@@ -1,37 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-class Mysql {
-	public static function connect(params:{
-		host:String,
-		?port:Int,
-		user:String,
-		pass:String,
-		?socket:String,
-		?database:String
-	}):sys.db.Connection {
-		throw new haxe.exceptions.NotImplementedException("Not implemented for this platform");
-		return null;
-	}
-}

+ 0 - 70
std/sys/db/ResultSet.hx

@@ -1,70 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-interface ResultSet {
-	/**
-		Get amount of rows left in this set.
-		Depending on a database management system accessing this field may cause
-		all rows to be fetched internally. However, it does not affect `next` calls.
-	**/
-	var length(get, null):Int;
-	/**
-		Amount of columns in a row.
-		Depending on a database management system may return `0` if the query
-		did not match any rows.
-	**/
-	var nfields(get, null):Int;
-
-	/**
-		Tells whether there is a row to be fetched.
-	**/
-	function hasNext():Bool;
-	/**
-		Fetch next row.
-	**/
-	function next():Dynamic;
-	/**
-		Fetch all the rows not fetched yet.
-	**/
-	function results():List<Dynamic>;
-	/**
-		Get the value of `n`-th column of the current row.
-		Throws an exception if the re
-	**/
-	function getResult(n:Int):String;
-	/**
-		Get the value of `n`-th column of the current row as an integer value.
-	**/
-	function getIntResult(n:Int):Int;
-	/**
-		Get the value of `n`-th column of the current row as a float value.
-	**/
-	function getFloatResult(n:Int):Float;
-	/**
-		Get the list of column names.
-		Depending on a database management system may return `null` if there's no
-		more rows to fetch.
-	**/
-	function getFieldsNames():Null<Array<String>>;
-}

+ 0 - 41
std/sys/db/Sqlite.hx

@@ -1,41 +0,0 @@
-/*
- * Copyright (C)2005-2019 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package sys.db;
-
-class Sqlite {
-	/**
-		Opens a new SQLite connection on the specified path.
-
-		(cs) You will need a SQLite ADO.NET Provider
-		(see http://www.mono-project.com/docs/database-access/providers/sqlite/).
-		Also note that this will try to open an assembly named `Mono.Data.Sqlite`
-		if it wasn't loaded yet.
-
-		(java) You will need a SQLite JDBC driver (e.g.
-		https://github.com/xerial/sqlite-jdbc/releases).
-	**/
-	public static function open(file:String):Connection {
-		throw "Not implemented for this platform";
-		return null;
-	}
-}

+ 1 - 13
tests/RunCi.hx

@@ -21,12 +21,6 @@ class RunCi {
 
 
 		infoMsg('Going to test: $tests');
 		infoMsg('Going to test: $tests');
 
 
-		if (isCi()) {
-			changeDirectory('echoServer');
-			runCommand('haxe', ['build.hxml']);
-			changeDirectory(cwd);
-		}
-
 		final downloadPath = getDownloadPath();
 		final downloadPath = getDownloadPath();
 		if (!sys.FileSystem.exists(downloadPath))
 		if (!sys.FileSystem.exists(downloadPath))
 			sys.FileSystem.createDirectory(downloadPath);
 			sys.FileSystem.createDirectory(downloadPath);
@@ -40,13 +34,10 @@ class RunCi {
 					//pass
 					//pass
 			}
 			}
 
 
-			//run neko-based http echo server
-			var echoServer = new sys.io.Process('nekotools', ['server', '-d', 'echoServer/www/', '-p', '20200']);
-
 			infoMsg('test $test');
 			infoMsg('test $test');
 			try {
 			try {
 				changeDirectory(unitDir);
 				changeDirectory(unitDir);
-				haxelibInstallGit("haxe-utest", "utest", "master", "--always");
+				haxelibInstallGit("haxe-utest", "utest", "--always");
 
 
 				var args = switch (ci) {
 				var args = switch (ci) {
 					case null:
 					case null:
@@ -91,9 +82,6 @@ class RunCi {
 			}
 			}
 
 
 			successMsg('test ${test} succeeded');
 			successMsg('test ${test} succeeded');
-
-			echoServer.kill();
-			echoServer.close();
 		}
 		}
 
 
 		deploy();
 		deploy();

+ 0 - 1
tests/echoServer/.gitignore

@@ -1 +0,0 @@
-www/echoServer.n

+ 0 - 6
tests/echoServer/EchoServer.hx

@@ -1,6 +0,0 @@
-class EchoServer {
-	static function main() {
-		Sys.print(neko.Web.getPostData());
-		Sys.sleep(0.3);
-	}
-}

+ 0 - 2
tests/echoServer/build.hxml

@@ -1,2 +0,0 @@
--main EchoServer
--neko www/echoServer.n

+ 0 - 7
tests/echoServer/www/crossdomain.xml

@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE cross-domain-policy SYSTEM "https://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
-<cross-domain-policy>
-	<site-control permitted-cross-domain-policies="master-only"/>
-	<allow-access-from domain="*" to-ports="*"/>
-	<allow-http-request-headers-from domain="*" headers="*"/>
-</cross-domain-policy>

+ 2 - 2
tests/server/src/cases/display/issues/Issue8381.hx

@@ -22,6 +22,6 @@ class Issue8381 extends DisplayTestCase {
 			offset: offset(1)
 			offset: offset(1)
 		});
 		});
 		var result = parseHover();
 		var result = parseHover();
-		Assert.equals(DisplayItemKind.ClassField, result.result.item.kind);
+		Assert.equals(result.result.item.kind, DisplayItemKind.ClassField);
 	}
 	}
-}
+}

+ 2 - 2
tests/server/src/cases/display/issues/Issue8602.hx

@@ -11,6 +11,6 @@ class Issue8602 extends DisplayTestCase {
 	function test(_) {
 	function test(_) {
 		runHaxeJson([], DisplayMethods.Completion, {file: file, offset: offset(1), wasAutoTriggered: true});
 		runHaxeJson([], DisplayMethods.Completion, {file: file, offset: offset(1), wasAutoTriggered: true});
 		var result = parseCompletion();
 		var result = parseCompletion();
-		Assert.equals(Toplevel, result.result.mode.kind);
+		Assert.equals(result.result.mode.kind, Toplevel);
 	}
 	}
-}
+}

+ 2 - 2
tests/server/src/cases/display/issues/Issue8991.hx

@@ -21,6 +21,6 @@ class Issue8991 extends DisplayTestCase {
 		runHaxeJson([], DisplayMethods.Hover, {file: file, offset: mainHx.markers[1]});
 		runHaxeJson([], DisplayMethods.Hover, {file: file, offset: mainHx.markers[1]});
 
 
 		var result = parseHover().result;
 		var result = parseHover().result;
-		Assert.equals(DisplayItemKind.ClassField, result.item.kind);
+		Assert.equals(result.item.kind, DisplayItemKind.ClassField);
 	}
 	}
-}
+}

+ 2 - 2
tests/server/src/cases/display/issues/Issue9012.hx

@@ -12,6 +12,6 @@ class Issue9012 extends DisplayTestCase {
 		runHaxeJson([], DisplayMethods.Hover, {file: file, offset: transform.markers[1]});
 		runHaxeJson([], DisplayMethods.Hover, {file: file, offset: transform.markers[1]});
 		var result = parseHover().result;
 		var result = parseHover().result;
 
 
-		Assert.equals(DisplayItemKind.ClassField, result.item.kind);
+		Assert.equals(result.item.kind, DisplayItemKind.ClassField);
 	}
 	}
-}
+}

+ 1 - 1
tests/server/src/cases/display/issues/Issue9705.hx

@@ -9,7 +9,7 @@ class Issue9705 extends TestCase {
 		runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Main.hx")}, res -> {
 		runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Main.hx")}, res -> {
 			Assert.equals(1, res.length);
 			Assert.equals(1, res.length);
 			Assert.equals(1, res[0].diagnostics.length);
 			Assert.equals(1, res[0].diagnostics.length);
-			Assert.equals(DKUnresolvedIdentifier, res[0].diagnostics[0].kind);
+			Assert.equals(res[0].diagnostics[0].kind, DKUnresolvedIdentifier);
 
 
 			var range = res[0].diagnostics[0].range;
 			var range = res[0].diagnostics[0].range;
 			Assert.equals("Arrey".length, range.end.character - range.start.character);
 			Assert.equals("Arrey".length, range.end.character - range.start.character);

+ 2 - 2
tests/server/src/utils/Vfs.hx

@@ -41,10 +41,10 @@ class Vfs {
 		Fs.writeFileSync(path.toString(), content);
 		Fs.writeFileSync(path.toString(), content);
 	}
 	}
 
 
-	public function getContent(path:String) {
+	public function getContent(path:String):String {
 		var path = getPhysicalPath(path);
 		var path = getPhysicalPath(path);
 		FileSystem.createDirectory(path.dir);
 		FileSystem.createDirectory(path.dir);
-		return Fs.readFileSync(path.toString());
+		return Fs.readFileSync(path.toString()).toString();
 	}
 	}
 
 
 	public function close() {
 	public function close() {

+ 0 - 4
tests/sys/src/Main.hx

@@ -13,10 +13,6 @@ class Main {
 		#if !js
 		#if !js
 		runner.addCase(new io.TestProcess());
 		runner.addCase(new io.TestProcess());
 		#end
 		#end
-		#if !(java || cs || lua || python || eval || js) // Sqlite is not implemented for these targets
-		runner.addCase(new db.TestSqliteConnection());
-		runner.addCase(new db.TestSqliteResultSet());
-		#end
 		runner.addCase(new net.TestSocket());
 		runner.addCase(new net.TestSocket());
 		var report = Report.create(runner);
 		var report = Report.create(runner);
 		report.displayHeader = AlwaysShowHeader;
 		report.displayHeader = AlwaysShowHeader;

+ 0 - 27
tests/sys/src/db/SqliteSetup.hx

@@ -1,27 +0,0 @@
-package db;
-
-import sys.db.Sqlite;
-import sys.db.Connection;
-import sys.FileSystem;
-
-class SqliteSetup extends utest.Test {
-	var cnx:Connection;
-
-	function setup() {
-		openConnection();
-		cnx.request("CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT, num REAL, value TEXT)");
-	}
-
-	function teardown() {
-		cnx.request("DROP TABLE test");
-		closeConnection();
-	}
-
-	function closeConnection() {
-		cnx.close();
-	}
-
-	function openConnection() {
-		cnx = Sqlite.open(':memory:');
-	}
-}

+ 0 - 60
tests/sys/src/db/TestSqliteConnection.hx

@@ -1,60 +0,0 @@
-package db;
-
-import utest.Assert.*;
-import sys.FileSystem;
-
-class TestSqliteConnection extends SqliteSetup {
-	function testDbName() {
-		equals('SQLite', cnx.dbName());
-	}
-
-	function testLastInsertId() {
-		cnx.request('INSERT INTO test (num, value) VALUES (10, "one")');
-		equals(1, cnx.lastInsertId());
-
-		cnx.request('INSERT INTO test (num, value) VALUES (20, "two")');
-		equals(2, cnx.lastInsertId());
-	}
-
-	function testTransactionRollback() {
-		cnx.startTransaction();
-		cnx.request('INSERT INTO test (id, num, value) VALUES (1, 2, "one")');
-		cnx.rollback();
-		var result = cnx.request('SELECT * FROM test WHERE id = 1');
-		isFalse(result.hasNext());
-	}
-
-	function testTransactionCommit() {
-		cnx.startTransaction();
-		cnx.request('INSERT INTO test (id, num, value) VALUES (1, 2, "one")');
-		cnx.commit();
-		var result = cnx.request('SELECT * FROM test WHERE id = 1');
-		same({id:1, num:2, value:'one'}, result.next());
-	}
-
-	function testIssue9700() {
-		var dbFile = 'temp/db.sqlite';
-		try sys.FileSystem.deleteFile(dbFile) catch(_) {}
-		var cnx = sys.db.Sqlite.open(dbFile);
-		cnx.request("CREATE TABLE test (id INTEGER)");
-
-		function checkDataSaved(id:Int) {
-			cnx.request('INSERT INTO test (id) VALUES ($id)');
-			cnx.close();
-			cnx = sys.db.Sqlite.open(dbFile);
-			var result = cnx.request('SELECT * FROM test WHERE id = $id');
-			same({id:id}, result.next());
-		}
-
-		cnx.startTransaction();
-		cnx.commit();
-		checkDataSaved(1);
-
-		cnx.startTransaction();
-		cnx.rollback();
-		checkDataSaved(2);
-
-		cnx.request('DROP TABLE test');
-		cnx.close();
-	}
-}

+ 0 - 62
tests/sys/src/db/TestSqliteResultSet.hx

@@ -1,62 +0,0 @@
-package db;
-
-import utest.Assert.*;
-import haxe.ds.ReadOnlyArray;
-
-class TestSqliteResultSet extends SqliteSetup {
-	var data:ReadOnlyArray<{id:Int, num:Float, value:String}> = [
-		{id:1, num:1.5, value:'one'},
-		{id:10, num:10.1, value:'ten'},
-	];
-
-	override function setup() {
-		super.setup();
-		var values = data.map(r -> '(${r.id}, ${r.num}, "${r.value}")').join(',');
-		cnx.request('INSERT INTO test (id, num, value) VALUES $values');
-	}
-
-	function testLength() {
-		var result = cnx.request('SELECT * FROM test');
-		var length = result.length;
-
-		result.next();
-		equals(length - 1, result.length);
-
-		for(_ in result) {}
-		equals(0, result.length);
-	}
-
-	function testNfields() {
-		var result = cnx.request('SELECT * FROM test');
-		equals(3, result.nfields);
-	}
-
-	function testResults() {
-		var result = cnx.request('SELECT * FROM test');
-		same(data, Lambda.array(result.results()));
-	}
-
-#if !cpp //ResultSet.getFieldsNames() is not implemented in cpp.
-
-	function testGetFieldsNames() {
-		var result = cnx.request('SELECT * FROM test ORDER BY id');
-		same(['id', 'num', 'value'], result.getFieldsNames());
-	}
-#end
-
-	function testAsIterator() {
-		var result = cnx.request('SELECT * FROM test ORDER BY id');
-		var rows = [];
-		var expected = data.copy();
-		for(row in result) {
-			same(expected.shift(), row);
-		}
-	}
-
-	function testGetResult() {
-		var result = cnx.request('SELECT * FROM test ORDER BY id');
-		equals('1', result.getResult(0));
-		equals(1, result.getIntResult(0));
-		equals(1, result.getFloatResult(0));
-	}
-}

+ 0 - 39
tests/unit/src/RunExe.hx

@@ -1,39 +0,0 @@
-class RunExe {
-
-
-static function main() {
-		/*
-		cpp: cpp/Test-debug
-		cs : cs/bin/cs
-		cs_unsafe : cs_unsafe/bin/cs_unsafe
-		*/
-		var rel_path = "";
-		if (neko.Web.isModNeko) {
-			//mod neko: use get string
-			rel_path = neko.Web.getParamsString();
-			//display similar to other tests
-			neko.Web.setHeader("Content-Type","text/plain");
-		} else {
-			//command line arg
-			var args = Sys.args();
-			if (args.length > 0) rel_path = args[0];
-		}
-
-		if (rel_path == "") {
-			neko.Lib.print("error:no path to executable specified");
-			return;
-		}
-
-		var p = new sys.io.Process(neko.Web.getCwd() + rel_path, []);
-
-		try {
-			while ( true ) {
-				var c = p.stdout.readByte();
-				neko.Lib.print(StringTools.htmlEscape(String.fromCharCode(c)));
-			}
-		} catch ( e : haxe.io.Eof ) {
-
-		}
-		neko.Lib.print(StringTools.htmlEscape(p.stderr.readAll().toString()));
-	}
-}

+ 0 - 17
tests/unit/src/RunJava.hx

@@ -1,17 +0,0 @@
-class RunJava {
-
-	static function main() {
-		var p = new sys.io.Process("java", ["-jar", neko.Web.getCwd() + "/bin/java/Test-Debug.jar"]);
-		if( neko.Web.isModNeko )
-			neko.Web.setHeader("Content-Type","text/plain");
-		try {
-			while( true ) {
-				var c = p.stdout.readByte();
-				neko.Lib.print(StringTools.htmlEscape(String.fromCharCode(c)));
-			}
-		} catch ( e : haxe.io.Eof ) {
-		}
-		neko.Lib.print(StringTools.htmlEscape(p.stderr.readAll().toString()));
-	}
-
-}

+ 1 - 1
tests/unit/src/unit/Test.hx

@@ -40,7 +40,7 @@ class Test implements utest.ITest {
 	}
 	}
 
 
 	function exc( f : () -> Void, ?pos:haxe.PosInfos ) {
 	function exc( f : () -> Void, ?pos:haxe.PosInfos ) {
-		Assert.raises(f, pos);
+		Assert.raises(f, /* type */ null, pos);
 	}
 	}
 
 
 	function unspec( f : () -> Void, ?pos ) {
 	function unspec( f : () -> Void, ?pos ) {

+ 0 - 81
tests/unit/src/unit/TestHttp.hx

@@ -1,81 +0,0 @@
-package unit;
-
-import utest.Async;
-
-class TestHttp extends Test {
-	#if flash
-	public function setupClass() {
-		flash.system.Security.allowDomain("*");
-		flash.system.Security.allowInsecureDomain("*");
-		flash.system.Security.loadPolicyFile("http://localhost:20200/crossdomain.xml");
-	}
-	#end
-
-	static final RUN_HTTP_TESTS =
-		#if !github false && #end // comment out line to run http tests locally
-		#if (github && (java || flash || (cs && Windows)))
-			false
-		#elseif (js && !nodejs)
-			js.Browser.supported
-		#else
-			true
-		#end;
-
-	function run(async:Async, test:()->Void) {
-		if (RUN_HTTP_TESTS) {
-			test();
-			return;
-		}
-		noAssert();
-		async.done();
-	}
-
-	@:timeout(1000)
-	public function testPostData(async:Async) run(async, () -> {
-		var srcStr = 'hello, world';
-		var d = new haxe.Http('http://localhost:20200/echoServer.n');
-		d.onData = echoStr -> {
-			if(echoStr != srcStr) {
-				assert('String data from Http request is corrupted: $echoStr');
-			}
-			noAssert();
-			async.done();
-		}
-		d.onError = e -> {
-			assert('Failed Http request with string data: $e');
-			async.done();
-		}
-		d.setPostData(srcStr);
-		d.request();
-	});
-
-	@:timeout(1000)
-	public function testPostBytes(async:Async) run(async, () -> {
-		var srcData = haxe.io.Bytes.alloc(256);
-		for(i in 0...srcData.length) {
-			srcData.set(i, i);
-		}
-		var d = new haxe.Http('http://localhost:20200/echoServer.n');
-		d.onBytes = echoData -> {
-			if(srcData.length != echoData.length) {
-				assert('Binary data from Http request is corrupted. Wrong amount of bytes.');
-			}
-			for(i in 0...echoData.length) {
-				switch [srcData.get(i), echoData.get(i)] {
-					case [a, b] if(a != b):
-						assert('Binary data from Http request is corrupted. Invalid byte value at index #$i: (src) $a != $b (echo)');
-						break;
-					case _:
-				}
-			}
-			noAssert();
-			async.done();
-		}
-		d.onError = e -> {
-			assert('Failed Http request with binary data: $e');
-			async.done();
-		}
-		d.setPostBytes(srcData);
-		d.request();
-	});
-}

+ 0 - 8
tests/unit/src/unit/TestMain.hx

@@ -31,13 +31,6 @@ function main() {
 	cs.system.threading.Thread.CurrentThread.CurrentCulture = new cs.system.globalization.CultureInfo('tr-TR');
 	cs.system.threading.Thread.CurrentThread.CurrentCulture = new cs.system.globalization.CultureInfo('tr-TR');
 	cs.Lib.applyCultureChanges();
 	cs.Lib.applyCultureChanges();
 	#end
 	#end
-	#if neko
-	if (neko.Web.isModNeko)
-		neko.Web.setHeader("Content-Type", "text/plain");
-	#elseif php
-	if (php.Web.isModNeko)
-		php.Web.setHeader("Content-Type", "text/plain");
-	#end
 	#if !macro
 	#if !macro
 	trace("Generated at: " + HelperMacros.getCompilationDate());
 	trace("Generated at: " + HelperMacros.getCompilationDate());
 	#end
 	#end
@@ -79,7 +72,6 @@ function main() {
 		new TestNumericCasts(),
 		new TestNumericCasts(),
 		new TestHashMap(),
 		new TestHashMap(),
 		new TestRest(),
 		new TestRest(),
-		new TestHttp(),
 		#if !no_pattern_matching
 		#if !no_pattern_matching
 		new TestMatch(),
 		new TestMatch(),
 		#end
 		#end

+ 72 - 60
tests/unit/src/unit/TestPhp.hx

@@ -4,15 +4,17 @@ import php.*;
 
 
 using StringTools;
 using StringTools;
 
 
-class TestPhp extends Test
-{
-	var list : Array<Dynamic>;
-	var list2 : Array<Dynamic>;
-	function empty() return true;
+class TestPhp extends Test {
+	var list:Array<Dynamic>;
+	var list2:Array<Dynamic>;
+
+	function empty()
+		return true;
+
 	function testAbstractEnum() {
 	function testAbstractEnum() {
 		eq(Abstract.getName(), "Abstract");
 		eq(Abstract.getName(), "Abstract");
 		var x = Const("foo");
 		var x = Const("foo");
-		var s = switch(x) {
+		var s = switch (x) {
 			case Const(s): s;
 			case Const(s): s;
 			case Abstract: "null";
 			case Abstract: "null";
 		}
 		}
@@ -25,17 +27,18 @@ class TestPhp extends Test
 
 
 	function testList2() {
 	function testList2() {
 		list2 = new Array<Dynamic>();
 		list2 = new Array<Dynamic>();
-		for( l in list2 ) {} // fails here
+		for (l in list2) {} // fails here
 		t(true);
 		t(true);
 	}
 	}
 
 
 	function testList() {
 	function testList() {
 		list = new Array<Dynamic>();
 		list = new Array<Dynamic>();
-		for( l in list ) {} // fails here
+		for (l in list) {} // fails here
 		t(true);
 		t(true);
 	}
 	}
 
 
 	var switchVal = "1";
 	var switchVal = "1";
+
 	function testIssue7257_looseSwitchComparison() {
 	function testIssue7257_looseSwitchComparison() {
 		var result = switch (switchVal) {
 		var result = switch (switchVal) {
 			case "01": false;
 			case "01": false;
@@ -49,12 +52,12 @@ class TestPhp extends Test
 		var a = Syntax.customArrayDecl([1 => 'hello', 'world' => true]);
 		var a = Syntax.customArrayDecl([1 => 'hello', 'world' => true]);
 		var keys:Array<Dynamic> = [];
 		var keys:Array<Dynamic> = [];
 		var values:Array<Dynamic> = [];
 		var values:Array<Dynamic> = [];
-		for(k => v in a) {
+		for (k => v in a) {
 			keys.push(k);
 			keys.push(k);
 			values.push(v);
 			values.push(v);
 		}
 		}
-		aeq(([1, 'world']:Array<Dynamic>), keys);
-		aeq((['hello', true]:Array<Dynamic>), values);
+		aeq(([1, 'world'] : Array<Dynamic>), keys);
+		aeq((['hello', true] : Array<Dynamic>), values);
 	}
 	}
 
 
 	function testIssue1828() {
 	function testIssue1828() {
@@ -68,7 +71,7 @@ class TestPhp extends Test
 
 
 	function testIssue1521() {
 	function testIssue1521() {
 		var pattern = "$a$b";
 		var pattern = "$a$b";
-		var result = pattern.replace("$a","A").replace("$b","B");
+		var result = pattern.replace("$a", "A").replace("$b", "B");
 		eq("AB", result);
 		eq("AB", result);
 	}
 	}
 
 
@@ -92,14 +95,14 @@ class TestPhp extends Test
 
 
 	function testStupidShit9000() {
 	function testStupidShit9000() {
 		var f = make();
 		var f = make();
-		f.handle( function() {
+		f.handle(function() {
 			eq("ok", "ok");
 			eq("ok", "ok");
 		});
 		});
 	}
 	}
 
 
 	@:analyzer(ignore)
 	@:analyzer(ignore)
 	function testIssue9924() {
 	function testIssue9924() {
-		var v = Std.random(10);
+		var v:Any = Std.random(10);
 
 
 		var GLOBALS = v;
 		var GLOBALS = v;
 		var _SERVER = v;
 		var _SERVER = v;
@@ -130,7 +133,8 @@ class TestPhp extends Test
 		Check compiler will generate proper function signature with `Ref<T>` arguments
 		Check compiler will generate proper function signature with `Ref<T>` arguments
 	**/
 	**/
 	function testRef() {
 	function testRef() {
-		function modify(i:Ref<Int>) i = 10; //avoid inlining
+		function modify(i:Ref<Int>)
+			i = 10; // avoid inlining
 
 
 		var i = 0;
 		var i = 0;
 		modify(i);
 		modify(i);
@@ -173,7 +177,9 @@ class TestPhp extends Test
 		var result = add(null, 'b');
 		var result = add(null, 'b');
 		eq(result, 'nullb');
 		eq(result, 'nullb');
 	}
 	}
-	function add(a:Dynamic, b:Dynamic):Dynamic return a + b;
+
+	function add(a:Dynamic, b:Dynamic):Dynamic
+		return a + b;
 
 
 	function testStringClosureType() {
 	function testStringClosureType() {
 		var fn:Dynamic = 'foo'.toUpperCase;
 		var fn:Dynamic = 'foo'.toUpperCase;
@@ -185,16 +191,16 @@ class TestPhp extends Test
 	function testStringAsAnon() {
 	function testStringAsAnon() {
 		var str = 'bar';
 		var str = 'bar';
 		var anon:{
 		var anon:{
-			function toUpperCase() : String;
-			function toLowerCase() : String;
-			function charAt( index : Int) : String;
-			function indexOf( str : String, ?startIndex : Int ) : Int;
-			function lastIndexOf( str : String, ?startIndex : Int ) : Int;
-			function split( delimiter : String ) : Array<String>;
-			function toString() : String;
-			function substring( startIndex : Int, ?endIndex : Int ) : String;
-			function charCodeAt( index : Int) : Null<Int> ;
-			function substr( pos : Int, ?len : Int ) : String ;
+			function toUpperCase():String;
+			function toLowerCase():String;
+			function charAt(index:Int):String;
+			function indexOf(str:String, ?startIndex:Int):Int;
+			function lastIndexOf(str:String, ?startIndex:Int):Int;
+			function split(delimiter:String):Array<String>;
+			function toString():String;
+			function substring(startIndex:Int, ?endIndex:Int):String;
+			function charCodeAt(index:Int):Null<Int>;
+			function substr(pos:Int, ?len:Int):String;
 		} = str;
 		} = str;
 
 
 		eq(str.charAt(0), anon.charAt(0));
 		eq(str.charAt(0), anon.charAt(0));
@@ -202,7 +208,7 @@ class TestPhp extends Test
 		eq(str.indexOf("a"), anon.indexOf("a"));
 		eq(str.indexOf("a"), anon.indexOf("a"));
 		eq(str.lastIndexOf("r"), anon.lastIndexOf("r"));
 		eq(str.lastIndexOf("r"), anon.lastIndexOf("r"));
 		eq(str.split("a")[1], anon.split("a")[1]);
 		eq(str.split("a")[1], anon.split("a")[1]);
-		eq(str.substr(1),anon.substr(1, 2));
+		eq(str.substr(1), anon.substr(1, 2));
 		eq(str.substring(0, 2), anon.substring(0, 2));
 		eq(str.substring(0, 2), anon.substring(0, 2));
 		eq(str, anon.toLowerCase());
 		eq(str, anon.toLowerCase());
 		eq(str.toUpperCase(), anon.toUpperCase());
 		eq(str.toUpperCase(), anon.toUpperCase());
@@ -210,33 +216,33 @@ class TestPhp extends Test
 	}
 	}
 
 
 	function testClosureComparison() {
 	function testClosureComparison() {
-		var fn1:()->Void;
-		var fn2:()->Void;
+		var fn1:() -> Void;
+		var fn2:() -> Void;
 		eq(ClosureDummy.testStatic, ClosureDummy.testStatic);
 		eq(ClosureDummy.testStatic, ClosureDummy.testStatic);
-		//Waiting for a fix: https://github.com/HaxeFoundation/haxe/issues/6719
+		// Waiting for a fix: https://github.com/HaxeFoundation/haxe/issues/6719
 		// t(ClosureDummy.testStatic == ClosureDummy.testStatic);
 		// t(ClosureDummy.testStatic == ClosureDummy.testStatic);
-		t((ClosureDummy:Dynamic).testStatic == (ClosureDummy:Dynamic).testStatic);
-		fn1 = (ClosureDummy:Dynamic).testStatic;
-		fn2 = (ClosureDummy:Dynamic).testStatic;
+		t((ClosureDummy : Dynamic).testStatic == (ClosureDummy : Dynamic).testStatic);
+		fn1 = (ClosureDummy : Dynamic).testStatic;
+		fn2 = (ClosureDummy : Dynamic).testStatic;
 		t(fn1 == fn2);
 		t(fn1 == fn2);
 
 
 		var inst = new ClosureDummy();
 		var inst = new ClosureDummy();
 		eq(inst.test, inst.test);
 		eq(inst.test, inst.test);
-		//Waiting for a fix: https://github.com/HaxeFoundation/haxe/issues/6719
+		// Waiting for a fix: https://github.com/HaxeFoundation/haxe/issues/6719
 		// t(inst.test == inst.test);
 		// t(inst.test == inst.test);
-		t((inst:Dynamic).test == (inst:Dynamic).test);
-		fn1 = (inst:Dynamic).test;
-		fn2 = (inst:Dynamic).test;
+		t((inst : Dynamic).test == (inst : Dynamic).test);
+		fn1 = (inst : Dynamic).test;
+		fn2 = (inst : Dynamic).test;
 		t(fn1 == fn2);
 		t(fn1 == fn2);
 		var a = [fn1];
 		var a = [fn1];
 		t(a.indexOf(fn2) == 0);
 		t(a.indexOf(fn2) == 0);
 		t(a.remove(fn2));
 		t(a.remove(fn2));
 
 
 		var inst2 = new ClosureDummy();
 		var inst2 = new ClosureDummy();
-		//Waiting for a fix: https://github.com/HaxeFoundation/haxe/issues/6719
+		// Waiting for a fix: https://github.com/HaxeFoundation/haxe/issues/6719
 		// f(inst.test == inst2.test);
 		// f(inst.test == inst2.test);
 		a = [fn1];
 		a = [fn1];
-		fn2 = (inst2:Dynamic).test;
+		fn2 = (inst2 : Dynamic).test;
 		t(a.indexOf(fn2) < 0);
 		t(a.indexOf(fn2) < 0);
 		f(a.remove(fn2));
 		f(a.remove(fn2));
 	}
 	}
@@ -249,6 +255,7 @@ class TestPhp extends Test
 	}
 	}
 
 
 	var a = 2;
 	var a = 2;
+
 	function testSyntaxCodeParens() {
 	function testSyntaxCodeParens() {
 		eq(8, Syntax.code("{0} * {1}", a, a + a));
 		eq(8, Syntax.code("{0} * {1}", a, a + a));
 	}
 	}
@@ -258,8 +265,6 @@ class TestPhp extends Test
 		var phpPrefix = #if php_prefix Boot.getPrefix() + "\\" #else "" #end;
 		var phpPrefix = #if php_prefix Boot.getPrefix() + "\\" #else "" #end;
 		eq(phpPrefix + "Array_hx", Syntax.nativeClassName(Array));
 		eq(phpPrefix + "Array_hx", Syntax.nativeClassName(Array));
 		eq(phpPrefix + "unit\\Annotation", Syntax.nativeClassName(Annotation));
 		eq(phpPrefix + "unit\\Annotation", Syntax.nativeClassName(Annotation));
-		var cls = php.Web;
-		eq(phpPrefix + "php\\Web", Syntax.nativeClassName(cls));
 		var enm = Annotation;
 		var enm = Annotation;
 		eq(phpPrefix + "unit\\Annotation", Syntax.nativeClassName(enm));
 		eq(phpPrefix + "unit\\Annotation", Syntax.nativeClassName(enm));
 	}
 	}
@@ -268,14 +273,14 @@ class TestPhp extends Test
 		var expected:php.NativeString = '123456';
 		var expected:php.NativeString = '123456';
 
 
 		var actual = '';
 		var actual = '';
-		for(c in expected) {
+		for (c in expected) {
 			actual += c;
 			actual += c;
 		}
 		}
 		eq(expected, actual);
 		eq(expected, actual);
 
 
 		var actual = '';
 		var actual = '';
 		var keys = [];
 		var keys = [];
-		for(i => c in expected) {
+		for (i => c in expected) {
 			keys.push(i);
 			keys.push(i);
 			actual += c;
 			actual += c;
 		}
 		}
@@ -287,16 +292,16 @@ class TestPhp extends Test
 		var keys:Array<Dynamic> = ['hello', 12];
 		var keys:Array<Dynamic> = ['hello', 12];
 		var values:Array<Dynamic> = [10, 'world'];
 		var values:Array<Dynamic> = [10, 'world'];
 		var a = new php.NativeArray();
 		var a = new php.NativeArray();
-		for(i in 0...keys.length) {
+		for (i in 0...keys.length) {
 			a[keys[i]] = values[i];
 			a[keys[i]] = values[i];
 		}
 		}
 
 
-		var actualValues = [for(v in a) v];
+		var actualValues = [for (v in a) v];
 		aeq(values, actualValues);
 		aeq(values, actualValues);
 
 
 		var actualKeys:Array<Dynamic> = [];
 		var actualKeys:Array<Dynamic> = [];
 		var actualValues:Array<Dynamic> = [];
 		var actualValues:Array<Dynamic> = [];
-		for(k => v in a) {
+		for (k => v in a) {
 			actualKeys.push(k);
 			actualKeys.push(k);
 			actualValues.push(v);
 			actualValues.push(v);
 		}
 		}
@@ -307,20 +312,20 @@ class TestPhp extends Test
 	function testNativeIndexedArray() {
 	function testNativeIndexedArray() {
 		var expected = [10, 20, 30];
 		var expected = [10, 20, 30];
 		var a = new NativeIndexedArray<Int>();
 		var a = new NativeIndexedArray<Int>();
-		for(v in expected) {
+		for (v in expected) {
 			a.push(v);
 			a.push(v);
 		}
 		}
 
 
-		var actual = [for(v in a) v];
+		var actual = [for (v in a) v];
 		aeq(expected, actual);
 		aeq(expected, actual);
 
 
 		var indexes = [];
 		var indexes = [];
 		var values = [];
 		var values = [];
-		for(i => v in a) {
+		for (i => v in a) {
 			indexes.push(i);
 			indexes.push(i);
 			values.push(v);
 			values.push(v);
 		}
 		}
-		aeq([for(i in 0...expected.length) i], indexes);
+		aeq([for (i in 0...expected.length) i], indexes);
 		aeq(expected, values);
 		aeq(expected, values);
 
 
 		eq('[10,20,30]', Std.string(a));
 		eq('[10,20,30]', Std.string(a));
@@ -330,16 +335,16 @@ class TestPhp extends Test
 		var keys = ['one', 'two'];
 		var keys = ['one', 'two'];
 		var values = [1, 2];
 		var values = [1, 2];
 		var a = new NativeAssocArray<Int>();
 		var a = new NativeAssocArray<Int>();
-		for(i in 0...keys.length) {
+		for (i in 0...keys.length) {
 			a[keys[i]] = values[i];
 			a[keys[i]] = values[i];
 		}
 		}
 
 
-		var actualValues = [for(v in a) v];
+		var actualValues = [for (v in a) v];
 		aeq(values, actualValues);
 		aeq(values, actualValues);
 
 
 		var actualKeys = [];
 		var actualKeys = [];
 		var actualValues = [];
 		var actualValues = [];
-		for(k => v in a) {
+		for (k => v in a) {
 			actualKeys.push(k);
 			actualKeys.push(k);
 			actualValues.push(v);
 			actualValues.push(v);
 		}
 		}
@@ -350,18 +355,24 @@ class TestPhp extends Test
 
 
 private class ClosureDummy {
 private class ClosureDummy {
 	static public function testStatic() {}
 	static public function testStatic() {}
+
 	public function new() {}
 	public function new() {}
+
 	public function test() {}
 	public function test() {}
 }
 }
 
 
 private class DummyForRef {
 private class DummyForRef {
 	public var field:Int = 0;
 	public var field:Int = 0;
+
 	public function new() {}
 	public function new() {}
-	public function getThis() return this;
+
+	public function getThis()
+		return this;
 }
 }
 
 
 class Class2146 {
 class Class2146 {
 	var array:Array<Class2146>;
 	var array:Array<Class2146>;
+
 	function new() {
 	function new() {
 		array = new Array<Class2146>();
 		array = new Array<Class2146>();
 	}
 	}
@@ -373,7 +384,7 @@ class Class2146 {
 		a.array.push(b);
 		a.array.push(b);
 		b.array.push(a);
 		b.array.push(a);
 		c.array.push(a);
 		c.array.push(a);
-		return Lambda.has(c.array,b);
+		return Lambda.has(c.array, b);
 	}
 	}
 }
 }
 
 
@@ -382,13 +393,14 @@ enum Annotation {
 	Const(i:String);
 	Const(i:String);
 }
 }
 
 
-private typedef Func = ()->Void;
+private typedef Func = () -> Void;
 
 
 private abstract FunctionCaller(Func->Void) to Func->Void {
 private abstract FunctionCaller(Func->Void) to Func->Void {
-	public function new(f:Func->Void) this = f;
+	public function new(f:Func->Void)
+		this = f;
 }
 }
 
 
-private abstract FunctionCallerWrapper( FunctionCaller ) from FunctionCaller to FunctionCaller {
+private abstract FunctionCallerWrapper(FunctionCaller) from FunctionCaller to FunctionCaller {
 	public inline function handle(callback:Func):Void
 	public inline function handle(callback:Func):Void
-		return (this:Func->Void)(callback);
-}
+		return (this : Func->Void)(callback);
+}

+ 8 - 8
tests/unit/src/unit/issues/Issue10876.hx

@@ -12,7 +12,7 @@ extern class MyDefine {}
 extern class MyExtern<T> {
 extern class MyExtern<T> {
 	function new();
 	function new();
 
 
-	function create() : T;
+	function create():T;
 }
 }
 
 
 @:headerCode('
 @:headerCode('
@@ -30,12 +30,12 @@ public:
 ')
 ')
 #end
 #end
 class Issue10876 extends Test {
 class Issue10876 extends Test {
-    #if (cpp && !cppia)
-    function test() {
-        final vec = cpp.Pointer.fromStar(new MyExtern<MyDefine>());
+	#if (cpp && !cppia)
+	function test() {
+		final vec = cpp.Pointer.fromStar(new MyExtern<MyDefine>());
 		final num = vec.ptr.create();
 		final num = vec.ptr.create();
 
 
-        Assert.equals(0, num);
-    }
-    #end
-}
+		Assert.equals(0, cast num);
+	}
+	#end
+}

+ 0 - 17
tests/unit/src/unit/issues/Issue5270.hx

@@ -1,17 +0,0 @@
-package unit.issues;
-
-import php.*;
-
-class Issue5270 extends unit.Test {
-#if php
-	function test() {
-		SuperGlobal._SERVER['CONTENT_TYPE'] = 'type';
-		SuperGlobal._SERVER['HTTP_USER_AGENT'] = 'browser';
-		SuperGlobal._SERVER['REDIRECT_HTTP_AUTHORIZATION'] = 'auth1';
-
-		eq(Web.getClientHeader('Content-Type'), 'type');
-		eq(Web.getClientHeader('User-Agent'), 'browser');
-		eq(Web.getClientHeader('Authorization'), 'auth1');
-	}
-#end
-}