Models metadata in PHP 7 and Phalcon 3.0.2

Hello, since APC and XCache have been deprecated in PHP 7, what model caching strategy should I use at the production stage with PHP 7 and Phalcon 3.0.2?



2.8k
edited Apr '17

According to the docs, you have 5 adapter options;

  • Memory
  • Session
  • Apc
  • XCache
  • Files

Since options 3 and 4 are deprecated and option 1 is reccomended only for development, you're left with Files and Session. Both are fine, but I'd choose Files due to not always wanting sessions active in my application - so it seems what's best to use in your existing set-up/use case.

would apcu_bc be compatible with Phalcon\Mvc\Model\MetaData\Apc?



2.8k
edited Apr '17

That is just a backwards compatible library and "there is no appreciable difference" and "this layer calls the same internal (to apc) functions that APCu does", so there's no point as you'd still be calling the same thing that Phalcon\Mvc\Model\MetaData\Apc is calling, thus still deprecated.

But to answer your question directory, no, I don't think so.

Note: I've never used APC so I could be 100% wrong though.

would apcu_bc be compatible with Phalcon\Mvc\Model\MetaData\Apc?

edited Apr '17

There is more, just docs not updated as always:

Class Phalcon\Mvc\Model\MetaData\Apc
Class Phalcon\Mvc\Model\MetaData\Files
Class Phalcon\Mvc\Model\MetaData\Libmemcached
Class Phalcon\Mvc\Model\MetaData\Memcache
Class Phalcon\Mvc\Model\MetaData\Memory
Class Phalcon\Mvc\Model\MetaData\Redis
Class Phalcon\Mvc\Model\MetaData\Session
Class Phalcon\Mvc\Model\MetaData\Xcache