Skip to content

[V5˖] Setup your own namespace

Georges.L edited this page Oct 16, 2016 · 5 revisions

As of the V5 you can set your own namespace, allowing you by this way to fully override existing drivers:

use phpFastCache\CacheManager;

$yourNamespacePath = 'Somewhere\In\Your\Project';

CacheManager::setNamespacePath($yourNamespacePath);
$itemPool = CacheManager::Files([]);// Will return the following object:

if($itemPool instanceof \Somewhere\In\Your\Project\Files\Driver){
   // This code will return true
}

Please note CacheManager::setNamespacePath() requires to be a fully qualified name to avoid any bug.

Clone this wiki locally