1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Issue #268 - graceful retreat if CURL not installed on getRemoteFile()

This commit is contained in:
SteveD 2013-05-13 22:04:36 +01:00
parent adf6417868
commit d6c5c91a3d

View File

@ -315,9 +315,23 @@ class e_file
return $finfo;
}
// Grab a remote file and save it in the /temp directory. requires CURL
/**
* Grab a remote file and save it in the /temp directory. requires CURL
*
* @return boolean TRUE on success, FALSE on failure (which includes absence of CURL functions)
*/
function getRemoteFile($remote_url, $local_file, $type='temp')
{
if (!function_exists('curl_init'))
{
if(E107_DEBUG_LEVEL > 0)
{
$log->addDebug('getRemoteFile() requires CURL to be installed in file_class.php');
}
return FALSE; // May not be installed
}
$path = ($type == 'media') ? e_MEDIA : e_TEMP;
$fp = fopen($path.$local_file, 'w'); // media-directory is the root.