PharExtensionInterceptor
in package
implements
Assertable
An alternate PharExtensionInterceptor to support phar-based CLI tools.
This is largely based on Drupal\Core\Security\PharExtensionInterceptor, originally licensed under GPL2+
Tags
Table of Contents
Interfaces
- Assertable
Methods
- assert() : bool
- Determines whether phar file is allowed to execute.
- baseFileContainsPharExtension() : bool
- Determines if a path has a .phar extension or invoked execution.
Methods
assert()
Determines whether phar file is allowed to execute.
public
assert(string $path, string $command) : bool
The phar file is allowed to execute if:
- the base file name has a ".phar" suffix.
- it is the CLI tool that has invoked the interceptor.
Parameters
- $path : string
-
The path of the phar file to check.
- $command : string
-
The command being carried out.
Tags
Return values
bool —TRUE if the phar file is allowed to execute.
baseFileContainsPharExtension()
Determines if a path has a .phar extension or invoked execution.
private
baseFileContainsPharExtension(string $path) : bool
Parameters
- $path : string
-
The path of the phar file to check.
Return values
bool —TRUE if the file has a .phar extension or if the execution has been invoked by the phar file.