file : add flags support for file_put_contents
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3004 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
4
file.php
4
file.php
@@ -188,7 +188,7 @@ class file
|
|||||||
* @throws If parent directory not exists, is not writeable, or the file
|
* @throws If parent directory not exists, is not writeable, or the file
|
||||||
* exists and is not writeable
|
* exists and is not writeable
|
||||||
*/
|
*/
|
||||||
public function file_put_contents ($filename, $data)
|
public function file_put_contents ($filename, $data, $flags)
|
||||||
{
|
{
|
||||||
$this->debug (2, "file_put_contents ($filename)");
|
$this->debug (2, "file_put_contents ($filename)");
|
||||||
$filename = $this->realpath ($filename);
|
$filename = $this->realpath ($filename);
|
||||||
@@ -201,7 +201,7 @@ class file
|
|||||||
throw new \Exception (sprintf (dgettext ("domframework",
|
throw new \Exception (sprintf (dgettext ("domframework",
|
||||||
"File '%s' is not a file"),
|
"File '%s' is not a file"),
|
||||||
$filename), 500);
|
$filename), 500);
|
||||||
$contents = file_put_contents ($filename, $data);
|
$contents = file_put_contents ($filename, $data, $flags);
|
||||||
$this->debug (1, "file_put_contents ($filename, \$data) => ".
|
$this->debug (1, "file_put_contents ($filename, \$data) => ".
|
||||||
"$contents bytes");
|
"$contents bytes");
|
||||||
return $contents;
|
return $contents;
|
||||||
|
|||||||
Reference in New Issue
Block a user