|
@@ -1,167 +1,27 @@
|
|
package php;
|
|
package php;
|
|
|
|
|
|
class Boot {
|
|
class Boot {
|
|
- static private var __qtypes : Array<Dynamic>;
|
|
|
|
- static private var __ttypes : Array<Dynamic>;
|
|
|
|
- static private var __tpaths : Array<Dynamic>;
|
|
|
|
- static public function __register_type(t : Dynamic) {
|
|
|
|
- untyped __php__(
|
|
|
|
- "php_Boot::$__qtypes[$t->__qname__] = $t;
|
|
|
|
- php_Boot::$__ttypes[$t->__tname__] = $t;
|
|
|
|
- if($t->__path__ !== null)
|
|
|
|
- php_Boot::$__tpaths[$t->__tname__] = $t->__path__");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static public function __qtype(n) untyped {
|
|
|
|
- if(__call__("isset", __qtypes[n]))
|
|
|
|
- return __qtypes[n];
|
|
|
|
- else
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static public function __ttype(n) untyped {
|
|
|
|
- if(__call__("isset", __ttypes[n]))
|
|
|
|
- return __ttypes[n];
|
|
|
|
- else
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static public function __deref(byref__o : Dynamic) {
|
|
|
|
- return byref__o;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static public function __byref__array_get(byref__o : Dynamic, index : Dynamic) {
|
|
|
|
- var r = null;
|
|
|
|
- untyped __php__("if(isset($byref__o[$index])) $r =& $byref__o[$index]");
|
|
|
|
- return r;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static private var __resources = [];
|
|
|
|
- static public function __res(n : String) : String untyped {
|
|
|
|
- if(! __php__("isset(self::$__resources[$n])")) {
|
|
|
|
- var file = __php__("dirname(__FILE__).'/../../res/'.$n");
|
|
|
|
- if(!__call__("file_exists", file))
|
|
|
|
- throw "Invalid Resource name: " + n;
|
|
|
|
- __php__("self::$__resources[$n] = file_get_contents($file)");
|
|
|
|
- }
|
|
|
|
- return __php__("self::$__resources[$n]");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static function __string_call(s : Dynamic, method : String, params : ArrayAccess<Dynamic>) {
|
|
|
|
- if(!untyped __call__("is_string", s)) return untyped __php__("call_user_func_array(array($s, $method), $params)");
|
|
|
|
- var s2 : String = s;
|
|
|
|
- switch(method) {
|
|
|
|
- case "toUpperCase": return untyped s2.toUpperCase();
|
|
|
|
- case "toLowerCase": return untyped s2.toLowerCase();
|
|
|
|
- case "charAt" : return untyped s2.charAt(params[0]);
|
|
|
|
- case "charCodeAt" : return untyped s2.charCodeAt(params[0]);
|
|
|
|
- case "indexOf" : return untyped s2.indexOf(params[0], params.length > 1 ? params[1] : null);
|
|
|
|
- case "lastIndexOf": return untyped s2.lastIndexOf(params.length > 1 ? params[1] : null);
|
|
|
|
- case "split" : return untyped s2.split(params[0]);
|
|
|
|
- case "substr" : return untyped s2.substr(params[0], params.length > 1 ? params[1] : null);
|
|
|
|
- default: throw "Invalid Operation: " + method;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static function __array_call(arr : Array<Dynamic>, method : String, params : ArrayAccess<Dynamic>) {
|
|
|
|
- if(!untyped __call__("is_array", arr)) return untyped __php__("call_user_func_array(array($arr, $method), $params)");
|
|
|
|
- switch(method) {
|
|
|
|
- case "concat" : return untyped arr.concat(params[0]);
|
|
|
|
- case "copy" : return untyped arr.copy();
|
|
|
|
- case "insert" : return untyped arr.insert(params[0], params[1]);
|
|
|
|
- case "iterator": return untyped arr.iterator();
|
|
|
|
- case "join" : return untyped arr.join(params[0]);
|
|
|
|
- case "pop" : return untyped arr.pop();
|
|
|
|
- case "push" : return untyped arr.push(params[0]);
|
|
|
|
- case "remove" : return untyped arr.remove(params[0]);
|
|
|
|
- case "reverse" : return untyped arr.reverse();
|
|
|
|
- case "shift" : return untyped arr.shift();
|
|
|
|
- case "slice" : return untyped arr.slice(params[0], params.length > 1 ? params[1] : null);
|
|
|
|
- case "sort" : return untyped arr.sort(params[0]);
|
|
|
|
- case "splice" : return untyped arr.splice(params[0], params[1]);
|
|
|
|
- case "unshift" : return untyped arr.unshift(params[0]);
|
|
|
|
- default: throw "Invalid Operation: " + method;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static public function __string_rec(o : Dynamic, s : String) {
|
|
|
|
- if( o == null )
|
|
|
|
- return "null";
|
|
|
|
- if( s.length >= 5 )
|
|
|
|
- return "<...>"; // too much deep recursion
|
|
|
|
-
|
|
|
|
- if(untyped __call__("is_int", o) || __call__("is_float", o))
|
|
|
|
- return o;
|
|
|
|
-
|
|
|
|
- if(untyped __call__("is_bool", o))
|
|
|
|
- return o ? "true" : "false";
|
|
|
|
-
|
|
|
|
- if(untyped __call__("is_object", o)) {
|
|
|
|
- var c = untyped __call__("get_class", o);
|
|
|
|
- if(untyped __php__("$o instanceof Enum")) {
|
|
|
|
- var b : String = o.tag;
|
|
|
|
- if(!untyped __call__("empty", o.params)) {
|
|
|
|
- s += "\t";
|
|
|
|
- b += '(';
|
|
|
|
- for( i in 0...untyped __call__("count", o.params) ) {
|
|
|
|
- if(i > 0)
|
|
|
|
- b += ', ' + __string_rec(o.params[i],s);
|
|
|
|
- else
|
|
|
|
- b += __string_rec(o.params[i],s);
|
|
|
|
- }
|
|
|
|
- b += ')';
|
|
|
|
- }
|
|
|
|
- return b;
|
|
|
|
- } else if(untyped __php__("$o instanceof _hx_anonymous")) {
|
|
|
|
- var rfl = untyped __php__("new ReflectionObject($o)");
|
|
|
|
- var b = "{\n";
|
|
|
|
- s += "\t";
|
|
|
|
- var properties : Array<Dynamic> = rfl.getProperties();
|
|
|
|
- for(prop in properties) {
|
|
|
|
- var f : String = prop.getName();
|
|
|
|
- if(b.length != 2)
|
|
|
|
- b += ", \n";
|
|
|
|
- b += s + f + " : " + __string_rec(prop.getValue(o), s);
|
|
|
|
- }
|
|
|
|
- s = s.substr(1);
|
|
|
|
- b += "\n" + s + "}";
|
|
|
|
- return b;
|
|
|
|
- } else if(untyped __php__("$o instanceof _hx_type")) {
|
|
|
|
- return untyped o.__qname__;
|
|
|
|
- } else {
|
|
|
|
- if(untyped __call__("is_callable", [o, "toString"]))
|
|
|
|
- return untyped __php__("$o->toString()");
|
|
|
|
- else if(untyped __call__("is_callable", [o, "__toString"]))
|
|
|
|
- return o.__toString();
|
|
|
|
- else
|
|
|
|
- return "[" + __ttype(c) + "]";
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(untyped __call__("is_string", o)) {
|
|
|
|
- if(untyped __call__("_hx_is_lambda", o)) return "«function»";
|
|
|
|
- if(s.length > 0)
|
|
|
|
- return '"'+untyped __call__("str_replace", '"', '\\"', o)+'"';
|
|
|
|
- else
|
|
|
|
- return o;
|
|
|
|
- }
|
|
|
|
|
|
+ static var qtypes;
|
|
|
|
+ static var ttypes;
|
|
|
|
+ static var tpaths;
|
|
|
|
+ static var skip_constructor = false;
|
|
|
|
+ static function __init__() : Void {
|
|
|
|
+ untyped __php__("//error_reporting(0);
|
|
|
|
|
|
- if(untyped __call__("is_array", o)) {
|
|
|
|
- if(untyped __call__("is_callable", o)) return "«function»";
|
|
|
|
- var str = "[";
|
|
|
|
- s += "\t";
|
|
|
|
- for( i in 0...untyped __call__("count", o) )
|
|
|
|
- str += (if (i > 0) ", " else "")+__string_rec(untyped o[i],s);
|
|
|
|
- str += "]";
|
|
|
|
- return str;
|
|
|
|
- }
|
|
|
|
|
|
+function _hx_register_type($t) {
|
|
|
|
+ php_Boot::$qtypes[$t->__qname__] = $t;
|
|
|
|
+ php_Boot::$ttypes[$t->__tname__] = $t;
|
|
|
|
+ if($t->__path__ !== null)
|
|
|
|
+ php_Boot::$tpaths[$t->__tname__] = $t->__path__;
|
|
|
|
+}
|
|
|
|
|
|
- return '';
|
|
|
|
- }
|
|
|
|
- static public var skip_constructor = false;
|
|
|
|
|
|
+function _hx_qtype($n) {
|
|
|
|
+ return isset(php_Boot::$qtypes[$n]) ? php_Boot::$qtypes[$n] : null;
|
|
|
|
+}
|
|
|
|
|
|
- static function __init__() untyped {
|
|
|
|
- __php__("//error_reporting(0);
|
|
|
|
|
|
+function _hx_ttype($n) {
|
|
|
|
+ return isset(php_Boot::$ttypes[$n]) ? php_Boot::$ttypes[$n] : null;
|
|
|
|
+}
|
|
|
|
|
|
function _hx_error_handler($errno, $errmsg, $filename, $linenum, $vars) {
|
|
function _hx_error_handler($errno, $errmsg, $filename, $linenum, $vars) {
|
|
$msg = $errmsg . ' (errno: ' . $errno . ') in ' . $filename . ' at line #' . $linenum;
|
|
$msg = $errmsg . ' (errno: ' . $errno . ') in ' . $filename . ' at line #' . $linenum;
|
|
@@ -197,6 +57,61 @@ function _hx_instanceof($v, $t) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function _hx_deref(&$o) {
|
|
|
|
+ return $o;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function &_hx_array_get_ref(&$o, $index) {
|
|
|
|
+ $r = null;
|
|
|
|
+ if(isset($o[$index])) $r =& $o[$index];
|
|
|
|
+ return $r;
|
|
|
|
+}
|
|
|
|
+/*
|
|
|
|
+function _hx_res($n) {
|
|
|
|
+ $file = dirname(__FILE__).'/../../res/'.$n;
|
|
|
|
+ if(!file_exists($file))
|
|
|
|
+ throw new HException('Invalid Resource name: ' . $n);
|
|
|
|
+ return file_get_contents($file);
|
|
|
|
+}
|
|
|
|
+*/
|
|
|
|
+
|
|
|
|
+function _hx_string_call($s, $method, $params) {
|
|
|
|
+ if(!is_string($s)) return call_user_func_array(array($s, $method), $params);
|
|
|
|
+ switch($method) {
|
|
|
|
+ case 'toUpperCase': return strtoupper($s);
|
|
|
|
+ case 'toLowerCase': return strtolower($s);
|
|
|
|
+ case 'charAt' : return substr($s, $params[0], 1);
|
|
|
|
+ case 'charCodeAt' : return _hx_char_code_at($s, $params[0]);
|
|
|
|
+ case 'indexOf' : return _hx_index_of($s, $params[0], (_hx_len($params) > 1 ? $params[1] : null));
|
|
|
|
+ case 'lastIndexOf': return _hx_last_index_of($s, (_hx_len($params) > 1 ? $params[1] : null), null);
|
|
|
|
+ case 'split' : return explode($params[0], $s);
|
|
|
|
+ case 'substr' : return _hx_substr($s, $params[0], (_hx_len($params) > 1 ? $params[1] : null));
|
|
|
|
+ default : throw new HException('Invalid Operation: ' . $method);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function _hx_array_call(&$arr, $method, $params) {
|
|
|
|
+ if(!is_array($arr)) return call_user_func_array(array($arr, $method), $params);
|
|
|
|
+ switch($method) {
|
|
|
|
+ case 'concat' : return array_merge($arr, $params[0]);
|
|
|
|
+ case 'copy' : return _hx_array_copy($arr);
|
|
|
|
+ case 'insert' : return _hx_array_insert($arr, $params[0], $params[1]);
|
|
|
|
+ case 'iterator': return new _hx_array_iterator($arr);
|
|
|
|
+ case 'join' : return join($params[0], $arr);
|
|
|
|
+ case 'pop' : return array_pop($arr);
|
|
|
|
+ case 'push' : return array_push($arr, $params[0]);
|
|
|
|
+ case 'remove' : return _hx_array_remove($arr, $params[0]);
|
|
|
|
+ case 'reverse' : return _hx_array_reverse($arr);
|
|
|
|
+ case 'shift' : return array_shift($arr);
|
|
|
|
+ case 'slice' : return _hx_array_slice($arr, $params[0], (_hx_len($params) > 1 ? $params[1] : null));
|
|
|
|
+ case 'sort' : return _hx_array_sort($arr, $params[0]);
|
|
|
|
+ case 'splice' : return _hx_array_splice($arr, $params[0], $params[1]);
|
|
|
|
+ case 'unshift' : return array_unshift($arr, $params[0]);
|
|
|
|
+ default : throw new HException('Invalid Operation: ' . $method);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
function _hx_shift_right($v, $n) {
|
|
function _hx_shift_right($v, $n) {
|
|
$z = 0x80000000;
|
|
$z = 0x80000000;
|
|
if ($z & $v) {
|
|
if ($z & $v) {
|
|
@@ -307,6 +222,78 @@ function _hx_field($o, $field) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function _hx_string_rec($o, $s) {
|
|
|
|
+ if($o === null) return 'null';
|
|
|
|
+ if(strlen($s) >= 5) return '<...>';
|
|
|
|
+ if(is_int($o) || is_float($o)) return $o;
|
|
|
|
+ if(is_bool($o)) return $o ? 'true' : 'false';
|
|
|
|
+ if(is_object($o)) {
|
|
|
|
+ $c = get_class($o);
|
|
|
|
+ if($o instanceof Enum) {
|
|
|
|
+ $b = $o->tag;
|
|
|
|
+ if(!empty($o->params)) {
|
|
|
|
+ $s .= \"\t\";
|
|
|
|
+ $b .= '(';
|
|
|
|
+ for($i = 0; $i < count($o->params); $i++) {
|
|
|
|
+ if($i > 0)
|
|
|
|
+ $b .= ', ' . _hx_string_rec($o->params[$i], $s);
|
|
|
|
+ else
|
|
|
|
+ $b .= _hx_string_rec($o->params[$i], $s);
|
|
|
|
+ }
|
|
|
|
+ $b .= ')';
|
|
|
|
+ }
|
|
|
|
+ return $b;
|
|
|
|
+ } else {
|
|
|
|
+ if($o instanceof _hx_anonymous) {
|
|
|
|
+ $rfl = new ReflectionObject($o);
|
|
|
|
+ $b2 = \"{\n\";
|
|
|
|
+ $s .= \"\t\";
|
|
|
|
+ $properties = $rfl->getProperties();
|
|
|
|
+
|
|
|
|
+ for($i = 0; $i < count($properties); $i++) {
|
|
|
|
+ $prop = $properties[$i];
|
|
|
|
+ $f = $prop->getName();
|
|
|
|
+ if(strlen($b2) !== 2)
|
|
|
|
+ $b2 .= \", \n\";
|
|
|
|
+ $b2 .= $s . $f . ' : ' . _hx_string_rec($prop->getValue($o), $s);
|
|
|
|
+ }
|
|
|
|
+ $s = substr($s, 1);
|
|
|
|
+ $b2 .= \"\n\" . $s . '}';
|
|
|
|
+ return $b2;
|
|
|
|
+ } else {
|
|
|
|
+ if($o instanceof _hx_type)
|
|
|
|
+ return $o->__qname__;
|
|
|
|
+ else {
|
|
|
|
+ if(is_callable(_hx_array($o, 'toString')))
|
|
|
|
+ return $o->toString();
|
|
|
|
+ else {
|
|
|
|
+ if(is_callable(_hx_array($o, '__toString')))
|
|
|
|
+ return $o->__toString();
|
|
|
|
+ else
|
|
|
|
+ return '[' . _hx_ttype($c) . ']';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(is_string($o)) {
|
|
|
|
+ if(_hx_is_lambda($o)) return '«function»';
|
|
|
|
+ if(strlen($s) > 0) return '\"' . str_replace('\"', '\\\"', $o) . '\"';
|
|
|
|
+ else return $o;
|
|
|
|
+ }
|
|
|
|
+ if(is_array($o)) {
|
|
|
|
+ if(is_callable($o)) return '«function»';
|
|
|
|
+ $str = '[';
|
|
|
|
+ $s .= \"\t\";
|
|
|
|
+ for($i = 0; $i < count($o); $i++)
|
|
|
|
+ $str .= ($i > 0 ? ', ' : '') . _hx_string_rec($o[$i], $s);
|
|
|
|
+ $str .= ']';
|
|
|
|
+ return $str;
|
|
|
|
+ }
|
|
|
|
+ return '';
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
function _hx_array_copy($a) {
|
|
function _hx_array_copy($a) {
|
|
return $a;
|
|
return $a;
|
|
}
|
|
}
|
|
@@ -391,7 +378,7 @@ function _hx_anonymous($p = array()) {
|
|
|
|
|
|
function _hx_trace($v, $i) {
|
|
function _hx_trace($v, $i) {
|
|
$msg = $i !== null ? $i->fileName.':'.$i->lineNumber.': ' : '';
|
|
$msg = $i !== null ? $i->fileName.':'.$i->lineNumber.': ' : '';
|
|
- echo $msg.php_Boot::__string_rec($v, '').\"\n\";
|
|
|
|
|
|
+ echo $msg._hx_string_rec($v, '').\"\n\";
|
|
}
|
|
}
|
|
|
|
|
|
function _hx_len($o) {
|
|
function _hx_len($o) {
|
|
@@ -567,12 +554,12 @@ class _hx_array_iterator {
|
|
}
|
|
}
|
|
|
|
|
|
class HException extends Exception {
|
|
class HException extends Exception {
|
|
- public function __construct($e, $message = null, $code = null, $p = null) { if( !php_Boot::$skip_constructor ) {
|
|
|
|
- $message = php_Boot::__string_rec($e, '') . $message;
|
|
|
|
|
|
+ public function __construct($e, $message = null, $code = null, $p = null) {
|
|
|
|
+ $message = _hx_string_rec($e, '') . $message;
|
|
parent::__construct($message,$code);
|
|
parent::__construct($message,$code);
|
|
$this->e = $e;
|
|
$this->e = $e;
|
|
$this->p = $p;
|
|
$this->p = $p;
|
|
- }}
|
|
|
|
|
|
+ }
|
|
public $e;
|
|
public $e;
|
|
public $p;
|
|
public $p;
|
|
public function setLine($l) {
|
|
public function setLine($l) {
|
|
@@ -678,18 +665,19 @@ class Enum {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-php_Boot::$__qtypes = array();
|
|
|
|
-php_Boot::$__ttypes = array();
|
|
|
|
-php_Boot::$__tpaths = array();
|
|
|
|
-php_Boot::__register_type(new _hx_class('String', 'String'));
|
|
|
|
-php_Boot::__register_type(new _hx_class('Array', 'Array'));
|
|
|
|
-php_Boot::__register_type(new _hx_class('Int', 'Int'));
|
|
|
|
-php_Boot::__register_type(new _hx_class('Float', 'Float'));
|
|
|
|
-php_Boot::__register_type(new _hx_class('Class', 'Class'));
|
|
|
|
-php_Boot::__register_type(new _hx_class('Enum', 'Enum'));
|
|
|
|
-php_Boot::__register_type(new _hx_class('Dynamic', 'Dynamic'));
|
|
|
|
-php_Boot::__register_type(new _hx_enum('Bool', 'Bool'));
|
|
|
|
-php_Boot::__register_type(new _hx_enum('Void', 'Void'));
|
|
|
|
|
|
+php_Boot::$qtypes = array();
|
|
|
|
+php_Boot::$ttypes = array();
|
|
|
|
+php_Boot::$tpaths = array();
|
|
|
|
+
|
|
|
|
+_hx_register_type(new _hx_class('String', 'String'));
|
|
|
|
+_hx_register_type(new _hx_class('Array', 'Array'));
|
|
|
|
+_hx_register_type(new _hx_class('Int', 'Int'));
|
|
|
|
+_hx_register_type(new _hx_class('Float', 'Float'));
|
|
|
|
+_hx_register_type(new _hx_class('Class', 'Class'));
|
|
|
|
+_hx_register_type(new _hx_class('Enum', 'Enum'));
|
|
|
|
+_hx_register_type(new _hx_class('Dynamic', 'Dynamic'));
|
|
|
|
+_hx_register_type(new _hx_enum('Bool', 'Bool'));
|
|
|
|
+_hx_register_type(new _hx_enum('Void', 'Void'));
|
|
|
|
|
|
|
|
|
|
$_hx_libdir = dirname(__FILE__) . '/..';
|
|
$_hx_libdir = dirname(__FILE__) . '/..';
|
|
@@ -731,13 +719,13 @@ if(!file_exists($_hx_autload_cache_file)) {
|
|
closedir($h);
|
|
closedir($h);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ $_hx_cache_content = '<?php\n\n';
|
|
$_hx_types_array = array();
|
|
$_hx_types_array = array();
|
|
|
|
|
|
_hx_build_paths($_hx_libdir, $_hx_types_array, array());
|
|
_hx_build_paths($_hx_libdir, $_hx_types_array, array());
|
|
|
|
|
|
- $_hx_cache_content = '<?php\n\n';
|
|
|
|
for($i=0;$i<count($_hx_types_array);$i++) {
|
|
for($i=0;$i<count($_hx_types_array);$i++) {
|
|
- $_hx_cache_content .= 'php_Boot::__register_type(new ';
|
|
|
|
|
|
+ $_hx_cache_content .= '_hx_register_type(new ';
|
|
$t = null;
|
|
$t = null;
|
|
if($_hx_types_array[$i]['type'] == 0) {
|
|
if($_hx_types_array[$i]['type'] == 0) {
|
|
$t = new _hx_class($_hx_types_array[$i]['phpname'], $_hx_types_array[$i]['qname'], $_hx_types_array[$i]['path']);
|
|
$t = new _hx_class($_hx_types_array[$i]['phpname'], $_hx_types_array[$i]['qname'], $_hx_types_array[$i]['path']);
|
|
@@ -752,21 +740,21 @@ if(!file_exists($_hx_autload_cache_file)) {
|
|
$t = new _hx_class($_hx_types_array[$i]['name'], $_hx_types_array[$i]['qname'], $_hx_types_array[$i]['path']);
|
|
$t = new _hx_class($_hx_types_array[$i]['name'], $_hx_types_array[$i]['qname'], $_hx_types_array[$i]['path']);
|
|
$_hx_cache_content .= '_hx_class';
|
|
$_hx_cache_content .= '_hx_class';
|
|
}
|
|
}
|
|
- php_Boot::__register_type($t);
|
|
|
|
|
|
+ _hx_register_type($t);
|
|
$_hx_cache_content .= '(\\''.($_hx_types_array[$i]['type'] == 3 ? $_hx_types_array[$i]['name'] : $_hx_types_array[$i]['phpname']).'\\', \\''.$_hx_types_array[$i]['qname'].'\\', \\''.$_hx_types_array[$i]['path'].'\\'));\n';
|
|
$_hx_cache_content .= '(\\''.($_hx_types_array[$i]['type'] == 3 ? $_hx_types_array[$i]['name'] : $_hx_types_array[$i]['phpname']).'\\', \\''.$_hx_types_array[$i]['qname'].'\\', \\''.$_hx_types_array[$i]['path'].'\\'));\n';
|
|
}
|
|
}
|
|
- unset($_hx_types_array);
|
|
|
|
try {
|
|
try {
|
|
file_put_contents($_hx_autload_cache_file, $_hx_cache_content);
|
|
file_put_contents($_hx_autload_cache_file, $_hx_cache_content);
|
|
- unset($_hx_cache_content);
|
|
|
|
} catch(Exception $e) {}
|
|
} catch(Exception $e) {}
|
|
|
|
+ unset($_hx_types_array);
|
|
|
|
+ unset($_hx_cache_content);
|
|
} else {
|
|
} else {
|
|
require($_hx_autload_cache_file);
|
|
require($_hx_autload_cache_file);
|
|
}
|
|
}
|
|
|
|
|
|
function _hx_autoload($name) {
|
|
function _hx_autoload($name) {
|
|
- if(!isset(php_Boot::$__tpaths[$name])) return false;
|
|
|
|
- require_once php_Boot::$__tpaths[$name];
|
|
|
|
|
|
+ if(!isset(php_Boot::$tpaths[$name])) return false;
|
|
|
|
+ require_once(php_Boot::$tpaths[$name]);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|