Permalink
Browse files

Mv Pydio\Plugins\Cache to Pydio\Cache

  • Loading branch information...
1 parent 50ca28d commit 825d59ede8639e52c21ec365e44cb2e5ad3d5e14 @cdujeu cdujeu committed Jun 22, 2016
@@ -18,6 +18,7 @@
*
* The latest code can be found at <http://pyd.io/>.
*/
+namespace Pydio\Cache\Implementation;
defined('AJXP_EXEC') or die( 'Access not allowed');
@@ -34,7 +35,7 @@
use Pydio\Core\Model\ContextInterface;
use Pydio\Core\Utils\Utils;
use Pydio\Log\Core\AJXP_Logger;
-use \Pydio\Plugins\Cache\Doctrine\Ext;
+use Pydio\Cache\Doctrine\Ext;
/**
* Standard Memcache driver
@@ -107,6 +108,10 @@ public function init(ContextInterface $ctx, $options = [])
}
}
+ /**
+ * @param $namespace
+ * @return Cache\ApcCache|Cache\MemcacheCache|Cache\MemcachedCache|Cache\XcacheCache|null|Ext\PydioApcuCache|Ext\PydioRedisCache
+ */
private function initCacheWithNamespace($namespace){
$cacheDriver = null;
$emptyContext = \Pydio\Core\Model\Context::emptyContext();
@@ -150,6 +155,10 @@ private function initCacheWithNamespace($namespace){
}
+ /**
+ * @param $options
+ * @return Cache\ApcCache|Ext\PydioApcuCache
+ */
public function _apc_init($options) {
if (extension_loaded('apcu')) {
$cacheDriver = new Ext\PydioApcuCache();
@@ -159,8 +168,12 @@ public function _apc_init($options) {
return $cacheDriver;
}
+ /**
+ * @param $options
+ * @return Cache\MemcacheCache|null
+ */
public function _memcache_init($options) {
- $memcache = new Memcache();
+ $memcache = new \Memcache();
@$running = $memcache->connect($options['MEMCACHE_HOSTNAME'], $options['MEMCACHE_PORT']);
if (! $running) return null;
@@ -170,8 +183,12 @@ public function _memcache_init($options) {
return $cacheDriver;
}
+ /**
+ * @param $options
+ * @return Cache\MemcachedCache|null
+ */
public function _memcached_init($options) {
- $memcached = new Memcached();
+ $memcached = new \Memcached();
@$running = $memcached->addServer($options['MEMCACHED_HOSTNAME'], $options['MEMCACHED_PORT']);
if (! $running) return null;
@@ -181,8 +198,12 @@ public function _memcached_init($options) {
return $cacheDriver;
}
+ /**
+ * @param $options
+ * @return null|Ext\PydioRedisCache
+ */
public function _redis_init($options) {
- $redis = new Redis();
+ $redis = new \Redis();
@$running = $redis->connect($options['REDIS_HOSTNAME'], $options['REDIS_PORT']);
if (! $running) return null;
@@ -192,6 +213,10 @@ public function _redis_init($options) {
return $cacheDriver;
}
+ /**
+ * @param $options
+ * @return Cache\XcacheCache
+ */
public function _xcache_init($options) {
$cacheDriver = new Cache\XcacheCache();
return $cacheDriver;
@@ -4,7 +4,7 @@
},
"autoload": {
"psr-4": {
- "Pydio\\Plugins\\Cache\\Doctrine\\Ext\\": "./src"
+ "Pydio\\Cache\\Doctrine\\Ext\\": "./src"
}
}
}
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ajxp_plugin name="memcache" enabled="no" label="CONF_MESSAGE[Doctrine Cache driver]" description="CONF_MESSAGE[Use doctrine as main caching driver.]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
- <class_definition filename="plugins/cache.doctrine/class.DoctrineCacheDriver.php" classname="DoctrineCacheDriver"/>
+ <class_definition filename="plugins/cache.doctrine/DoctrineCacheDriver.php" classname="Pydio\Cache\Implementation\DoctrineCacheDriver"/>
<client_settings>
<resources>
<i18n namespace="doctrine_cachedriver" path="plugins/log.text/i18n"/>
@@ -18,10 +18,14 @@
*
* The latest code can be found at <http://pyd.io/>.
*/
-namespace Pydio\Plugins\Cache\Doctrine\Ext;
+namespace Pydio\Cache\Doctrine\Ext;
defined('AJXP_EXEC') or die('Access not allowed');
+/**
+ * Interface PatternClearableCache
+ * @package Pydio\Cache\Doctrine\Ext
+ */
interface PatternClearableCache{
/**
@@ -18,10 +18,14 @@
*
* The latest code can be found at <http://pyd.io/>.
*/
-namespace Pydio\Plugins\Cache\Doctrine\Ext;
+namespace Pydio\Cache\Doctrine\Ext;
defined('AJXP_EXEC') or die('Access not allowed');
+/**
+ * Class PydioApcuCache
+ * @package Pydio\Cache\Doctrine\Ext
+ */
class PydioApcuCache extends \Doctrine\Common\Cache\ApcuCache implements PatternClearableCache
{
protected $internalNamespace;
@@ -18,12 +18,16 @@
*
* The latest code can be found at <http://pyd.io/>.
*/
-namespace Pydio\Plugins\Cache\Doctrine\Ext;
+namespace Pydio\Cache\Doctrine\Ext;
defined('AJXP_EXEC') or die('Access not allowed');
use Redis;
+/**
+ * Class PydioRedisCache
+ * @package Pydio\Cache\Doctrine\Ext
+ */
class PydioRedisCache extends \Doctrine\Common\Cache\RedisCache implements PatternClearableCache
{
/**
@@ -34,6 +38,13 @@ class PydioRedisCache extends \Doctrine\Common\Cache\RedisCache implements Patte
protected $internalNamespaceVersion;
+ /**
+ * Sets the redis instance to use.
+ *
+ * @param Redis $redis
+ *
+ * @return void
+ */
public function setRedis($redis){
parent::setRedis($redis);
$this->internalRedis = $redis;
@@ -6,33 +6,4 @@
$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 . '/src/PatternClearableCache.php',
- 'Pydio\\Plugins\\Cache\\Doctrine\\Ext\\PydioApcuCache' => $baseDir . '/src/PydioApcuCache.php',
- 'Pydio\\Plugins\\Cache\\Doctrine\\Ext\\PydioRedisCache' => $baseDir . '/src/PydioRedisCache.php',
);
@@ -6,6 +6,6 @@
$baseDir = dirname($vendorDir);
return array(
- 'Pydio\\Plugins\\Cache\\Doctrine\\Ext\\' => array($baseDir . '/src'),
+ 'Pydio\\Cache\\Doctrine\\Ext\\' => array($baseDir . '/src'),
'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'),
);
@@ -9,7 +9,7 @@ class ComposerStaticInit4bc137430010115d1364cb6bdd1d28d7
public static $prefixLengthsPsr4 = array (
'P' =>
array (
- 'Pydio\\Plugins\\Cache\\Doctrine\\Ext\\' => 33,
+ 'Pydio\\Cache\\Doctrine\\Ext\\' => 25,
),
'D' =>
array (
@@ -18,7 +18,7 @@ class ComposerStaticInit4bc137430010115d1364cb6bdd1d28d7
);
public static $prefixDirsPsr4 = array (
- 'Pydio\\Plugins\\Cache\\Doctrine\\Ext\\' =>
+ 'Pydio\\Cache\\Doctrine\\Ext\\' =>
array (
0 => __DIR__ . '/../..' . '/src',
),
@@ -28,44 +28,11 @@ class ComposerStaticInit4bc137430010115d1364cb6bdd1d28d7
),
);
- public static $classMap = array (
- 'Doctrine\\Common\\Cache\\ApcCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php',
- 'Doctrine\\Common\\Cache\\ApcuCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/ApcuCache.php',
- 'Doctrine\\Common\\Cache\\ArrayCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php',
- 'Doctrine\\Common\\Cache\\Cache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php',
- 'Doctrine\\Common\\Cache\\CacheProvider' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php',
- 'Doctrine\\Common\\Cache\\ChainCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/ChainCache.php',
- 'Doctrine\\Common\\Cache\\ClearableCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php',
- 'Doctrine\\Common\\Cache\\CouchbaseCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php',
- 'Doctrine\\Common\\Cache\\FileCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php',
- 'Doctrine\\Common\\Cache\\FilesystemCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php',
- 'Doctrine\\Common\\Cache\\FlushableCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/FlushableCache.php',
- 'Doctrine\\Common\\Cache\\MemcacheCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php',
- 'Doctrine\\Common\\Cache\\MemcachedCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php',
- 'Doctrine\\Common\\Cache\\MongoDBCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php',
- 'Doctrine\\Common\\Cache\\MultiGetCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/MultiGetCache.php',
- 'Doctrine\\Common\\Cache\\MultiPutCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php',
- 'Doctrine\\Common\\Cache\\PhpFileCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php',
- 'Doctrine\\Common\\Cache\\PredisCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/PredisCache.php',
- 'Doctrine\\Common\\Cache\\RedisCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php',
- 'Doctrine\\Common\\Cache\\RiakCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php',
- 'Doctrine\\Common\\Cache\\SQLite3Cache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/SQLite3Cache.php',
- 'Doctrine\\Common\\Cache\\Version' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/Version.php',
- 'Doctrine\\Common\\Cache\\VoidCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/VoidCache.php',
- 'Doctrine\\Common\\Cache\\WinCacheCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php',
- 'Doctrine\\Common\\Cache\\XcacheCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php',
- 'Doctrine\\Common\\Cache\\ZendDataCache' => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php',
- 'Pydio\\Plugins\\Cache\\Doctrine\\Ext\\PatternClearableCache' => __DIR__ . '/../..' . '/src/PatternClearableCache.php',
- 'Pydio\\Plugins\\Cache\\Doctrine\\Ext\\PydioApcuCache' => __DIR__ . '/../..' . '/src/PydioApcuCache.php',
- 'Pydio\\Plugins\\Cache\\Doctrine\\Ext\\PydioRedisCache' => __DIR__ . '/../..' . '/src/PydioRedisCache.php',
- );
-
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit4bc137430010115d1364cb6bdd1d28d7::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit4bc137430010115d1364cb6bdd1d28d7::$prefixDirsPsr4;
- $loader->classMap = ComposerStaticInit4bc137430010115d1364cb6bdd1d28d7::$classMap;
}, null, ClassLoader::class);
}
@@ -30,7 +30,7 @@
use Pydio\Core\PluginFramework\Plugin;
-use Pydio\Plugins\Cache\Doctrine\Ext\PatternClearableCache;
+use Pydio\Cache\Doctrine\Ext\PatternClearableCache;
/**
* @package AjaXplorer_Plugins

0 comments on commit 825d59e

Please sign in to comment.