From: Edward Date: Wed, 19 Feb 2014 10:18:38 +0000 (+0800) Subject: ConvertStyle.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=f177702ca3cf25ba859e66a1d8c57bd74f290b2c ConvertStyle.php --- diff --git a/ConvertStyle.php b/ConvertStyle.php index 491cdf6a..be0def9f 100644 --- a/ConvertStyle.php +++ b/ConvertStyle.php @@ -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);