Sets the correct permissions and group for the configured path.

@param InstallReleaseEvent      $event
@param string                   $eventName
@param EventDispatcherInterface $eventDispatcher

@throws TaskRuntimeException
778024
public function onInstallReleaseUpdateFilePermissions(InstallReleaseEvent $event, $eventName, EventDispatcherInterface $eventDispatcher)
    {
        $host = $event->getRelease()->getWorkspace()->getHost();
        $connection = $this->ensureConnection($host);

        $eventDispatcher->dispatch(AccompliEvents::LOG, new LogEvent(LogLevel::NOTICE, 'Updating permissions for the configured paths...', $eventName, $this, array('event.task.action' => TaskInterface::ACTION_IN_PROGRESS)));

        $releasePath = $event->getRelease()->getPath();

        $result = true;
        foreach ($this->paths as $path => $pathSettings) {
            $result = $result && $this->updateFilePermissions($connection, $releasePath, $path, $pathSettings);
        }

        if ($result === true) {
            $eventDispatcher->dispatch(AccompliEvents::LOG, new LogEvent(LogLevel::NOTICE, 'Updated permissions for the configured paths.', $eventName, $this, array('event.task.action' => TaskInterface::ACTION_COMPLETED, 'output.resetLine' => true)));
        } else {
            throw new TaskRuntimeException('Failed updating the permissions for the configured paths.', $this);
        }
    }
1110755
public function importCategoryChangePosition(UpdatePositionEvent $updatePositionEvent, $eventName, EventDispatcherInterface $dispatcher)
    {
        $this->handler->getCategory($updatePositionEvent->getObjectId(), true);
        $this->genericUpdatePosition(new ImportCategoryQuery, $updatePositionEvent, $dispatcher);
    }
830338
public function setEventDispatcher(EventDispatcherInterface $eventDispatcher)
	{
		$this->eventDispatcher = $eventDispatcher;
		$this->twig->setEventDispatcher($eventDispatcher);
	}
778266
public function setWorkflowStageToPublished(PublishEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supports($event)) {
            return;
        }

        $this->setWorkflowStage($document, $event->getAccessor(), WorkflowStage::PUBLISHED, $event->getLocale(), true);
    }
1225872
public function onInstallReleaseExecuteComposerInstall(InstallReleaseEvent $event, $eventName, EventDispatcherInterface $eventDispatcher)
    {
        $release = $event->getRelease();
        $host = $release->getWorkspace()->getHost();
        $connection = $this->ensureConnection($host);

        $eventDispatcher->dispatch(AccompliEvents::LOG, new LogEvent(LogLevel::NOTICE, 'Installing Composer dependencies.', $eventName, $this, array('event.task.action' => TaskInterface::ACTION_IN_PROGRESS)));

        $authenticationFile = $release->getPath().'/auth.json';
        if (empty($this->authentication) === false) {
            $connection->putContents($authenticationFile, json_encode($this->authentication));
        }

        $connection->changeWorkingDirectory($host->getPath());
        $result = $connection->executeCommand(sprintf('php composer.phar install --no-interaction --working-dir="%s" --no-dev --no-scripts --optimize-autoloader', $release->getPath()));

        if ($connection->isFile($authenticationFile)) {
            $connection->delete($authenticationFile);
        }

        if ($result->isSuccessful()) {
            $eventDispatcher->dispatch(AccompliEvents::LOG, new LogEvent(LogLevel::NOTICE, 'Installed Composer dependencies.', $eventName, $this, array('event.task.action' => TaskInterface::ACTION_COMPLETED, 'output.resetLine' => true)));
            $eventDispatcher->dispatch(AccompliEvents::LOG, new LogEvent(LogLevel::DEBUG, "{separator} Command output:{separator}\n{command.result}{separator}", $eventName, $this, array('command.result' => $result->getOutput(), 'separator' => "\n=================\n")));
        } else {
            throw new TaskCommandExecutionException('Failed installing Composer dependencies.', $result, $this);
        }
    }
1302231
public function triggerEvent($eventName, Event $event = null)
    {
        if (!$event) {
            $event = new Event;
        }

        $event->setTarget($this);

        return $this->eventDispatcher->dispatch($eventName, $event);
    }
1211576
public function update(TemplateUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== $template = TemplateQuery::create()->findPk($event->getTemplateId())) {
            $template
                ->setDispatcher($dispatcher)
                
                ->setLocale($event->getLocale())
                ->setName($event->getTemplateName())
                ->save();
            
            $event->setTemplate($template);
        }
    }
1293347
public function delete(CategoryDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== $category = CategoryQuery::create()->findPk($event->getCategoryId())) {
            $con = Propel::getWriteConnection(CategoryTableMap::DATABASE_NAME);
            $con->beginTransaction();

            try {
                $fileList = ['images' => [], 'documentList' => []];

                // Get category's files to delete after category deletion
                $fileList['images']['list'] = CategoryImageQuery::create()
                    ->findByCategoryId($event->getCategoryId());
                $fileList['images']['type'] = TheliaEvents::IMAGE_DELETE;

                $fileList['documentList']['list'] = CategoryDocumentQuery::create()
                    ->findByCategoryId($event->getCategoryId());
                $fileList['documentList']['type'] = TheliaEvents::DOCUMENT_DELETE;

                // Delete category
                $category
                    ->setDispatcher($dispatcher)
                    ->delete($con);

                $event->setCategory($category);

                // Dispatch delete category's files event
                foreach ($fileList as $fileTypeList) {
                    foreach ($fileTypeList['list'] as $fileToDelete) {
                        $fileDeleteEvent = new FileDeleteEvent($fileToDelete);
                        $dispatcher->dispatch($fileTypeList['type'], $fileDeleteEvent);
                    }
                }

                $con->commit();
            } catch (\Exception $e) {
                $con->rollback();
                throw $e;
            }
        }
    }
3764
public function clearAllCoupons(Event $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        // Tell coupons to clear any data they may have stored
        $this->couponManager->clear();

        $this->getSession()->setConsumedCoupons(array());

        $this->updateOrderDiscount($event, $eventName, $dispatcher);
    }
1158830
public function exportCategoryChangePosition(UpdatePositionEvent $updatePositionEvent, $eventName, EventDispatcherInterface $dispatcher)
    {
        $this->handler->getCategory($updatePositionEvent->getObjectId(), true);
        $this->genericUpdatePosition(new ExportCategoryQuery, $updatePositionEvent, $dispatcher);
    }
1318413
public function delete(ConfigDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== ($config = ConfigQuery::create()->findPk($event->getConfigId()))) {
            if (!$config->getSecured()) {
                $config->setDispatcher($dispatcher)->delete();

                $event->setConfig($config);
            }
        }
    }
824075
public function onQueueResponseListenerLoadContent(
        QueueResponseEvent $event,
        $eventName,
        EventDispatcherInterface $dispatcher
    ) {
        $content = $event->getContent();

        if (isset($GLOBALS['TL_LANG']['MSC']['con4gis']['queue'][$content])) {
            $event->setContent($GLOBALS['TL_LANG']['MSC']['con4gis']['queue'][$content]);
        }
    }
1182171
public function updateAttributePosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $this->genericUpdatePosition(AttributeTemplateQuery::create(), $event, $dispatcher);
    }
1189949
protected function dispatchJsonRpcEvent(string $eventName, JsonRpcServerEvent $event = null) : void
    {
        // Do nothing if dispatcher is not there
        if ($this->jsonRpcServerDispatcher) {
            $this->jsonRpcServerDispatcher->dispatchJsonRpcEvent($eventName, $event);
        }
    }
68728
public function viewCheck(ViewCheckEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if ($event->getView() == 'folder') {
            $folder = FolderQuery::create()
                ->filterById($event->getViewId())
                ->filterByVisible(1)
                ->count();

            if ($folder == 0) {
                $dispatcher->dispatch(TheliaEvents::VIEW_FOLDER_ID_NOT_VISIBLE, $event);
            }
        }
    }
810556
public static function setPermissions(Event $event)
    {
        $options = array_merge(
            array(
                self::PARAM_WRITABLE => array(),
                self::PARAM_EXECUTABLE => array(),
            ),
            $event->getComposer()->getPackage()->getExtra()
        );

        foreach ((array)$options[self::PARAM_WRITABLE] as $path) {
            echo "Setting writable: $path ...";
            if (is_dir($path)) {
                chmod($path, 0777);
                echo "done\n";
            } else {
                echo "The directory was not found: " . getcwd() . DIRECTORY_SEPARATOR . $path;
                return;
            }
        }

        foreach ((array)$options[self::PARAM_EXECUTABLE] as $path) {
            echo "Setting executable: $path ... ";
            if (is_file($path)) {
                chmod($path, 0755);
                echo "done\n";
            } else {
                echo "\n\tThe file was not found: " . getcwd() . DIRECTORY_SEPARATOR . $path . "\n";
                return;
            }
        }
    }
35072
public function attach(ActionEventDispatcher $events)
    {
        $this->trackHandler($events->attachListener(MessageDispatch::INITIALIZE, [$this, 'onInitializeMessageDispatch']));
        $this->trackHandler($events->attachListener(MessageDispatch::FINALIZE, [$this, 'onFinalizeMessageDispatch']));
    }