mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-14617 file_put_content emulation gone
This commit is contained in:
parent
2728a623e7
commit
7267cfda93
1 changed files with 0 additions and 19 deletions
|
@ -7417,25 +7417,6 @@ function cleanremoteaddr($addr) {
|
||||||
return array_pop($goodmatches);
|
return array_pop($goodmatches);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* file_put_contents is only supported by php 5.0 and higher
|
|
||||||
* so if it is not predefined, define it here
|
|
||||||
*
|
|
||||||
* @param $file full path of the file to write
|
|
||||||
* @param $contents contents to be sent
|
|
||||||
* @return number of bytes written (false on error)
|
|
||||||
*/
|
|
||||||
if(!function_exists('file_put_contents')) {
|
|
||||||
function file_put_contents($file, $contents) {
|
|
||||||
$result = false;
|
|
||||||
if ($f = fopen($file, 'w')) {
|
|
||||||
$result = fwrite($f, $contents);
|
|
||||||
fclose($f);
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The clone keyword is only supported from PHP 5 onwards.
|
* The clone keyword is only supported from PHP 5 onwards.
|
||||||
* The behaviour of $obj2 = $obj1 differs fundamentally
|
* The behaviour of $obj2 = $obj1 differs fundamentally
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue