public static function download_file($download, $to) { if (!pts_network::network_support_available()) { return false; } if (strpos($download, '://') === false) { $download = 'http://' . $download; } else { if (getenv('NO_HTTPS') != false) { // On some platforms like DragonFly 4.2 ran into problem of all HTTPS downloads failing $download = str_replace('https://', 'http://', $download); } } if (function_exists('curl_init') && stripos(PTS_PHP_VERSION, 'hiphop') === false) { // XXX: Facebook HipHop HHVM currently seems to have problems with PHP CURL $return_state = pts_network::curl_download($download, $to); } else { $return_state = pts_network::stream_download($download, $to); } //echo '\nPHP CURL must either be installed or you must adjust your PHP settings file to support opening FTP/HTTP streams.\n'; //return false; if ($return_state == true) { pts_client::$display->test_install_progress_completed(); } }