This source file includes following definitions.
- sys_get_temp_dir
- file_put_contents
<?php
if (!function_exists('sys_get_temp_dir')) {
function sys_get_temp_dir()
{
if (!empty($_ENV['TMP']))
return realpath($_ENV['TMP']);
if (!empty($_ENV['TMPDIR']))
return realpath($_ENV['TMPDIR']);
if (!empty($_ENV['TEMP']))
return realpath( $_ENV['TEMP']);
return "/tmp";
}
}
if (!function_exists('file_put_contents')) {
function file_put_contents($filename, $data)
{
$handle = fopen($filename, "w");
if (!$handle)
return FALSE;
$bytesWritten = fwrite($handle, $data);
if (!fclose($handle))
return FALSE;
return $bytesWritten;
}
}
?>