Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions redaxo/src/core/lib/clang/clang.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,14 @@ private static function checkCache()
}

$file = rex_path::coreCache('clang.cache');
if (!is_file($file)) {
rex_clang_service::generateCache();
$cache = rex_file::getCache($file);

// deliberately no is_file() check: a parallel cache clear could delete the file between check and read
if (!$cache) {
$cache = rex_clang_service::generateCache();
}
foreach (rex_file::getCache($file) as $id => $data) {

foreach ($cache as $id => $data) {
$clang = new self();
$clang->id = (int) $id;
$clang->priority = (int) $data['priority'];
Expand Down
4 changes: 3 additions & 1 deletion redaxo/src/core/lib/clang/service.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static function deleteCLang($id)
* Schreibt Spracheigenschaften in die Datei include/clang.php.
*
* @throws rex_exception
* @return void
* @return array<int, array<string, scalar|null>>
*/
public static function generateCache()
{
Expand All @@ -146,5 +146,7 @@ public static function generateCache()
if (!rex_file::putCache($file, $clangs)) {
throw new rex_exception('Clang cache file could not be generated');
}

return $clangs;
}
}