|
@@ -15,11 +15,11 @@ class Lib {
|
|
|
print(v);
|
|
|
print("\n");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static function dump(v : Dynamic) : Void {
|
|
|
untyped __call__("var_dump", v);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
Serialize using native PHP serialization. This will return a Binary string that can be
|
|
|
stored for long term usage.
|
|
@@ -34,31 +34,39 @@ class Lib {
|
|
|
public static function unserialize( s : String ) : Dynamic {
|
|
|
return untyped __call__("unserialize", s);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static function extensionLoaded(name : String) {
|
|
|
return untyped __call__("extension_loaded", name);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static function isCli() : Bool {
|
|
|
return untyped __php__("0 == strncasecmp(PHP_SAPI, 'cli', 3)");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static function exit(?msg : String) {
|
|
|
return untyped __call__("exit", msg);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static function exitCode(code : Int) {
|
|
|
return untyped __call__("exit", code);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static function printFile(file : String) {
|
|
|
var h = untyped __call__("fopen", file, "r");
|
|
|
return untyped __call__("fpassthru", h);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static function hashOfAssociativeArray<T>(arr : Dynamic) : Hash<T> {
|
|
|
var h = new Hash<T>();
|
|
|
untyped __php__("foreach($arr as $k => $v) $h->set($k, $v)");
|
|
|
return h;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ For neko compatibility only.
|
|
|
+ **/
|
|
|
+ public static function rethrow( e : Dynamic ) {
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
+
|
|
|
}
|