Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Fatal error storing objects in xcache adapter #58

Closed
kynx opened this issue Jan 9, 2016 · 4 comments
Closed

Fatal error storing objects in xcache adapter #58

kynx opened this issue Jan 9, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@kynx
Copy link
Contributor

kynx commented Jan 9, 2016

Fatal error: xcache_set(): Objects cannot be stored in the variable cache. Use serialize before xcache_set in /Users/matt/www/httpd/zend-cache/src/Storage/Adapter/XCache.php on line 348

As the docs say:

Warning : At the moment, It is not possible to store resources, callbacks or objects using xcache_* functions.

Looks the adapter needs to have "object" => false in it's supportedDatatypes options and also throw an exception instead of fatal error. I'm using xcache 3.2.0.

BTW, xcache > 3.1.0 does support CLI, so there's no need to skip the tests for stuff like this. I'll do a PR.

@kynx
Copy link
Contributor Author

kynx commented Jan 9, 2016

Oh lordy, looks like namespaces are broken too:

$ TESTS_ZEND_CACHE_XCACHE_ENABLED=1 phpunit test/Storage/Adapter/XCacheTest.php 
PHPUnit 4.8.9 by Sebastian Bergmann and contributors.

.................S.......F.FF...............................S.... 65 / 72 ( 90%)
..SSS..

Time: 19.46 seconds, Memory: 16.50Mb

There were 3 failures:

1) ZendTest\Cache\Storage\Adapter\XCacheTest::testGetMetadatasWithEmptyNamespace
Failed asserting that 0 is identical to 2.

/Users/matt/www/httpd/zend-cache/test/Storage/Adapter/CommonAdapterTest.php:391
/Users/matt/www/httpd/zend-cache/test/Storage/Adapter/CommonAdapterTest.php:407

2) ZendTest\Cache\Storage\Adapter\XCacheTest::testSetGetHasAndRemoveItemWithoutNamespace
Failed asserting that null matches expected 'value'.

/Users/matt/www/httpd/zend-cache/test/Storage/Adapter/CommonAdapterTest.php:423

3) ZendTest\Cache\Storage\Adapter\XCacheTest::testSetGetHasAndRemoveItemsWithoutNamespace
Failed asserting that an array has the key 'key1'.

/Users/matt/www/httpd/zend-cache/test/Storage/Adapter/CommonAdapterTest.php:446

@kynx kynx mentioned this issue Jan 9, 2016
@marc-mabe
Copy link
Member

Ohhh it looks like they removed the serializing support and they have problems keeping the extension up-to-date. (Could be because of less of interest as with opcache and apcu exists a much more common approach)

Can you add a PR as hotfix and I will think about how to make the tests run in travis.

In my opinion we could also think about deprecating this adapter.

@marc-mabe
Copy link
Member

WTF Why is that a fatal error :(

@kynx
Copy link
Contributor Author

kynx commented Jan 9, 2016

Got me there ;)

Is #59 OK or would you rather I did a new hotfix/58 PR with just the fixes for storing objects and namespaces?

@marc-mabe marc-mabe added the bug label Feb 12, 2016
@marc-mabe marc-mabe added this to the 2.6.2 milestone Feb 12, 2016
@marc-mabe marc-mabe self-assigned this Feb 12, 2016
@marc-mabe marc-mabe modified the milestones: 2.7.0, 2.6.2 Apr 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants