Merge branch '4.1' into 4

This commit is contained in:
github-actions 2024-06-19 23:43:45 +00:00
commit fce25f0f77
2 changed files with 10 additions and 10 deletions

View File

@ -53,7 +53,7 @@ class Cache implements FileTextCache, Flushable
public function load(File $file) public function load(File $file)
{ {
$key = $this->getKey($file); $key = $this->getKey($file);
$cache = self::get_cache(); $cache = Cache::get_cache();
return $cache->get($key); return $cache->get($key);
} }
@ -67,7 +67,7 @@ class Cache implements FileTextCache, Flushable
{ {
$lifetime = $this->config()->get('lifetime') ?: 3600; $lifetime = $this->config()->get('lifetime') ?: 3600;
$key = $this->getKey($file); $key = $this->getKey($file);
$cache = self::get_cache(); $cache = Cache::get_cache();
return $cache->set($key, $content, $lifetime); return $cache->set($key, $content, $lifetime);
} }
@ -77,7 +77,7 @@ class Cache implements FileTextCache, Flushable
*/ */
public static function flush() public static function flush()
{ {
$cache = self::get_cache(); $cache = Cache::get_cache();
$cache->clear(); $cache->clear();
} }
@ -88,7 +88,7 @@ class Cache implements FileTextCache, Flushable
*/ */
public static function clear() public static function clear()
{ {
$cache = self::get_cache(); $cache = Cache::get_cache();
$cache->clear(); $cache->clear();
} }
@ -100,7 +100,7 @@ class Cache implements FileTextCache, Flushable
public function invalidate(File $file) public function invalidate(File $file)
{ {
$key = $this->getKey($file); $key = $this->getKey($file);
$cache = self::get_cache(); $cache = Cache::get_cache();
return $cache->delete($key); return $cache->delete($key);
} }

View File

@ -43,8 +43,8 @@ abstract class FileTextExtractor
protected static function get_extractor_classes() protected static function get_extractor_classes()
{ {
// Check cache // Check cache
if (self::$sorted_extractor_classes) { if (FileTextExtractor::$sorted_extractor_classes) {
return self::$sorted_extractor_classes; return FileTextExtractor::$sorted_extractor_classes;
} }
// Generate the sorted list of extractors on demand. // Generate the sorted list of extractors on demand.
@ -59,7 +59,7 @@ abstract class FileTextExtractor
// Save classes // Save classes
$sortedClasses = array_keys($classPriorities ?? []); $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(); $extension = $file->getExtension();
$mime = $file->getMimeType(); $mime = $file->getMimeType();
foreach (self::get_extractor_classes() as $className) { foreach (FileTextExtractor::get_extractor_classes() as $className) {
$extractor = self::get_extractor($className); $extractor = FileTextExtractor::get_extractor($className);
// Skip unavailable extractors // Skip unavailable extractors
if (!$extractor->isAvailable()) { if (!$extractor->isAvailable()) {