function PharExtensionInterceptor::assert

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

Determines whether the base file name has a ".phar" suffix.

Parameters

string $path:

string $command:

Return value

bool

Throws

Exception

Overrides Assertable::assert

File

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

Class

PharExtensionInterceptor

Namespace

TYPO3\PharStreamWrapper\Interceptor

Code

public function assert($path, $command) {
  if ($this->baseFileContainsPharExtension($path)) {
    return true;
  }
  throw new Exception(sprintf('Unexpected file extension in "%s"', $path), 1535198703);
}

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