Beispiel #1
0
 public static function load($url)
 {
     LoadHelper::$error = "";
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_USERAGENT, 'altpresskit');
     /*
     ErrorHelper::logDebug(LoadHelper::getFilename('log'));
     $log = fopen(LoadHelper::getFilename('log'), "w+");
     curl_setopt($ch, CURLOPT_VERBOSE, true);
     curl_setopt($ch, CURLOPT_STDERR, $log);
     */
     // we need to load custom https certificates here to be able to load from github securely
     curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cert/cacert.pem');
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
     $rawData = curl_exec($ch);
     LoadHelper::$error = curl_error($ch);
     // . "\n" + fread($log, filesize(LoadHelper::getFilename('log')));
     curl_close($ch);
     return $rawData;
 }