Permalink
Browse files

Cache was broken by namespaces

  • Loading branch information...
1 parent a863f66 commit defdc594ea69b799f8cfdca0a4a0dc6ad20feb80 @cdujeu cdujeu committed May 18, 2016
@@ -1,5 +1,10 @@
{
- "require": {
- "doctrine/cache": "*"
+ "require": {
+ "doctrine/cache": "*"
+ },
+ "autoload": {
+ "psr-4": {
+ "Pydio\\Plugins\\Cache\\Doctrine\\Ext\\": "../ext"
}
+ }
}
@@ -1,5 +1,5 @@
-Copyright (c) 2015 Nils Adermann, Jordi Boggiano
+Copyright (c) 2016 Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -6,4 +6,33 @@
$baseDir = dirname($vendorDir);
return array(
+ 'Doctrine\\Common\\Cache\\ApcCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php',
+ 'Doctrine\\Common\\Cache\\ApcuCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/ApcuCache.php',
+ 'Doctrine\\Common\\Cache\\ArrayCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php',
+ 'Doctrine\\Common\\Cache\\Cache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php',
+ 'Doctrine\\Common\\Cache\\CacheProvider' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php',
+ 'Doctrine\\Common\\Cache\\ChainCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/ChainCache.php',
+ 'Doctrine\\Common\\Cache\\ClearableCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php',
+ 'Doctrine\\Common\\Cache\\CouchbaseCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php',
+ 'Doctrine\\Common\\Cache\\FileCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php',
+ 'Doctrine\\Common\\Cache\\FilesystemCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php',
+ 'Doctrine\\Common\\Cache\\FlushableCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/FlushableCache.php',
+ 'Doctrine\\Common\\Cache\\MemcacheCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php',
+ 'Doctrine\\Common\\Cache\\MemcachedCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php',
+ 'Doctrine\\Common\\Cache\\MongoDBCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php',
+ 'Doctrine\\Common\\Cache\\MultiGetCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/MultiGetCache.php',
+ 'Doctrine\\Common\\Cache\\MultiPutCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php',
+ 'Doctrine\\Common\\Cache\\PhpFileCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php',
+ 'Doctrine\\Common\\Cache\\PredisCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/PredisCache.php',
+ 'Doctrine\\Common\\Cache\\RedisCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php',
+ 'Doctrine\\Common\\Cache\\RiakCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php',
+ 'Doctrine\\Common\\Cache\\SQLite3Cache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/SQLite3Cache.php',
+ 'Doctrine\\Common\\Cache\\Version' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/Version.php',
+ 'Doctrine\\Common\\Cache\\VoidCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/VoidCache.php',
+ 'Doctrine\\Common\\Cache\\WinCacheCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php',
+ 'Doctrine\\Common\\Cache\\XcacheCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php',
+ 'Doctrine\\Common\\Cache\\ZendDataCache' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php',
+ 'Pydio\\Plugins\\Cache\\Doctrine\\Ext\\PatternClearableCache' => $baseDir . '/../ext/PatternClearableCache.php',
+ 'Pydio\\Plugins\\Cache\\Doctrine\\Ext\\PydioApcuCache' => $baseDir . '/../ext/PydioApcuCache.php',
+ 'Pydio\\Plugins\\Cache\\Doctrine\\Ext\\PydioRedisCache' => $baseDir . '/../ext/PydioRedisCache.php',
);
@@ -6,5 +6,6 @@
$baseDir = dirname($vendorDir);
return array(
+ 'Pydio\\Plugins\\Cache\\Doctrine\\Ext\\' => array($baseDir . '/../ext'),
'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'),
);
@@ -23,19 +23,26 @@ public static function getLoader()
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit4bc137430010115d1364cb6bdd1d28d7', 'loadClassLoader'));
- $map = require __DIR__ . '/autoload_namespaces.php';
- foreach ($map as $namespace => $path) {
- $loader->set($namespace, $path);
- }
-
- $map = require __DIR__ . '/autoload_psr4.php';
- foreach ($map as $namespace => $path) {
- $loader->setPsr4($namespace, $path);
- }
-
- $classMap = require __DIR__ . '/autoload_classmap.php';
- if ($classMap) {
- $loader->addClassMap($classMap);
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
+ if ($useStaticLoader) {
+ require_once __DIR__ . '/autoload_static.php';
+
+ call_user_func(\Composer\Autoload\ComposerStaticInit4bc137430010115d1364cb6bdd1d28d7::getInitializer($loader));
+ } else {
+ $map = require __DIR__ . '/autoload_namespaces.php';
+ foreach ($map as $namespace => $path) {
+ $loader->set($namespace, $path);
+ }
+
+ $map = require __DIR__ . '/autoload_psr4.php';
+ foreach ($map as $namespace => $path) {
+ $loader->setPsr4($namespace, $path);
+ }
+
+ $classMap = require __DIR__ . '/autoload_classmap.php';
+ if ($classMap) {
+ $loader->addClassMap($classMap);
+ }
}
$loader->register(true);
@@ -29,6 +29,7 @@
use Pydio\Access\Core\Model\AJXP_Node;
use Pydio\Core\Services\AuthService;
use Pydio\Core\PluginFramework\Plugin;
+use Pydio\Plugins\Cache\Doctrine\Ext\PatternClearableCache;
/**
* @package AjaXplorer_Plugins
@@ -92,7 +93,7 @@ public static function computeIdForNode($node, $cacheType, $details = ''){
public function supportsPatternDelete($namespace)
{
$cacheDriver = $this->getCacheDriver($namespace);
- return $cacheDriver instanceof Pydio\Plugins\Cache\Doctrine\Ext\PatternClearableCache;
+ return $cacheDriver instanceof PatternClearableCache;
}
/**
@@ -102,7 +103,7 @@ public function supportsPatternDelete($namespace)
*/
public function deleteKeyStartingWith($namespace, $id){
$cacheDriver = $this->getCacheDriver($namespace);
- if(!($cacheDriver instanceof Pydio\Plugins\Cache\Doctrine\Ext\PatternClearableCache)){
+ if(!($cacheDriver instanceof PatternClearableCache)){
return false;
}
return $cacheDriver->deleteKeysStartingWith($id);
@@ -58,7 +58,7 @@ public function getCacheImpl()
}
self::$cacheInstance = $pluginInstance;
if($pluginInstance !== null && $pluginInstance instanceof AbstractCacheDriver && $pluginInstance->supportsPatternDelete(AJXP_CACHE_SERVICE_NS_NODES)){
- AJXP_MetaStreamWrapper::appendMetaWrapper("pydio.cache", "CacheStreamLayer");
+ AJXP_MetaStreamWrapper::appendMetaWrapper("pydio.cache", "\\Pydio\\Cache\\Core\\CacheStreamLayer");
}
}

0 comments on commit defdc59

Please sign in to comment.