Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
'modules/system/system.info',
'regex' => "/version\\s*=\\s*\"(\\d\\.[^']+)\"[\\s\\S]*project\\s*=\\s*\"drupal\"/",
],
[
'file' => 'core/modules/system/system.info.yml',
'regex' => "/version:\\s*'(\\d+\\.[^']+)'[\\s\\S]*project:\\s*'drupal'/",
],
];
/**
* @throws FilesystemException
*/
public function match(Filesystem $fs, string $path): MatchResultInterface
{
// Iterate through version patterns
foreach (self::VERSIONS as $version) {
$versionFile = rtrim($path, '/') . '/' . $version['file'];
if (!$fs->fileExists($versionFile)) {
continue;
}
$version = $this->detectVersion($version['regex'], $versionFile, $fs);
return new MatchResult($path, $version);
}
return new EmptyMatchResult();
}
private function detectVersion(string $regexPattern, string $versionFile, Filesystem $fs): ?string
{
preg_match($regexPattern, $fs->read($versionFile), $matches);
return count($matches) ? $matches[1] : null;
}
}