protected function runExtensionScript($script, array $arguments = [])
    {
        $this->log('d', 'Running custom extension script ' . $script . ' for extension ' . $this->getExtension()->getId());
        if (file_exists($script)) {
            require_once $script;
        } elseif (class_exists($script) && is_subclass_of($script, \oat\oatbox\action\Action::class)) {
            $action = new $script();

            if ($action instanceof ServiceLocatorAwareInterface) {
                $action->setServiceLocator($this->getServiceManager());
            }

            call_user_func($action, $arguments);
        } else {
            $error = new common_ext_InstallationException('Unable to run install script ' . $script);
            $error->setExtensionId($this->getExtension()->getId());

            throw $error;
        }
    }