Skip to content

Commit

Permalink
MDL-51374 cache: add temp_tables cache definition
Browse files Browse the repository at this point in the history
Also a helper method get_temp_tables_cache() has been created for temporary tables cache operations.
  • Loading branch information
lameze committed Mar 15, 2016
1 parent e8952c5 commit 26e7ece
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions lang/en/cache.php
Expand Up @@ -62,6 +62,7 @@
$string['cachedef_search_results'] = 'Search results user data';
$string['cachedef_string'] = 'Language string cache';
$string['cachedef_tags'] = 'Tags collections and areas';
$string['cachedef_temp_tables'] = 'Temporary tables cache';
$string['cachedef_userselections'] = 'Data used to persist user selections throughout Moodle';
$string['cachedef_yuimodules'] = 'YUI Module definitions';
$string['cachelock_file_default'] = 'Default file locking';
Expand Down
6 changes: 6 additions & 0 deletions lib/db/caches.php
Expand Up @@ -271,4 +271,10 @@
'staticaccelerationsize' => 3
),

// Store temporary tables information.
'temp_tables' => array(
'mode' => cache_store::MODE_REQUEST,
'simplekeys' => true
),

);
9 changes: 9 additions & 0 deletions lib/dml/moodle_database.php
Expand Up @@ -336,6 +336,15 @@ protected function get_metacache() {
return cache::make('core', 'databasemeta', $properties);
}

/**
* Handle the creation and caching of the temporary tables.
*
* @return cache_application The temp_tables cachestore to complete operations on.
*/
protected function get_temp_tables_cache() {
return cache::make('core', 'temp_tables');
}

/**
* Attempt to create the database
* @param string $dbhost The database host.
Expand Down

0 comments on commit 26e7ece

Please sign in to comment.