Public Member Functions | |
| __construct ($repoGroup) | |
| Construct a group of file repositories. | |
| addFiles ($files) | |
| Add some files to the cache. | |
| clearFiles ($remove) | |
| Remove some files from the cache, so that their existence will be rechecked. | |
| markNotFound ($dbkeys) | |
| Mark some DB keys as nonexistent. | |
| findFile ($title) | |
| Search the cache for a file. | |
| findFiles ($titles) | |
| Search the cache for multiple files. | |
Static Public Member Functions | |
| static | singleton () |
| Get a FileCache instance. | |
| static | destroySingleton () |
| Destroy the singleton instance, so that a new one will be created next time singleton() is called. | |
| static | setSingleton ($instance) |
| Set the singleton instance to a given object. | |
Public Attributes | |
| $repoGroup | |
| $cache = array() | |
| $notFound = array() | |
Static Protected Attributes | |
| static | $instance |
Loosely inspired by the LinkCache / LinkBatch classes for titles.
ISSUE: Merge with RepoGroup?
Definition at line 10 of file FileCache.php.
| FileCache::__construct | ( | $ | repoGroup | ) |
Construct a group of file repositories.
| RepoGroup | $repoGroup |
Definition at line 47 of file FileCache.php.
References $repoGroup.
| FileCache::addFiles | ( | $ | files | ) |
Add some files to the cache.
This is a fairly low-level function, which most users should not need to call. Note that any existing entries for the same keys will not be replaced. Call clearFiles() first if you need that.
| array | $files array of File objects, indexed by DB key |
Definition at line 59 of file FileCache.php.
References $files, and wfDebug().
Referenced by findFiles().
| FileCache::clearFiles | ( | $ | remove | ) |
Remove some files from the cache, so that their existence will be rechecked.
This is a fairly low-level function, which most users should not need to call.
| array | $remove array indexed by DB keys to remove (the values are ignored) |
Definition at line 70 of file FileCache.php.
References wfDebug().
| static FileCache::destroySingleton | ( | ) | [static] |
Destroy the singleton instance, so that a new one will be created next time singleton() is called.
Definition at line 32 of file FileCache.php.
Referenced by ParserTest::teardownGlobals().
| FileCache::findFile | ( | $ | title | ) |
Search the cache for a file.
| mixed | $title Title object or string |
Definition at line 93 of file FileCache.php.
References $file, $title, Title::makeTitleSafe(), and wfDebug().
| FileCache::findFiles | ( | $ | titles | ) |
Search the cache for multiple files.
| array | $titles Title objects or strings to search for |
Definition at line 128 of file FileCache.php.
References $result, $title, addFiles(), Title::makeTitleSafe(), markNotFound(), and wfDebug().
| FileCache::markNotFound | ( | $ | dbkeys | ) |
Mark some DB keys as nonexistent.
This is a fairly low-level function, which most users should not need to call.
| array | $dbkeys array of DB keys |
Definition at line 81 of file FileCache.php.
References wfDebug().
Referenced by findFiles().
| static FileCache::setSingleton | ( | $ | instance | ) | [static] |
Set the singleton instance to a given object.
Definition at line 39 of file FileCache.php.
References $instance.
| static FileCache::singleton | ( | ) | [static] |
Get a FileCache instance.
Typically, only one instance of FileCache is needed in a MediaWiki invocation.
Definition at line 20 of file FileCache.php.
References RepoGroup::singleton().
Referenced by wfFindFile().
| FileCache::$cache = array() |
Definition at line 12 of file FileCache.php.
FileCache::$instance [static, protected] |
| FileCache::$notFound = array() |
Definition at line 12 of file FileCache.php.
| FileCache::$repoGroup |
1.5.9