PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
| Dir : /opt/cpanel/ea-wappspector/src/Matchers/ |
| Server: Linux host100322.itwesthosting.com 3.10.0-1160.144.1.el7.tuxcare.els4.x86_64 #1 SMP Tue Apr 7 08:40:40 UTC 2026 x86_64 IP: 144.91.64.173 |
| Dir : //opt/cpanel/ea-wappspector/src/Matchers/Prestashop.php |
<?php
namespace Plesk\Wappspector\Matchers;
use League\Flysystem\Filesystem;
use League\Flysystem\FilesystemException;
use Plesk\Wappspector\MatchResult\EmptyMatchResult;
use Plesk\Wappspector\MatchResult\MatchResultInterface;
use Plesk\Wappspector\MatchResult\Prestashop as MatchResult;
class Prestashop implements MatcherInterface
{
protected const VERSIONS = [
[
'filename' => '/config/settings.inc.php',
'regexp' => '/define\\(\'_PS_VERSION_\', \'(.+)\'\\)/',
],
];
/**
* @throws FilesystemException
*/
public function match(Filesystem $fs, string $path): MatchResultInterface
{
foreach (self::VERSIONS as $version) {
$versionFile = rtrim($path, '/') . '/' . $version['filename'];
if (!$fs->fileExists($versionFile)) {
continue;
}
return new MatchResult($path, $this->getVersion($version, $fs, $versionFile));
}
return new EmptyMatchResult();
}
public function getVersion(array $version, Filesystem $fs, string $versionFile): ?string
{
$result = null;
try {
if (preg_match($version['regexp'], $fs->read($versionFile), $matches) && count($matches) > 1) {
$result = $matches[1];
}
} catch (FilesystemException) {
// ignore filesystem extensions
}
return $result;
}
}