dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Call loadFromRow() as needed in Title::moveToInternal.
[lhc/web/wiklou.git]
/
includes
/
CacheHelper.php
diff --git
a/includes/CacheHelper.php
b/includes/CacheHelper.php
index
8199cb4
..
f0ae5a3
100644
(file)
--- a/
includes/CacheHelper.php
+++ b/
includes/CacheHelper.php
@@
-18,7
+18,7
@@
* http://www.gnu.org/copyleft/gpl.html
*
* @file
* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @licen
c
e GNU GPL v2 or later
+ * @licen
s
e GNU GPL v2 or later
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
@@
-143,10
+143,18
@@
class CacheHelper implements ICacheHelper {
* Function that gets called when initialization is done.
*
* @since 1.20
* Function that gets called when initialization is done.
*
* @since 1.20
- * @var
function
+ * @var
callable
*/
protected $onInitHandler = false;
*/
protected $onInitHandler = false;
+ /**
+ * Elements to build a cache key with.
+ *
+ * @since 1.20
+ * @var array
+ */
+ protected $cacheKey = array();
+
/**
* Sets if the cache should be enabled or not.
*
/**
* Sets if the cache should be enabled or not.
*
@@
-338,8
+346,13
@@
class CacheHelper implements ICacheHelper {
* @since 1.20
*
* @return string
* @since 1.20
*
* @return string
+ * @throws MWException
*/
protected function getCacheKeyString() {
*/
protected function getCacheKeyString() {
+ if ( $this->cacheKey === array() ) {
+ throw new MWException( 'No cache key set, so cannot obtain or save the CacheHelper values.' );
+ }
+
return call_user_func_array( 'wfMemcKey', $this->cacheKey );
}
return call_user_func_array( 'wfMemcKey', $this->cacheKey );
}