Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Notice: unserialize() [function.unserialize]: Error at offset #268
Try to find out why there are some data corruption.
PHPPREFIX . base64_encode(gzdeflate(serialize($this->_data))) . PHPSUFFIX
$this->_data = unserialize( gzinflate( base64_decode( substr( file_get_contents($this->dataFile), strlen(PHPPREFIX), -strlen(PHPSUFFIX) ) ) ) );
The problem is that php seems to fail to serialize the data.
I didn't read all the source or the way you coded it, but it seems that you're not using any locking mechanism.
EDIT : it seems that file_put_contents has a flag named "LOCK_EX", maybe it's an easier solution.
I've thought about that but the strange thing is that the data is well written meaning for me that it's not linked to a concurrent access to the file. Actually, it's possible to unzip and decode the file. The problem occurs when unserializing the data.
while it should look like this :
I don't know if it's possible that this is effectively link to LOCK