ID: 25185
User updated by: cpuidle at gmx dot de
Reported By: cpuidle at gmx dot de
Status: Open
Bug Type: *General Issues
Operating System: Windows
PHP Version: 4.3.3RC4
New Comment:
Have not tried the snapshot yet- is it supposed to fix (un)serialize or
load/store?
Andi
Previous Comments:
------------------------------------------------------------------------
[2003-08-21 14:46:20] cpuidle at gmx dot de
This is the code to save and restore the data:
function download($url, $local){
$resp = fetchHTTP($url);
$writefile = @fopen($local, "wb");
if(!$writefile) return false;
if(!fwrite($writefile, $resp[data], strlen($resp[data]))) return
false;
fclose($writefile);
return true;
}
function getHTTPcache($url){
$cfile='../videodb/cache/imdb/'.md5($url);
$resp = unserialize(join('',file($cfile)));
return $resp;
}
------------------------------------------------------------------------
[2003-08-21 10:06:36] [EMAIL PROTECTED]
The problem doesn't have to do anything with serialize/unserialize but
with the way you store/load the serialized data. Can you tell us how?
And do you do any manual changes to the serialized data or even view it
with an external editor?
------------------------------------------------------------------------
[2003-08-21 07:59:27] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2003-08-21 05:14:42] cpuidle at gmx dot de
Description:
------------
I'm using serialize to write array structures to the filesystem. After
reading the structure again, unserialize fails to decode and returns 0
instead. Serialized sample data is included. The problem is fixed when
the two larger data blocks are removed and replaced with samething
without linebreaks- not sure if that's part of the problem.
Reproduce code:
---------------
http://www.cpuidle.de/serialized.txt
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25185&edit=1