TYPO3\Surf\Task\Php\WebOpcacheResetCreateScriptTask

class WebOpcacheResetCreateScriptTask

Create a script to reset the PHP opcache.

The task creates a temporary script (locally in the release workspace directory) for resetting the PHP opcache in a later web request. A secondary task will execute an HTTP request and thus execute the script.

The opcache reset has to be done in the webserver process, so a simple CLI command would not help.

It takes the following options:

  • scriptBasePath (optional) - The path where the script should be created. Default is <Workspace Path>/Web.
  • scriptIdentifier (optional) - The name of the script. Default is a random string.
Example:
$workflow
->setTaskOptions(‘TYPO3SurfTaskPhpWebOpcacheResetCreateScriptTask’, [
‘scriptBasePath’ => ‘/var/www/outerspace’, ‘scriptIdentifier’ => ‘eraseAllHumans’

]

);

property shell

protected ShellCommandService

__construct(RandomBytesGeneratorInterface $randomBytesGenerator = null, FilesystemInterface $filesystem = null)

WebOpcacheResetCreateScriptTask constructor.

Parameters:
execute(Node $node, Application $application, Deployment $deployment, $options = [])

Execute this task

Parameters:
  • $node (Node) –
  • $application (Application) –
  • $deployment (Deployment) –
  • $options (array) – Supported options: “scriptBasePath” and “scriptIdentifier”
resolveOptions(OptionsResolver $resolver)
Parameters:
  • $resolver (OptionsResolver) –
setShellCommandService(ShellCommandService $shellCommandService)
Parameters:
rollback(Node $node, Application $application, Deployment $deployment, $options = [])

Rollback this task

Parameters:
simulate(Node $node, Application $application, Deployment $deployment, $options = [])

Simulate this task (e.g. by logging commands it would execute)

Parameters:
configureOptions($options = [])
Parameters:
  • $options (array) –
Returns:

array