/** * Adds an empty directory to the archive. * * @param string $local The path to the directory in the archive. */ public function addEmptyDir($local = null) { if (null === $this->dispatcher) { parent::addEmptyDir($local); return; } $event = new PreAddEmptyDirEvent($this, $local); $this->dispatcher->dispatch(Events::PRE_ADD_EMPTY_DIR, $event); if (!$event->isSkipped()) { parent::addEmptyDir($event->getLocal()); $event = new PostAddEmptyDirEvent($this, $event->getLocal()); $this->dispatcher->dispatch(Events::POST_ADD_EMPTY_DIR, $event); } }
/** * Logs when an empty directory has been added. * * @param PostAddEmptyDirEvent $event The event arguments. */ public function onPostAddEmptyDir(PostAddEmptyDirEvent $event) { $this->logger->info(sprintf('The empty directory "%s" has been added.', basename($event->getLocal())), array('local' => $event->getLocal())); }