소스 검색

- fixed: php.Lib.rethrow

Franco Ponticelli 16 년 전
부모
커밋
c330e606e4
1개의 변경된 파일4개의 추가작업 그리고 5개의 파일을 삭제
  1. 4 5
      std/php/Lib.hx

+ 4 - 5
std/php/Lib.hx

@@ -40,12 +40,11 @@ class Lib {
 	}
 	}
 
 
 	public static function isCli() : Bool {
 	public static function isCli() : Bool {
-		return untyped __php__("0 == strncasecmp(PHP_SAPI, 'cli', 3)");
+		return untyped __php__("(0 == strncasecmp(PHP_SAPI, 'cli', 3))");
 	}
 	}
 
 
 	public static function printFile(file : String) {
 	public static function printFile(file : String) {
-		var h = untyped __call__("fopen", file,  "r");
-		return untyped __call__("fpassthru", h);
+		return untyped __call__("fpassthru", __call__("fopen", file,  "r"));
 	}
 	}
 
 
 	public static inline function toPhpArray(a : Array<Dynamic>) : NativeArray {
 	public static inline function toPhpArray(a : Array<Dynamic>) : NativeArray {
@@ -70,8 +69,8 @@ class Lib {
 		For neko compatibility only.
 		For neko compatibility only.
 	**/
 	**/
 	public inline static function rethrow( e : Dynamic ) {
 	public inline static function rethrow( e : Dynamic ) {
-		untyped __php__("if(isset($__e__)) throw $__e__");
-		if(Std.is(e, untyped __php__("Exception"))) {
+		untyped __php__("if(isset($»e)) throw $»e");
+		if(Std.is(e, Exception)) {
 			var __rtex__ = e;
 			var __rtex__ = e;
 			untyped __php__("throw $__rtex__");
 			untyped __php__("throw $__rtex__");
 		}
 		}