mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
ENH Use class name instead of self
This commit is contained in:
parent
a26a5c05b0
commit
7149050147
@ -53,7 +53,7 @@ class Cache implements FileTextCache, Flushable
|
||||
public function load(File $file)
|
||||
{
|
||||
$key = $this->getKey($file);
|
||||
$cache = self::get_cache();
|
||||
$cache = Cache::get_cache();
|
||||
|
||||
return $cache->get($key);
|
||||
}
|
||||
@ -67,7 +67,7 @@ class Cache implements FileTextCache, Flushable
|
||||
{
|
||||
$lifetime = $this->config()->get('lifetime') ?: 3600;
|
||||
$key = $this->getKey($file);
|
||||
$cache = self::get_cache();
|
||||
$cache = Cache::get_cache();
|
||||
|
||||
return $cache->set($key, $content, $lifetime);
|
||||
}
|
||||
@ -77,7 +77,7 @@ class Cache implements FileTextCache, Flushable
|
||||
*/
|
||||
public static function flush()
|
||||
{
|
||||
$cache = self::get_cache();
|
||||
$cache = Cache::get_cache();
|
||||
$cache->clear();
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ class Cache implements FileTextCache, Flushable
|
||||
*/
|
||||
public static function clear()
|
||||
{
|
||||
$cache = self::get_cache();
|
||||
$cache = Cache::get_cache();
|
||||
$cache->clear();
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ class Cache implements FileTextCache, Flushable
|
||||
public function invalidate(File $file)
|
||||
{
|
||||
$key = $this->getKey($file);
|
||||
$cache = self::get_cache();
|
||||
$cache = Cache::get_cache();
|
||||
|
||||
return $cache->delete($key);
|
||||
}
|
||||
|
@ -43,8 +43,8 @@ abstract class FileTextExtractor
|
||||
protected static function get_extractor_classes()
|
||||
{
|
||||
// Check cache
|
||||
if (self::$sorted_extractor_classes) {
|
||||
return self::$sorted_extractor_classes;
|
||||
if (FileTextExtractor::$sorted_extractor_classes) {
|
||||
return FileTextExtractor::$sorted_extractor_classes;
|
||||
}
|
||||
|
||||
// Generate the sorted list of extractors on demand.
|
||||
@ -59,7 +59,7 @@ abstract class FileTextExtractor
|
||||
|
||||
// Save classes
|
||||
$sortedClasses = array_keys($classPriorities ?? []);
|
||||
return self::$sorted_extractor_classes = $sortedClasses;
|
||||
return FileTextExtractor::$sorted_extractor_classes = $sortedClasses;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -95,8 +95,8 @@ abstract class FileTextExtractor
|
||||
$extension = $file->getExtension();
|
||||
$mime = $file->getMimeType();
|
||||
|
||||
foreach (self::get_extractor_classes() as $className) {
|
||||
$extractor = self::get_extractor($className);
|
||||
foreach (FileTextExtractor::get_extractor_classes() as $className) {
|
||||
$extractor = FileTextExtractor::get_extractor($className);
|
||||
|
||||
// Skip unavailable extractors
|
||||
if (!$extractor->isAvailable()) {
|
||||
|
Loading…
Reference in New Issue
Block a user