-
-
Notifications
You must be signed in to change notification settings - Fork 453
[V5˖] Migrating your code to the V6
Georges.L edited this page Oct 16, 2016
·
6 revisions
Because the V6 is not backward compatible with the V5 we will help you to migrate your code:
Driver instances used to implements a phpFastCache\Cache\ExtendedCacheItemPoolInterface
interface.
namespace My\Custom\Project;
$instance = CacheManager::getInstance('Files');
if($instance instanceof \phpFastCache\Cache\ExtendedCacheItemPoolInterface)
{
// Some code
}
This has been changed and they now implements a phpFastCache\Core\Pool\ExtendedCacheItemPoolInterface
interface
namespace My\Custom\Project;
$instance = CacheManager::getInstance('Files');
if($instance instanceof \phpFastCache\Core\Pool\ExtendedCacheItemPoolInterface)
{
// Some code
}
Item instances used to implements a phpFastCache\Cache\ExtendedCacheItemInterface
interface.
namespace My\Custom\Project;
$instance = CacheManager::getInstance('Files');
$item = $instance->getItem('key');
if($item instanceof \phpFastCache\Cache\ExtendedCacheItemInterface)
{
// Some code
}
This has been changed and it now returns a phpFastCache\Core\Item\ExtendedCacheItemInterface
interface
namespace My\Custom\Project;
$instance = CacheManager::getInstance('Files');
$item = $instance->getItem('key');
if($item instanceof \phpFastCache\Core\Item\ExtendedCacheItemInterface)
{
// Some code
}
❓ Finally, if you need help, always check out the inevitable README.md