$29 GRAYBYTE WORDPRESS FILE MANAGER $65

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.216.51
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cpanel/ea-wappspector/src/Matchers/

HOME
Current File : /opt/cpanel/ea-wappspector/src/Matchers//Drupal.php
<?php

namespace Plesk\Wappspector\Matchers;

use League\Flysystem\Filesystem;
use League\Flysystem\FilesystemException;
use Plesk\Wappspector\MatchResult\Drupal as MatchResult;
use Plesk\Wappspector\MatchResult\EmptyMatchResult;
use Plesk\Wappspector\MatchResult\MatchResultInterface;

class Drupal implements MatcherInterface
{
    /**
     * Drupal has changed the way how the version number is stored multiple times, so we need this comprehensive array
     */
    private const VERSIONS = [
        [
            'file' => '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;
    }
}

Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
15 May 2026 8.30 AM
root / root
0755
CakePHP.php
1.021 KB
14 May 2026 3.20 PM
root / root
0644
CodeIgniter.php
1.136 KB
14 May 2026 3.20 PM
root / root
0644
Composer.php
1.089 KB
14 May 2026 3.20 PM
root / root
0644
DotNet.php
1.054 KB
14 May 2026 3.20 PM
root / root
0644
Drupal.php
1.626 KB
14 May 2026 3.20 PM
root / root
0644
Duda.php
1.72 KB
14 May 2026 3.20 PM
root / root
0644
Joomla.php
3.788 KB
14 May 2026 3.20 PM
root / root
0644
Laravel.php
1.9 KB
14 May 2026 3.20 PM
root / root
0644
MatcherInterface.php
0.335 KB
14 May 2026 3.20 PM
root / root
0644
NodeJs.php
0.846 KB
14 May 2026 3.20 PM
root / root
0644
Php.php
1.07 KB
14 May 2026 3.20 PM
root / root
0644
Prestashop.php
1.409 KB
14 May 2026 3.20 PM
root / root
0644
Python.php
0.725 KB
14 May 2026 3.20 PM
root / root
0644
Ruby.php
0.696 KB
14 May 2026 3.20 PM
root / root
0644
Sitejet.php
0.953 KB
14 May 2026 3.20 PM
root / root
0644
Siteplus.php
1.791 KB
14 May 2026 3.20 PM
root / root
0644
Sitepro.php
0.957 KB
14 May 2026 3.20 PM
root / root
0644
Symfony.php
0.884 KB
14 May 2026 3.20 PM
root / root
0644
Typo3.php
1.768 KB
14 May 2026 3.20 PM
root / root
0644
UpLevelMatcherTrait.php
0.959 KB
14 May 2026 3.20 PM
root / root
0644
WebPresenceBuilder.php
1.969 KB
14 May 2026 3.20 PM
root / root
0644
Wordpress.php
1.477 KB
14 May 2026 3.20 PM
root / root
0644
Yii.php
1.641 KB
14 May 2026 3.20 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF