1.2: updated file_put_contents in basics to return number of bytes written or false

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3721 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2006-10-19 18:14:09 +00:00
parent 8115129597
commit 755e3dbae1

View file

@ -866,9 +866,15 @@
} }
$res = @fopen($fileName, 'w+b'); $res = @fopen($fileName, 'w+b');
if ($res) { if ($res) {
@fwrite($res, $data); $write = @fwrite($res, $data);
if($write === false) {
return false;
} else {
return $write;
} }
} }
return false;
}
} }
/** /**
* Reads/writes temporary data to cache files or session. * Reads/writes temporary data to cache files or session.