function PharExtensionInterceptor::baseFileContainsPharExtension

Same name in this branch
  1. 7.x misc/typo3/drupal-security/PharExtensionInterceptor.php \Drupal\Core\Security\PharExtensionInterceptor::baseFileContainsPharExtension()
Same name in other branches
  1. 9 core/lib/Drupal/Core/Security/PharExtensionInterceptor.php \Drupal\Core\Security\PharExtensionInterceptor::baseFileContainsPharExtension()
  2. 8.9.x core/lib/Drupal/Core/Security/PharExtensionInterceptor.php \Drupal\Core\Security\PharExtensionInterceptor::baseFileContainsPharExtension()

Parameters

string $path:

Return value

bool

1 call to PharExtensionInterceptor::baseFileContainsPharExtension()
PharExtensionInterceptor::assert in misc/typo3/phar-stream-wrapper/src/Interceptor/PharExtensionInterceptor.php
Determines whether the base file name has a ".phar" suffix.

File

misc/typo3/phar-stream-wrapper/src/Interceptor/PharExtensionInterceptor.php, line 46

Class

PharExtensionInterceptor

Namespace

TYPO3\PharStreamWrapper\Interceptor

Code

private function baseFileContainsPharExtension($path) {
    $invocation = Manager::instance()->resolve($path);
    if ($invocation === null) {
        return false;
    }
    $fileExtension = pathinfo($invocation->getBaseName(), PATHINFO_EXTENSION);
    return strtolower($fileExtension) === 'phar';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.