ConvertStyle.php
authorEdward <edward@roojs.com>
Wed, 19 Feb 2014 10:18:38 +0000 (18:18 +0800)
committerEdward <edward@roojs.com>
Wed, 19 Feb 2014 10:18:38 +0000 (18:18 +0800)
ConvertStyle.php

index 491cdf6..be0def9 100644 (file)
@@ -61,25 +61,25 @@ class Pman_Core_ConvertStyle extends Pman
     
     var $styleSheets = array();
     
-    function convertStyle($url, $file, $is_url = false)
+    function convertStyle($url, $file, $is_url = true)
     {
-//        if(!empty($url))
-//        {
-//            $host = parse_url($url);
-//            require_once 'System.php';
-//            $wget = System::which('wget');
-//            if (!$wget) {
-//                $this->jerr("no wget");
-//            }
-//            $cmd =  $wget . ' -q -O -  ' . escapeshellarg($url);
-//            
-//            //echo $cmd; exit;
-//            $data = `$cmd`;
-//            
-//            if (!trim(strlen($data))) {
-//                $this->jerr("url returned an empty string");
-//            }
-//        }
+        if($is_url && !empty($url))
+        {
+            $host = parse_url($url);
+            require_once 'System.php';
+            $wget = System::which('wget');
+            if (!$wget) {
+                $this->jerr("no wget");
+            }
+            $cmd =  $wget . ' -q -O -  ' . escapeshellarg($url);
+            
+            //echo $cmd; exit;
+            $data = `$cmd`;
+            
+            if (!trim(strlen($data))) {
+                $this->jerr("url returned an empty string");
+            }
+        }
         
         if(!$is_url){
             $data = file_get_contents($file);