function execute($data = null) { if (isset($this->curl[CURLOPT_POST]) && $this->curl[CURLOPT_POST]) { return parent::Execute(); } $cache = $this->cache; $url = $this->curl[CURLOPT_URL]; $ret = $cache::Get($url); if ($ret) { return $ret; } $ret = parent::Execute($data); $cache::Set($ret, $url); return $ret; }
static function fetch($url) { $http = new Fetch($url); $obj = $http->Execute(); return $obj->getContent(); }