From 6fec18203b59dd6aa3df35888fdef8085bd5737b Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Mon, 17 Sep 2012 10:04:47 +1200 Subject: [PATCH] MDL-25290 cache: Renamed plugin from cache => cachestore --- admin/settings/plugins.php | 4 +- cache/classes/config.php | 4 +- cache/classes/dummystore.php | 4 +- cache/classes/factory.php | 4 +- cache/classes/helper.php | 8 +-- cache/classes/loaders.php | 2 +- cache/classes/lock.php | 5 +- cache/forms.php | 2 +- cache/lib.php | 9 +++ cache/locallib.php | 60 +++++++++---------- cache/renderer.php | 2 +- cache/stores/file/addinstanceform.php | 16 ++--- .../{cache_file.php => cachestore_file.php} | 2 +- cache/stores/file/lib.php | 12 ++-- cache/stores/file/version.php | 4 +- cache/stores/memcache/addinstanceform.php | 8 +-- ...e_memcache.php => cachestore_memcache.php} | 2 +- cache/stores/memcache/lib.php | 8 +-- cache/stores/memcache/settings.php | 4 +- cache/stores/memcache/version.php | 4 +- cache/stores/memcached/addinstanceform.php | 28 ++++----- ...memcached.php => cachestore_memcached.php} | 2 +- cache/stores/memcached/lib.php | 32 +++++----- cache/stores/memcached/settings.php | 4 +- cache/stores/memcached/version.php | 4 +- cache/stores/mongodb/addinstanceform.php | 36 +++++------ ...che_mongodb.php => cachestore_mongodb.php} | 2 +- cache/stores/mongodb/lib.php | 8 +-- cache/stores/mongodb/settings.php | 4 +- cache/stores/mongodb/version.php | 4 +- ...che_session.php => cachestore_session.php} | 2 +- cache/stores/session/lib.php | 12 ++-- cache/stores/session/version.php | 4 +- ...cache_static.php => cachestore_static.php} | 2 +- cache/stores/static/lib.php | 6 +- cache/stores/static/version.php | 4 +- cache/testperformance.php | 8 +-- cache/tests/cache_test.php | 4 +- lib/moodlelib.php | 2 +- lib/setup.php | 2 +- 40 files changed, 172 insertions(+), 162 deletions(-) rename cache/stores/file/lang/en/{cache_file.php => cachestore_file.php} (98%) rename cache/stores/memcache/lang/en/{cache_memcache.php => cachestore_memcache.php} (98%) rename cache/stores/memcached/lang/en/{cache_memcached.php => cachestore_memcached.php} (99%) rename cache/stores/mongodb/lang/en/{cache_mongodb.php => cachestore_mongodb.php} (98%) rename cache/stores/session/lang/en/{cache_session.php => cachestore_session.php} (97%) rename cache/stores/static/lang/en/{cache_static.php => cachestore_static.php} (97%) diff --git a/admin/settings/plugins.php b/admin/settings/plugins.php index 41a22ff60ab..c2b2b2280b5 100644 --- a/admin/settings/plugins.php +++ b/admin/settings/plugins.php @@ -498,10 +498,10 @@ if ($hassiteconfig) { $ADMIN->add('cache', new admin_externalpage('cacheconfig', new lang_string('cacheconfig', 'cache'), $CFG->wwwroot .'/cache/admin.php')); $ADMIN->add('cache', new admin_externalpage('cachetestperformance', new lang_string('testperformance', 'cache'), $CFG->wwwroot . '/cache/testperformance.php')); $ADMIN->add('cache', new admin_category('cachestores', new lang_string('cachestores', 'cache'))); - foreach (get_plugin_list('cache') as $plugin => $path) { + foreach (get_plugin_list('cachestore') as $plugin => $path) { $settingspath = $path.'/settings.php'; if (file_exists($settingspath)) { - $settings = new admin_settingpage('cache_'.$plugin.'_settings', new lang_string('pluginname', 'cache_'.$plugin), 'moodle/site:config'); + $settings = new admin_settingpage('cachestore_'.$plugin.'_settings', new lang_string('pluginname', 'cachestore_'.$plugin), 'moodle/site:config'); include($settingspath); $ADMIN->add('cachestores', $settings); } diff --git a/cache/classes/config.php b/cache/classes/config.php index b9fd7f74b65..be09cdc102f 100644 --- a/cache/classes/config.php +++ b/cache/classes/config.php @@ -126,7 +126,7 @@ class cache_config { continue; } $plugin = $store['plugin']; - $class = 'cache_store_'.$plugin; + $class = 'cachestore_'.$plugin; if (!array_key_exists($plugin, $availableplugins) && (!class_exists($class) || !is_subclass_of($class, 'cache_store'))) { // Not a valid plugin, or has been uninstalled, just skip it an carry on. debugging('Invalid cache store in config. Not an available plugin.', DEBUG_DEVELOPER); @@ -327,7 +327,7 @@ class cache_config { if (defined('NO_CACHE_STORES') && NO_CACHE_STORES !== false) { // Yip its been disabled. // To facilitate this we are going to always return an empty array of stores to use. - // This will force all cache instances to use the cache_store_dummy. + // This will force all cache instances to use the cachestore_dummy. // MUC will still be used essentially so that code using it will still continue to function but because no cache stores // are being used interaction with MUC will be purely based around a static var. return array(); diff --git a/cache/classes/dummystore.php b/cache/classes/dummystore.php index d49dbe10354..ca6a806ac0b 100644 --- a/cache/classes/dummystore.php +++ b/cache/classes/dummystore.php @@ -37,7 +37,7 @@ defined('MOODLE_INTERNAL') || die(); * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class cache_store_dummy implements cache_store { +class cachestore_dummy implements cache_store { /** * The name of this store. @@ -262,7 +262,7 @@ class cache_store_dummy implements cache_store { * @return false */ public static function initialise_test_instance(cache_definition $definition) { - $cache = new cache_store_dummy('Dummy store test'); + $cache = new cachestore_dummy('Dummy store test'); $cache->initialise($definition); return $cache;; } diff --git a/cache/classes/factory.php b/cache/classes/factory.php index def9f999d1a..7fc69837d21 100644 --- a/cache/classes/factory.php +++ b/cache/classes/factory.php @@ -295,12 +295,12 @@ class cache_factory { * Creates a dummy store object for use when a loader has no potential stores to use. * * @param cache_definition $definition - * @return cache_store_dummy + * @return cachestore_dummy */ protected function create_dummy_store(cache_definition $definition) { global $CFG; require_once($CFG->dirroot.'/cache/classes/dummystore.php'); - $store = new cache_store_dummy(); + $store = new cachestore_dummy(); $store->initialise($definition); return $store; } diff --git a/cache/classes/helper.php b/cache/classes/helper.php index b118e8e6078..18901728c4c 100644 --- a/cache/classes/helper.php +++ b/cache/classes/helper.php @@ -127,7 +127,7 @@ class cache_helper { public static function get_cache_stores(cache_definition $definition) { $instance = cache_config::instance(); $stores = $instance->get_stores_for_definition($definition); - $stores = self::initialise_cache_store_instances($stores, $definition); + $stores = self::initialise_cachestore_instances($stores, $definition); return $stores; } @@ -138,7 +138,7 @@ class cache_helper { * @param cache_definition $definition * @return array */ - protected static function initialise_cache_store_instances(array $stores, cache_definition $definition) { + protected static function initialise_cachestore_instances(array $stores, cache_definition $definition) { $return = array(); $factory = cache_factory::instance(); foreach ($stores as $name => $details) { @@ -154,14 +154,14 @@ class cache_helper { * Returns the cache store to be used for locking or false if there is not one. * @return cache_store|boolean */ - public static function get_cache_store_for_locking() { + public static function get_cachestore_for_locking() { $factory = cache_factory::instance(); $definition = $factory->create_definition('core', 'locking'); $instance = cache_config::instance(); $stores = $instance->get_stores_for_definition($definition); foreach ($stores as $name => $details) { if ($details['useforlocking']) { - $instances = self::initialise_cache_store_instances(array($name => $details), $definition); + $instances = self::initialise_cachestore_instances(array($name => $details), $definition); return reset($instances); } } diff --git a/cache/classes/loaders.php b/cache/classes/loaders.php index 935ce63b14b..299b7894689 100644 --- a/cache/classes/loaders.php +++ b/cache/classes/loaders.php @@ -1083,7 +1083,7 @@ class cache_application extends cache implements cache_loader_with_locking { */ protected function ensure_lock_store_available() { if ($this->lockstore === null) { - $this->lockstore = cache_helper::get_cache_store_for_locking(); + $this->lockstore = cache_helper::get_cachestore_for_locking(); } } diff --git a/cache/classes/lock.php b/cache/classes/lock.php index 195f5fa17fa..4c8e4f791a7 100644 --- a/cache/classes/lock.php +++ b/cache/classes/lock.php @@ -115,6 +115,7 @@ class cache_lock { * Returns an instance of the cache lock class. * * @staticvar bool $instance + * @param bool $forceregeneration * @return cache_lock */ protected static function instance($forceregeneration = false) { @@ -157,7 +158,7 @@ class cache_lock { /** * Acquires a lock, of dies trying (jokes). * - * Read {@see cache_lock::lock()} for full details. + * Read {@link cache_lock::lock()} for full details. * * @param string $key * @param bool $block @@ -216,7 +217,7 @@ class cache_lock { /** * Releases an acquired lock. * - * For more details see {@see cache_lock::unlock()} + * For more details see {@link cache_lock::unlock()} * * @param string $key * @param bool $forceunlock If set to true the lock will be removed if it exists regardless of whether or not we own it. diff --git a/cache/forms.php b/cache/forms.php index 488e9997b12..b6c014f472d 100644 --- a/cache/forms.php +++ b/cache/forms.php @@ -37,7 +37,7 @@ require_once($CFG->dirroot.'/lib/formslib.php'); * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class cache_store_addinstance_form extends moodleform { +class cachestore_addinstance_form extends moodleform { /** * The definition of the add instance form diff --git a/cache/lib.php b/cache/lib.php index e92e56afe54..059993d7a02 100644 --- a/cache/lib.php +++ b/cache/lib.php @@ -135,6 +135,15 @@ class cache_ttl_wrapper { * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class cache_exception extends moodle_exception { + /** + * Constructs a new exception + * + * @param string $errorcode + * @param string $module + * @param string $link + * @param mixed $a + * @param mixed $debuginfo + */ public function __construct($errorcode, $module = 'cache', $link = '', $a = NULL, $debuginfo = null) { parent::__construct($errorcode, $module, $link, $a, $debuginfo); } diff --git a/cache/locallib.php b/cache/locallib.php index e9f134a25da..8c4bf59f844 100644 --- a/cache/locallib.php +++ b/cache/locallib.php @@ -105,9 +105,9 @@ class cache_config_writer extends cache_config { if (array_key_exists($name, $this->configstores)) { throw new cache_exception('Duplicate name specificed for cache plugin instance. You must provide a unique name.'); } - $class = 'cache_store_'.$plugin; + $class = 'cachestore_'.$plugin; if (!class_exists($class)) { - $plugins = get_plugin_list_with_file('cache', 'lib.php'); + $plugins = get_plugin_list_with_file('cachestore', 'lib.php'); if (!array_key_exists($plugin, $plugins)) { throw new cache_exception('Invalid plugin name specified. The plugin either does not exist or is not a valid cache plugin.'); } @@ -202,11 +202,11 @@ class cache_config_writer extends cache_config { if (!array_key_exists($name, $this->configstores)) { throw new cache_exception('The requested instance does not exist.'); } - $plugins = get_plugin_list_with_file('cache', 'lib.php'); + $plugins = get_plugin_list_with_file('cachestore', 'lib.php'); if (!array_key_exists($plugin, $plugins)) { throw new cache_exception('Invalid plugin name specified. The plugin either does not exist or is not valid.'); } - $class = 'cache_store_.'.$plugin; + $class = 'cachestore_.'.$plugin; $file = $plugins[$plugin]; if (!class_exists($class)) { if (file_exists($file)) { @@ -283,39 +283,39 @@ class cache_config_writer extends cache_config { 'name' => 'default_locking', 'plugin' => 'file', 'configuration' => array(), - 'features' => cache_store_file::get_supported_features(), + 'features' => cachestore_file::get_supported_features(), 'modes' => cache_store::MODE_APPLICATION, 'useforlocking' => true, 'mappingsonly' => true, 'default' => true, - //'class' => 'cache_store_file' + //'class' => 'cachestore_file' ), 'default_application' => array( 'name' => 'default_application', 'plugin' => 'file', 'configuration' => array(), - 'features' => cache_store_file::get_supported_features(), + 'features' => cachestore_file::get_supported_features(), 'modes' => cache_store::MODE_APPLICATION, 'default' => true, - //'class' => 'cache_store_file' + //'class' => 'cachestore_file' ), 'default_session' => array( 'name' => 'default_session', 'plugin' => 'session', 'configuration' => array(), - 'features' => cache_store_session::get_supported_features(), + 'features' => cachestore_session::get_supported_features(), 'modes' => cache_store::MODE_SESSION, 'default' => true, - //'class' => 'cache_store_session' + //'class' => 'cachestore_session' ), 'default_request' => array( 'name' => 'default_request', 'plugin' => 'static', 'configuration' => array(), - 'features' => cache_store_static::get_supported_features(), + 'features' => cachestore_static::get_supported_features(), 'modes' => cache_store::MODE_REQUEST, 'default' => true, - //'class' => 'cache_store_static' + //'class' => 'cachestore_static' ) ); $writer->configdefinitions = self::locate_definitions(); @@ -539,11 +539,11 @@ abstract class cache_administration_helper extends cache_helper { */ public static function get_plugin_summaries() { $return = array(); - $plugins = get_plugin_list_with_file('cache', 'lib.php', true); + $plugins = get_plugin_list_with_file('cachestore', 'lib.php', true); foreach ($plugins as $plugin => $path) { - $class = 'cache_store_'.$plugin; + $class = 'cachestore_'.$plugin; $return[$plugin] = array( - 'name' => get_string('pluginname', 'cache_'.$plugin), + 'name' => get_string('pluginname', 'cachestore_'.$plugin), 'requirementsmet' => $class::are_requirements_met(), 'instances' => 0, 'modes' => array( @@ -710,19 +710,19 @@ abstract class cache_administration_helper extends cache_helper { * Returns a form that can be used to add a store instance. * * @param string $plugin The plugin to add an instance of - * @return cache_store_addinstance_form + * @return cachestore_addinstance_form * @throws coding_exception */ public static function get_add_store_form($plugin) { global $CFG; // Needed for includes - $plugindir = get_plugin_directory('cache', $plugin); - $class = 'cache_store_addinstance_form'; + $plugindir = get_plugin_directory('cachestore', $plugin); + $class = 'cachestore_addinstance_form'; if (file_exists($plugindir.'/addinstanceform.php')) { require_once($plugindir.'/addinstanceform.php'); - if (class_exists('cache_store_'.$plugin.'_addinstance_form')) { - $class = 'cache_store_'.$plugin.'_addinstance_form'; - if (!array_key_exists('cache_store_addinstance_form', class_parents($class))) { - throw new coding_exception('Cache plugin add instance forms must extend cache_store_addinstance_form'); + if (class_exists('cachestore_'.$plugin.'_addinstance_form')) { + $class = 'cachestore_'.$plugin.'_addinstance_form'; + if (!array_key_exists('cachestore_addinstance_form', class_parents($class))) { + throw new coding_exception('Cache plugin add instance forms must extend cachestore_addinstance_form'); } } } @@ -736,19 +736,19 @@ abstract class cache_administration_helper extends cache_helper { * * @param string $plugin * @param string $store - * @return cache_store_addinstance_form + * @return cachestore_addinstance_form * @throws coding_exception */ public static function get_edit_store_form($plugin, $store) { global $CFG; // Needed for includes - $plugindir = get_plugin_directory('cache', $plugin); - $class = 'cache_store_addinstance_form'; + $plugindir = get_plugin_directory('cachestore', $plugin); + $class = 'cachestore_addinstance_form'; if (file_exists($plugindir.'/addinstanceform.php')) { require_once($plugindir.'/addinstanceform.php'); - if (class_exists('cache_store_'.$plugin.'_addinstance_form')) { - $class = 'cache_store_'.$plugin.'_addinstance_form'; - if (!array_key_exists('cache_store_addinstance_form', class_parents($class))) { - throw new coding_exception('Cache plugin add instance forms must extend cache_store_addinstance_form'); + if (class_exists('cachestore_'.$plugin.'_addinstance_form')) { + $class = 'cachestore_'.$plugin.'_addinstance_form'; + if (!array_key_exists('cachestore_addinstance_form', class_parents($class))) { + throw new coding_exception('Cache plugin add instance forms must extend cachestore_addinstance_form'); } } } @@ -772,7 +772,7 @@ abstract class cache_administration_helper extends cache_helper { throw new coding_exception('Invalid cache plugin provided. '.$file); } require_once($file); - $class = 'cache_store_'.$data->plugin; + $class = 'cachestore_'.$data->plugin; $method = 'config_get_configuration_array'; if (!class_exists($class)) { throw new coding_exception('Invalid cache plugin provided.'); diff --git a/cache/renderer.php b/cache/renderer.php index bf96d94b021..95f999b0040 100644 --- a/cache/renderer.php +++ b/cache/renderer.php @@ -100,7 +100,7 @@ class core_cache_renderer extends plugin_renderer_base { $row = new html_table_row(array( $storename, - get_string('pluginname', 'cache_'.$store['plugin']), + get_string('pluginname', 'cachestore_'.$store['plugin']), ($store['isready'] && $store['requirementsmet']) ? $this->output->pix_icon('i/tick_green_small', '1') : '', $store['mappings'], join(', ', $modes), diff --git a/cache/stores/file/addinstanceform.php b/cache/stores/file/addinstanceform.php index 532c3c553a6..a5e3125e801 100644 --- a/cache/stores/file/addinstanceform.php +++ b/cache/stores/file/addinstanceform.php @@ -20,7 +20,7 @@ * This file is part of the file cache store, it contains the API for interacting with an instance of the store. * This is used as a default cache store within the Cache API. It should never be deleted. * - * @package cache_file + * @package cachestore_file * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -35,7 +35,7 @@ require_once($CFG->dirroot.'/cache/stores/file/lib.php'); * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class cache_store_file_addinstance_form extends cache_store_addinstance_form { +class cachestore_file_addinstance_form extends cachestore_addinstance_form { /** * Adds the desired form elements. @@ -43,17 +43,17 @@ class cache_store_file_addinstance_form extends cache_store_addinstance_form { protected function configuration_definition() { $form = $this->_form; - $form->addElement('text', 'path', get_string('path', 'cache_file')); + $form->addElement('text', 'path', get_string('path', 'cachestore_file')); $form->setType('path', PARAM_SAFEPATH); - $form->addHelpButton('path', 'path', 'cache_file'); + $form->addHelpButton('path', 'path', 'cachestore_file'); - $form->addElement('checkbox', 'autocreate', get_string('autocreate', 'cache_file')); + $form->addElement('checkbox', 'autocreate', get_string('autocreate', 'cachestore_file')); $form->setType('autocreate', PARAM_BOOL); - $form->addHelpButton('autocreate', 'autocreate', 'cache_file'); + $form->addHelpButton('autocreate', 'autocreate', 'cachestore_file'); $form->disabledIf('autocreate', 'path', 'eq', ''); - $form->addElement('checkbox', 'prescan', get_string('prescan', 'cache_file')); + $form->addElement('checkbox', 'prescan', get_string('prescan', 'cachestore_file')); $form->setType('prescan', PARAM_BOOL); - $form->addHelpButton('prescan', 'prescan', 'cache_file'); + $form->addHelpButton('prescan', 'prescan', 'cachestore_file'); } } \ No newline at end of file diff --git a/cache/stores/file/lang/en/cache_file.php b/cache/stores/file/lang/en/cachestore_file.php similarity index 98% rename from cache/stores/file/lang/en/cache_file.php rename to cache/stores/file/lang/en/cachestore_file.php index 1a3204041f2..8a17b71f95a 100644 --- a/cache/stores/file/lang/en/cache_file.php +++ b/cache/stores/file/lang/en/cachestore_file.php @@ -20,7 +20,7 @@ * This file is part of the file cache store, it contains the API for interacting with an instance of the store. * This is used as a default cache store within the Cache API. It should never be deleted. * - * @package cache_file + * @package cachestore_file * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later diff --git a/cache/stores/file/lib.php b/cache/stores/file/lib.php index dc6d298b7a4..c124948e74e 100644 --- a/cache/stores/file/lib.php +++ b/cache/stores/file/lib.php @@ -20,7 +20,7 @@ * This file is part of the file cache store, it contains the API for interacting with an instance of the store. * This is used as a default cache store within the Cache API. It should never be deleted. * - * @package cache_file + * @package cachestore_file * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -37,7 +37,7 @@ * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class cache_store_file implements cache_store, cache_is_lockable, cache_is_key_aware { +class cachestore_file implements cache_store, cache_is_lockable, cache_is_key_aware { /** * The name of the store. @@ -124,7 +124,7 @@ class cache_store_file implements cache_store, cache_is_lockable, cache_is_key_a debugging('The given file cache store path is not writable. '.$path, DEBUG_DEVELOPER); } } else { - $path = make_cache_directory('cache_store_file/'.preg_replace('#[^a-zA-Z0-9\.\-_]+#', '', $name)); + $path = make_cache_directory('cachestore_file/'.preg_replace('#[^a-zA-Z0-9\.\-_]+#', '', $name)); } $this->isready = $path !== false; $this->path = $path; @@ -581,12 +581,12 @@ class cache_store_file implements cache_store, cache_is_lockable, cache_is_key_a * Returns an instance of the cache store, or false if one cannot be created. * * @param cache_definition $definition - * @return cache_store_file + * @return cachestore_file */ public static function initialise_test_instance(cache_definition $definition) { $name = 'File test'; - $path = make_cache_directory('cache_store_file_test'); - $cache = new cache_store_file($name, array('path' => $path)); + $path = make_cache_directory('cachestore_file_test'); + $cache = new cachestore_file($name, array('path' => $path)); $cache->initialise($definition); return $cache; } diff --git a/cache/stores/file/version.php b/cache/stores/file/version.php index b92d50eccb0..5b701b93a08 100644 --- a/cache/stores/file/version.php +++ b/cache/stores/file/version.php @@ -19,7 +19,7 @@ * * This is used as a default cache store within the Cache API. It should never be deleted. * - * @package cache_file + * @package cachestore_file * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -29,4 +29,4 @@ defined('MOODLE_INTERNAL') || die; $plugin->version = 2012091000; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2012090700; // Requires this Moodle version -$plugin->component = 'cache_file'; // Full name of the plugin (used for diagnostics) \ No newline at end of file +$plugin->component = 'cachestore_file'; // Full name of the plugin (used for diagnostics) \ No newline at end of file diff --git a/cache/stores/memcache/addinstanceform.php b/cache/stores/memcache/addinstanceform.php index 74fc3bf9c72..deb4c9b0f9b 100644 --- a/cache/stores/memcache/addinstanceform.php +++ b/cache/stores/memcache/addinstanceform.php @@ -19,7 +19,7 @@ * * This file is part of the memcache cache store, it contains the API for interacting with an instance of the store. * - * @package cache_memcache + * @package cachestore_memcache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -35,15 +35,15 @@ require_once($CFG->dirroot.'/cache/stores/memcached/lib.php'); * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class cache_store_memcache_addinstance_form extends cache_store_addinstance_form { +class cachestore_memcache_addinstance_form extends cachestore_addinstance_form { /** * Add the desired form elements. */ protected function configuration_definition() { $form = $this->_form; - $form->addElement('textarea', 'servers', get_string('servers', 'cache_memcache'), array('cols' => 75, 'rows' => 5)); - $form->addHelpButton('servers', 'servers', 'cache_memcache'); + $form->addElement('textarea', 'servers', get_string('servers', 'cachestore_memcache'), array('cols' => 75, 'rows' => 5)); + $form->addHelpButton('servers', 'servers', 'cachestore_memcache'); $form->addRule('servers', get_string('required'), 'required'); $form->setType('servers', PARAM_RAW); } diff --git a/cache/stores/memcache/lang/en/cache_memcache.php b/cache/stores/memcache/lang/en/cachestore_memcache.php similarity index 98% rename from cache/stores/memcache/lang/en/cache_memcache.php rename to cache/stores/memcache/lang/en/cachestore_memcache.php index e4ae26ebdf4..585fd53773c 100644 --- a/cache/stores/memcache/lang/en/cache_memcache.php +++ b/cache/stores/memcache/lang/en/cachestore_memcache.php @@ -19,7 +19,7 @@ * * This file is part of the memcache cache store, it contains the API for interacting with an instance of the store. * - * @package cache_memcache + * @package cachestore_memcache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/cache/stores/memcache/lib.php b/cache/stores/memcache/lib.php index 5da6d2f0b8b..c21d64eea4c 100644 --- a/cache/stores/memcache/lib.php +++ b/cache/stores/memcache/lib.php @@ -19,7 +19,7 @@ * * This file is part of the memcache cache store, it contains the API for interacting with an instance of the store. * - * @package cache_memcache + * @package cachestore_memcache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -37,7 +37,7 @@ defined('MOODLE_INTERNAL') || die(); * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class cache_store_memcache implements cache_store { +class cachestore_memcache implements cache_store { /** * The name of the store @@ -349,7 +349,7 @@ class cache_store_memcache implements cache_store { return false; } - $config = get_config('cache_memcache'); + $config = get_config('cachestore_memcache'); if (empty($config->testservers)) { return false; } @@ -357,7 +357,7 @@ class cache_store_memcache implements cache_store { $configuration = array(); $configuration['servers'] = explode("\n", $config->testservers); - $store = new cache_store_memcache('Test memcache', $configuration); + $store = new cachestore_memcache('Test memcache', $configuration); $store->initialise($definition); return $store; diff --git a/cache/stores/memcache/settings.php b/cache/stores/memcache/settings.php index f6ef5643ecb..013b8bea3fa 100644 --- a/cache/stores/memcache/settings.php +++ b/cache/stores/memcache/settings.php @@ -19,11 +19,11 @@ * * This file is part of the memcache cache store, it contains the API for interacting with an instance of the store. * - * @package cache_memcache + * @package cachestore_memcache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; -$settings->add(new admin_setting_configtextarea('cache_memcache/testservers', new lang_string('testservers', 'cache_memcache'), new lang_string('testservers_desc', 'cache_memcache'), '', PARAM_RAW, 60, 3)); \ No newline at end of file +$settings->add(new admin_setting_configtextarea('cachestore_memcache/testservers', new lang_string('testservers', 'cachestore_memcache'), new lang_string('testservers_desc', 'cachestore_memcache'), '', PARAM_RAW, 60, 3)); \ No newline at end of file diff --git a/cache/stores/memcache/version.php b/cache/stores/memcache/version.php index 4996e4f5f37..b1d10b0485f 100644 --- a/cache/stores/memcache/version.php +++ b/cache/stores/memcache/version.php @@ -19,7 +19,7 @@ * * Not to be confused with the memcached plugin. * - * @package cache_memcache + * @package cachestore_memcache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -28,4 +28,4 @@ defined('MOODLE_INTERNAL') || die; $plugin->version = 2012091000; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2012090700; // Requires this Moodle version -$plugin->component = 'cache_memcache'; // Full name of the plugin (used for diagnostics) \ No newline at end of file +$plugin->component = 'cachestore_memcache'; // Full name of the plugin (used for diagnostics) \ No newline at end of file diff --git a/cache/stores/memcached/addinstanceform.php b/cache/stores/memcached/addinstanceform.php index af707e44df2..a05d1c3c60b 100644 --- a/cache/stores/memcached/addinstanceform.php +++ b/cache/stores/memcached/addinstanceform.php @@ -19,7 +19,7 @@ * * This file is part of the memcached cache store, it contains the API for interacting with an instance of the store. * - * @package cache_memcached + * @package cachestore_memcached * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -35,7 +35,7 @@ require_once($CFG->dirroot.'/cache/stores/memcached/lib.php'); * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class cache_store_memcached_addinstance_form extends cache_store_addinstance_form { +class cachestore_memcached_addinstance_form extends cachestore_addinstance_form { /** * Adds the desired form elements. @@ -43,33 +43,33 @@ class cache_store_memcached_addinstance_form extends cache_store_addinstance_for protected function configuration_definition() { $form = $this->_form; - $form->addElement('textarea', 'servers', get_string('servers', 'cache_memcached'), array('cols' => 75, 'rows' => 5)); - $form->addHelpButton('servers', 'servers', 'cache_memcached'); + $form->addElement('textarea', 'servers', get_string('servers', 'cachestore_memcached'), array('cols' => 75, 'rows' => 5)); + $form->addHelpButton('servers', 'servers', 'cachestore_memcached'); $form->addRule('servers', get_string('required'), 'required'); $form->setType('servers', PARAM_RAW); - $form->addElement('selectyesno', 'compression', get_string('usecompression', 'cache_memcached')); - $form->addHelpButton('compression', 'usecompression', 'cache_memcached'); + $form->addElement('selectyesno', 'compression', get_string('usecompression', 'cachestore_memcached')); + $form->addHelpButton('compression', 'usecompression', 'cachestore_memcached'); $form->setDefault('compression', 1); $form->setType('compression', PARAM_BOOL); - $form->addElement('select', 'serialiser', get_string('useserialiser', 'cache_memcached'), cache_store_memcached::config_get_serialiser_options()); - $form->addHelpButton('serialiser', 'useserialiser', 'cache_memcached'); + $form->addElement('select', 'serialiser', get_string('useserialiser', 'cachestore_memcached'), cachestore_memcached::config_get_serialiser_options()); + $form->addHelpButton('serialiser', 'useserialiser', 'cachestore_memcached'); $form->setDefault('serialiser', Memcached::SERIALIZER_PHP); $form->setType('serialiser', PARAM_NUMBER); - $form->addElement('text', 'prefix', get_string('prefix', 'cache_memcached'), array('size' => 16)); + $form->addElement('text', 'prefix', get_string('prefix', 'cachestore_memcached'), array('size' => 16)); $form->setType('prefix', PARAM_ALPHANUM); - $form->addHelpButton('prefix', 'prefix', 'cache_memcached'); + $form->addHelpButton('prefix', 'prefix', 'cachestore_memcached'); - $form->addElement('select', 'hash', get_string('hash', 'cache_memcached'), cache_store_memcached::config_get_hash_options()); - $form->addHelpButton('hash', 'hash', 'cache_memcached'); + $form->addElement('select', 'hash', get_string('hash', 'cachestore_memcached'), cachestore_memcached::config_get_hash_options()); + $form->addHelpButton('hash', 'hash', 'cachestore_memcached'); $form->setDefault('serialiser', Memcached::HASH_DEFAULT); $form->setType('serialiser', PARAM_INT); - $form->addElement('selectyesno', 'bufferwrites', get_string('bufferwrites', 'cache_memcached')); - $form->addHelpButton('bufferwrites', 'bufferwrites', 'cache_memcached'); + $form->addElement('selectyesno', 'bufferwrites', get_string('bufferwrites', 'cachestore_memcached')); + $form->addHelpButton('bufferwrites', 'bufferwrites', 'cachestore_memcached'); $form->setDefault('bufferwrites', 0); $form->setType('bufferwrites', PARAM_BOOL); } diff --git a/cache/stores/memcached/lang/en/cache_memcached.php b/cache/stores/memcached/lang/en/cachestore_memcached.php similarity index 99% rename from cache/stores/memcached/lang/en/cache_memcached.php rename to cache/stores/memcached/lang/en/cachestore_memcached.php index 8fe3798e491..67c3cd22ec2 100644 --- a/cache/stores/memcached/lang/en/cache_memcached.php +++ b/cache/stores/memcached/lang/en/cachestore_memcached.php @@ -19,7 +19,7 @@ * * This file is part of the memcached cache store, it contains the API for interacting with an instance of the store. * - * @package cache_memcached + * @package cachestore_memcached * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/cache/stores/memcached/lib.php b/cache/stores/memcached/lib.php index 6800a1969f5..770775510cc 100644 --- a/cache/stores/memcached/lib.php +++ b/cache/stores/memcached/lib.php @@ -19,7 +19,7 @@ * * This file is part of the memcached cache store, it contains the API for interacting with an instance of the store. * - * @package cache_memcached + * @package cachestore_memcached * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -43,7 +43,7 @@ defined('MOODLE_INTERNAL') || die(); * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class cache_store_memcached implements cache_store { +class cachestore_memcached implements cache_store { /** * The name of the store @@ -333,13 +333,13 @@ class cache_store_memcached implements cache_store { */ public static function config_get_serialiser_options() { $options = array( - Memcached::SERIALIZER_PHP => get_string('serialiser_php', 'cache_memcached') + Memcached::SERIALIZER_PHP => get_string('serialiser_php', 'cachestore_memcached') ); if (Memcached::HAVE_JSON) { - $options[Memcached::SERIALIZER_JSON] = get_string('serialiser_json', 'cache_memcached'); + $options[Memcached::SERIALIZER_JSON] = get_string('serialiser_json', 'cachestore_memcached'); } if (Memcached::HAVE_IGBINARY) { - $options[Memcached::SERIALIZER_IGBINARY] = get_string('serialiser_php', 'cache_memcached'); + $options[Memcached::SERIALIZER_IGBINARY] = get_string('serialiser_php', 'cachestore_memcached'); } return $options; } @@ -350,15 +350,15 @@ class cache_store_memcached implements cache_store { */ public static function config_get_hash_options() { $options = array( - Memcached::HASH_DEFAULT => get_string('hash_default', 'cache_memcached'), - Memcached::HASH_MD5 => get_string('hash_md5', 'cache_memcached'), - Memcached::HASH_CRC => get_string('hash_crc', 'cache_memcached'), - Memcached::HASH_FNV1_64 => get_string('hash_fnv1_64', 'cache_memcached'), - Memcached::HASH_FNV1A_64 => get_string('hash_fnv1a_64', 'cache_memcached'), - Memcached::HASH_FNV1_32 => get_string('hash_fnv1_32', 'cache_memcached'), - Memcached::HASH_FNV1A_32 => get_string('hash_fnv1a_32', 'cache_memcached'), - Memcached::HASH_HSIEH => get_string('hash_hsieh', 'cache_memcached'), - Memcached::HASH_MURMUR => get_string('hash_murmur', 'cache_memcached'), + Memcached::HASH_DEFAULT => get_string('hash_default', 'cachestore_memcached'), + Memcached::HASH_MD5 => get_string('hash_md5', 'cachestore_memcached'), + Memcached::HASH_CRC => get_string('hash_crc', 'cachestore_memcached'), + Memcached::HASH_FNV1_64 => get_string('hash_fnv1_64', 'cachestore_memcached'), + Memcached::HASH_FNV1A_64 => get_string('hash_fnv1a_64', 'cachestore_memcached'), + Memcached::HASH_FNV1_32 => get_string('hash_fnv1_32', 'cachestore_memcached'), + Memcached::HASH_FNV1A_32 => get_string('hash_fnv1a_32', 'cachestore_memcached'), + Memcached::HASH_HSIEH => get_string('hash_hsieh', 'cachestore_memcached'), + Memcached::HASH_MURMUR => get_string('hash_murmur', 'cachestore_memcached'), ); return $options; } @@ -414,7 +414,7 @@ class cache_store_memcached implements cache_store { return false; } - $config = get_config('cache_memcached'); + $config = get_config('cachestore_memcached'); if (empty($config->testservers)) { return false; } @@ -437,7 +437,7 @@ class cache_store_memcached implements cache_store { $configuration['bufferwrites'] = $config->testbufferwrites; } - $store = new cache_store_memcached('Test memcached', $configuration); + $store = new cachestore_memcached('Test memcached', $configuration); $store->initialise($definition); return $store; diff --git a/cache/stores/memcached/settings.php b/cache/stores/memcached/settings.php index 89f1ee1e3f0..89e7a6aaca3 100644 --- a/cache/stores/memcached/settings.php +++ b/cache/stores/memcached/settings.php @@ -19,11 +19,11 @@ * * This file is part of the memcached cache store, it contains the API for interacting with an instance of the store. * - * @package cache_memcached + * @package cachestore_memcached * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; -$settings->add(new admin_setting_configtextarea('cache_memcached/testservers', new lang_string('testservers', 'cache_memcached'), new lang_string('testservers_desc', 'cache_memcached'), '', PARAM_RAW, 60, 3)); \ No newline at end of file +$settings->add(new admin_setting_configtextarea('cachestore_memcached/testservers', new lang_string('testservers', 'cachestore_memcached'), new lang_string('testservers_desc', 'cachestore_memcached'), '', PARAM_RAW, 60, 3)); \ No newline at end of file diff --git a/cache/stores/memcached/version.php b/cache/stores/memcached/version.php index 28956d2bdf1..bc650313c68 100644 --- a/cache/stores/memcached/version.php +++ b/cache/stores/memcached/version.php @@ -19,7 +19,7 @@ * * Not to be confused with the memcache plugin. * - * @package cache_memcached + * @package cachestore_memcached * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -28,4 +28,4 @@ defined('MOODLE_INTERNAL') || die; $plugin->version = 2012091000; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2012090700; // Requires this Moodle version -$plugin->component = 'cache_memcached'; // Full name of the plugin (used for diagnostics) \ No newline at end of file +$plugin->component = 'cachestore_memcached'; // Full name of the plugin (used for diagnostics) \ No newline at end of file diff --git a/cache/stores/mongodb/addinstanceform.php b/cache/stores/mongodb/addinstanceform.php index fdd566823b3..8e71380ef91 100644 --- a/cache/stores/mongodb/addinstanceform.php +++ b/cache/stores/mongodb/addinstanceform.php @@ -26,7 +26,7 @@ * - usesafe * - extendedmode * - * @package cache_mongodb + * @package cachestore_mongodb * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -45,7 +45,7 @@ require_once($CFG->dirroot.'/cache/stores/mongodb/lib.php'); * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class cache_store_mongodb_addinstance_form extends cache_store_addinstance_form { +class cachestore_mongodb_addinstance_form extends cachestore_addinstance_form { /** * The forms custom definitions. @@ -53,45 +53,45 @@ class cache_store_mongodb_addinstance_form extends cache_store_addinstance_form protected function configuration_definition() { $form = $this->_form; - $form->addElement('text', 'server', get_string('server', 'cache_mongodb'), array('size' => 72)); - $form->addHelpButton('server', 'server', 'cache_mongodb'); + $form->addElement('text', 'server', get_string('server', 'cachestore_mongodb'), array('size' => 72)); + $form->addHelpButton('server', 'server', 'cachestore_mongodb'); $form->addRule('server', get_string('required'), 'required'); $form->setDefault('server', 'mongodb://127.0.0.1:27017'); $form->setType('server', PARAM_RAW); - $form->addElement('text', 'database', get_string('database', 'cache_mongodb')); - $form->addHelpButton('database', 'database', 'cache_mongodb'); + $form->addElement('text', 'database', get_string('database', 'cachestore_mongodb')); + $form->addHelpButton('database', 'database', 'cachestore_mongodb'); $form->addRule('database', get_string('required'), 'required'); $form->setType('database', PARAM_ALPHANUMEXT); $form->setDefault('database', 'mcache'); - $form->addElement('text', 'username', get_string('username', 'cache_mongodb')); - $form->addHelpButton('username', 'username', 'cache_mongodb'); + $form->addElement('text', 'username', get_string('username', 'cachestore_mongodb')); + $form->addHelpButton('username', 'username', 'cachestore_mongodb'); $form->setType('username', PARAM_ALPHANUMEXT); - $form->addElement('text', 'password', get_string('password', 'cache_mongodb')); - $form->addHelpButton('password', 'password', 'cache_mongodb'); + $form->addElement('text', 'password', get_string('password', 'cachestore_mongodb')); + $form->addHelpButton('password', 'password', 'cachestore_mongodb'); $form->setType('password', PARAM_TEXT); - $form->addElement('text', 'replicaset', get_string('replicaset', 'cache_mongodb')); - $form->addHelpButton('replicaset', 'replicaset', 'cache_mongodb'); + $form->addElement('text', 'replicaset', get_string('replicaset', 'cachestore_mongodb')); + $form->addHelpButton('replicaset', 'replicaset', 'cachestore_mongodb'); $form->setType('replicaset', PARAM_ALPHANUMEXT); $form->setAdvanced('replicaset'); - $form->addElement('checkbox', 'usesafe', get_string('usesafe', 'cache_mongodb')); - $form->addHelpButton('usesafe', 'usesafe', 'cache_mongodb'); + $form->addElement('checkbox', 'usesafe', get_string('usesafe', 'cachestore_mongodb')); + $form->addHelpButton('usesafe', 'usesafe', 'cachestore_mongodb'); $form->setDefault('usesafe', 1); $form->setAdvanced('usesafe'); $form->setType('usesafe', PARAM_BOOL); - $form->addElement('text', 'usesafevalue', get_string('usesafevalue', 'cache_mongodb')); - $form->addHelpButton('usesafevalue', 'usesafevalue', 'cache_mongodb'); + $form->addElement('text', 'usesafevalue', get_string('usesafevalue', 'cachestore_mongodb')); + $form->addHelpButton('usesafevalue', 'usesafevalue', 'cachestore_mongodb'); $form->disabledIf('usesafevalue', 'usesafe', 'notchecked'); $form->setType('usesafevalue', PARAM_INT); $form->setAdvanced('usesafevalue'); - $form->addElement('checkbox', 'extendedmode', get_string('extendedmode', 'cache_mongodb')); - $form->addHelpButton('extendedmode', 'extendedmode', 'cache_mongodb'); + $form->addElement('checkbox', 'extendedmode', get_string('extendedmode', 'cachestore_mongodb')); + $form->addHelpButton('extendedmode', 'extendedmode', 'cachestore_mongodb'); $form->setDefault('extendedmode', 0); $form->setAdvanced('extendedmode'); $form->setType('extendedmode', PARAM_BOOL); diff --git a/cache/stores/mongodb/lang/en/cache_mongodb.php b/cache/stores/mongodb/lang/en/cachestore_mongodb.php similarity index 98% rename from cache/stores/mongodb/lang/en/cache_mongodb.php rename to cache/stores/mongodb/lang/en/cachestore_mongodb.php index 77efaf9c5a9..cb1d765c966 100644 --- a/cache/stores/mongodb/lang/en/cache_mongodb.php +++ b/cache/stores/mongodb/lang/en/cachestore_mongodb.php @@ -17,7 +17,7 @@ /** * The language strings for the MongoDB store plugin. * - * @package cache_mongodb + * @package cachestore_mongodb * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/cache/stores/mongodb/lib.php b/cache/stores/mongodb/lib.php index 9b0ab40297b..7a6fca2e1a6 100644 --- a/cache/stores/mongodb/lib.php +++ b/cache/stores/mongodb/lib.php @@ -19,7 +19,7 @@ * * This file is part of the MongoDB store plugin, it contains the API for interacting with an instance of the store. * - * @package cache_mongodb + * @package cachestore_mongodb * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -37,7 +37,7 @@ defined('MOODLE_INTERNAL') || die(); * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class cache_store_mongodb implements cache_store { +class cachestore_mongodb implements cache_store { /** * The name of the store @@ -442,7 +442,7 @@ class cache_store_mongodb implements cache_store { return false; } - $config = get_config('cache_mongodb'); + $config = get_config('cachestore_mongodb'); if (empty($config->testserver)) { return false; } @@ -468,7 +468,7 @@ class cache_store_mongodb implements cache_store { $configuration['extendedmode'] = (bool)$config->testextendedmode; } - $store = new cache_store_mongodb('Test mongodb', $configuration); + $store = new cachestore_mongodb('Test mongodb', $configuration); $store->initialise($definition); return $store; diff --git a/cache/stores/mongodb/settings.php b/cache/stores/mongodb/settings.php index 0647ca4cbb3..2ffffa6c1a0 100644 --- a/cache/stores/mongodb/settings.php +++ b/cache/stores/mongodb/settings.php @@ -19,11 +19,11 @@ * * This file is part of the mongodb cache store, it contains the API for interacting with an instance of the store. * - * @package cache_mongodb + * @package cachestore_mongodb * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; -$settings->add(new admin_setting_configtextarea('cache_mongodb/testserver', new lang_string('testserver', 'cache_mongodb'), new lang_string('testserver_desc', 'cache_mongodb'), '', PARAM_RAW, 60, 3)); \ No newline at end of file +$settings->add(new admin_setting_configtextarea('cachestore_mongodb/testserver', new lang_string('testserver', 'cachestore_mongodb'), new lang_string('testserver_desc', 'cachestore_mongodb'), '', PARAM_RAW, 60, 3)); \ No newline at end of file diff --git a/cache/stores/mongodb/version.php b/cache/stores/mongodb/version.php index 77e51947254..c8989596f76 100644 --- a/cache/stores/mongodb/version.php +++ b/cache/stores/mongodb/version.php @@ -17,7 +17,7 @@ /** * Cache mongodb store version information. * - * @package cache_mongodb + * @package cachestore_mongodb * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -26,4 +26,4 @@ defined('MOODLE_INTERNAL') || die; $plugin->version = 2012091000; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2012090700; // Requires this Moodle version -$plugin->component = 'cache_mongodb'; // Full name of the plugin (used for diagnostics) \ No newline at end of file +$plugin->component = 'cachestore_mongodb'; // Full name of the plugin (used for diagnostics) \ No newline at end of file diff --git a/cache/stores/session/lang/en/cache_session.php b/cache/stores/session/lang/en/cachestore_session.php similarity index 97% rename from cache/stores/session/lang/en/cache_session.php rename to cache/stores/session/lang/en/cachestore_session.php index cb9fb59d100..80b9c810f2c 100644 --- a/cache/stores/session/lang/en/cache_session.php +++ b/cache/stores/session/lang/en/cachestore_session.php @@ -20,7 +20,7 @@ * This file is part of the session cache store, it contains the API for interacting with an instance of the store. * This is used as a default cache store within the Cache API. It should never be deleted. * - * @package cache_session + * @package cachestore_session * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later diff --git a/cache/stores/session/lib.php b/cache/stores/session/lib.php index df2ce2f3974..dfe205e662e 100644 --- a/cache/stores/session/lib.php +++ b/cache/stores/session/lib.php @@ -20,7 +20,7 @@ * This file is part of the session cache store, it contains the API for interacting with an instance of the store. * This is used as a default cache store within the Cache API. It should never be deleted. * - * @package cache_session + * @package cachestore_session * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -34,7 +34,7 @@ defined('MOODLE_INTERNAL') || die(); * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class cache_store_session extends session_data_store implements cache_store, cache_is_key_aware { +class cachestore_session extends session_data_store implements cache_store, cache_is_key_aware { /** * The name of the store @@ -358,7 +358,7 @@ class cache_store_session extends session_data_store implements cache_store, cac */ public static function initialise_test_instance(cache_definition $definition) { // Do something here perhaps. - $cache = new cache_store_session('Session test'); + $cache = new cachestore_session('Session test'); $cache->initialise($definition); return $cache; } @@ -387,10 +387,10 @@ abstract class session_data_store { protected static function ®ister_store_id($id) { if (is_null(self::$sessionstore)) { global $SESSION; - if (!isset($SESSION->cache_store_session)) { - $SESSION->cache_store_session = array(); + if (!isset($SESSION->cachestore_session)) { + $SESSION->cachestore_session = array(); } - self::$sessionstore =& $SESSION->cache_store_session; + self::$sessionstore =& $SESSION->cachestore_session; } if (!array_key_exists($id, self::$sessionstore)) { self::$sessionstore[$id] = array(); diff --git a/cache/stores/session/version.php b/cache/stores/session/version.php index 4bdbd190ca0..c24f47d13e9 100644 --- a/cache/stores/session/version.php +++ b/cache/stores/session/version.php @@ -19,7 +19,7 @@ * * This is used as a default cache store within the Cache API. It should never be deleted. * - * @package cache_session + * @package cachestore_session * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -29,4 +29,4 @@ defined('MOODLE_INTERNAL') || die; $plugin->version = 2012091000; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2012090700; // Requires this Moodle version -$plugin->component = 'cache_session'; // Full name of the plugin (used for diagnostics) \ No newline at end of file +$plugin->component = 'cachestore_session'; // Full name of the plugin (used for diagnostics) \ No newline at end of file diff --git a/cache/stores/static/lang/en/cache_static.php b/cache/stores/static/lang/en/cachestore_static.php similarity index 97% rename from cache/stores/static/lang/en/cache_static.php rename to cache/stores/static/lang/en/cachestore_static.php index e4e7db78d22..b43399998cb 100644 --- a/cache/stores/static/lang/en/cache_static.php +++ b/cache/stores/static/lang/en/cachestore_static.php @@ -20,7 +20,7 @@ * This file is part of the static cache store, it contains the API for interacting with an instance of the store. * This is used as a default cache store within the Cache API. It should never be deleted. * - * @package cache_static + * @package cachestore_static * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later diff --git a/cache/stores/static/lib.php b/cache/stores/static/lib.php index d19cb386363..2b252836aec 100644 --- a/cache/stores/static/lib.php +++ b/cache/stores/static/lib.php @@ -20,7 +20,7 @@ * This file is part of the static cache store, it contains the API for interacting with an instance of the store. * This is used as a default cache store within the Cache API. It should never be deleted. * - * @package cache_static + * @package cachestore_static * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -34,7 +34,7 @@ defined('MOODLE_INTERNAL') || die(); * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class cache_store_static extends static_data_store implements cache_store, cache_is_key_aware { +class cachestore_static extends static_data_store implements cache_store, cache_is_key_aware { /** * The name of the store @@ -358,7 +358,7 @@ class cache_store_static extends static_data_store implements cache_store, cache */ public static function initialise_test_instance(cache_definition $definition) { // Do something here perhaps. - $cache = new cache_store_static('Static store'); + $cache = new cachestore_static('Static store'); $cache->initialise($definition); return $cache;; } diff --git a/cache/stores/static/version.php b/cache/stores/static/version.php index 9a016846c71..7612715e7cd 100644 --- a/cache/stores/static/version.php +++ b/cache/stores/static/version.php @@ -19,7 +19,7 @@ * * This is used as a default cache store within the Cache API. It should never be deleted. * - * @package cache_static + * @package cachestore_static * @category cache * @copyright 2012 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -29,4 +29,4 @@ defined('MOODLE_INTERNAL') || die; $plugin->version = 2012091000; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2012090700; // Requires this Moodle version -$plugin->component = 'cache_static'; // Full name of the plugin (used for diagnostics) \ No newline at end of file +$plugin->component = 'cachestore_static'; // Full name of the plugin (used for diagnostics) \ No newline at end of file diff --git a/cache/testperformance.php b/cache/testperformance.php index 9b3b2325b4a..dc273ca7685 100644 --- a/cache/testperformance.php +++ b/cache/testperformance.php @@ -56,10 +56,10 @@ $strunsupportedmode = new lang_string('unsupportedmode', 'cache'); $struntestable = new lang_string('untestable', 'cache'); $strtested = new lang_string('tested', 'cache'); -foreach (get_plugin_list_with_file('cache', 'lib.php', true) as $plugin => $path) { +foreach (get_plugin_list_with_file('cachestore', 'lib.php', true) as $plugin => $path) { - $class = 'cache_store_'.$plugin; - $plugin = get_string('pluginname', 'cache_'.$plugin); + $class = 'cachestore_'.$plugin; + $plugin = get_string('pluginname', 'cachestore_'.$plugin); if (!class_exists($class) || !method_exists($class, 'initialise_test_instance')) { $applicationtable->data[] = array($plugin, $strinvalidplugin, '-', '-', '-', '-'); @@ -199,4 +199,4 @@ echo html_writer::table($sessiontable); echo $OUTPUT->heading(get_string('storeresults_request', 'cache')); echo html_writer::table($requesttable); -echo $OUTPUT->footer(); \ No newline at end of file +echo $OUTPUT->footer(); diff --git a/cache/tests/cache_test.php b/cache/tests/cache_test.php index 41a1ce5f548..810767d60d4 100644 --- a/cache/tests/cache_test.php +++ b/cache/tests/cache_test.php @@ -434,12 +434,12 @@ class cache_phpunit_tests extends advanced_testcase { // OK data added, data invalidated, and invalidation time has been set. // Now we need to manually add back the data and adjust the invalidation time. - $timefile = $CFG->dataroot.'/cache/cache_store_file/default_application/phpunit_eventinvalidationtest/494515064.cache'; + $timefile = $CFG->dataroot.'/cache/cachestore_file/default_application/phpunit_eventinvalidationtest/494515064.cache'; $timecont = serialize(cache::now() - 60); // Back 60sec in the past to force it to re-invalidate file_put_contents($timefile, $timecont); $this->assertTrue(file_exists($timefile)); - $datafile = $CFG->dataroot.'/cache/cache_store_file/default_application/phpunit_eventinvalidationtest/3140056538.cache'; + $datafile = $CFG->dataroot.'/cache/cachestore_file/default_application/phpunit_eventinvalidationtest/3140056538.cache'; $datacont = serialize("test data 1"); file_put_contents($datafile, $datacont); $this->assertTrue(file_exists($datafile)); diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 5ce0b52363c..3686a1358f2 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -8011,7 +8011,7 @@ function get_plugin_types($fullpaths=true) { 'qformat' => 'question/format', 'plagiarism' => 'plagiarism', 'tool' => $CFG->admin.'/tool', - 'cache' => 'cache/stores', + 'cachestore' => 'cache/stores', 'theme' => 'theme', // this is a bit hacky, themes may be in $CFG->themedir too ); diff --git a/lib/setup.php b/lib/setup.php index 7914283018c..2d48ad454d1 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -139,7 +139,7 @@ if (!defined('PHPUNIT_TEST')) { } // When set to true MUC (Moodle caching) will not use any of the defined or default stores. -// The Cache API will continue to function however this will force the use of the cache_store_dummy so all requests +// The Cache API will continue to function however this will force the use of the cachestore_dummy so all requests // will be interacting with a static property and will never go to the proper cache stores. // Useful if you need to avoid the stores for one reason or another. if (!defined('NO_CACHE_STORES')) {