Пример #1
0
 protected function request($url, $cache_ttl = false, $cache_ext = '', $format = 'json')
 {
     $restapi = new RestApi();
     $restapi->setFormat($format);
     if ($cache_ttl && $this->cacheEnabled()) {
         $restapi->setCache($cache_ttl, $this->config['cache_directory'], $cache_ext);
     } else {
         $restapi->setCacheLife(0);
     }
     return $restapi->request($url, array('headers' => array('User-Agent: jarvis')));
 }