disabledExtensions[] = $disabledExtension; } /** * @param mixed $isLoaded */ protected function requiresRestart($isLoaded): bool { $this->required = (bool) array_filter( $this->disabledExtensions, function (string $extension): bool { return extension_loaded($extension); } ); return $isLoaded || $this->required; } /** * @param mixed $command * * @return void */ protected function restart($command) { if ($this->required && $this->tmpIni) { $regex = '/^\s*(extension\s*=.*(' . implode('|', $this->disabledExtensions) . ').*)$/mi'; $content = file_get_contents($this->tmpIni); $content = preg_replace($regex, ';$1', $content); file_put_contents($this->tmpIni, $content); } /** @psalm-suppress MixedArgument */ parent::restart($command); } }