Publish the configuration somewhere.

@param string      $path
@param string      $format
@param string|null $node
357310
public function publishNode($path, $format = 'php', $node = null)
    {
        if ($this->files->isDirectory($path)) {
            foreach (['config', 'hooks', 'paths', 'remote', 'vcs', 'stages', 'strategies', 'plugins'] as $file) {
                $this->publishNode($path.'/'.$file.'.'.$format, $format, $file);
            }

            return;
        }

        // If a single file was passed, infer format from extension
        $format = $format ?: pathinfo($path, PATHINFO_EXTENSION);
        $configuration = $this->getDefinition($format, $node);

        $this->files->put($path, $configuration);
    }
180119
private static void publishEvent(String event, SiteNode node) {
		ZAP.getEventBus().publishSyncEvent(SiteMapEventPublisher.getPublisher(), new Event(SiteMapEventPublisher.getPublisher(), event, new Target(node)));
	}
1162609
public function publish($format = 'php', $consolidated = false)
    {
        $format = $this->sanitizeFormat($format);
        $destination = $this->paths->getConfigurationPath();

        // Create directory
        if (!$this->files->isDirectory($destination) && !$consolidated) {
            $this->files->createDir($destination);
        }

        // Consolidate or not configuration
        if ($consolidated) {
            $destination = $this->paths->getRocketeerPath().'/rocketeer.'.$format;
        }

        // Unzip configuration files
        $this->publishNode($destination, $format);

        return $destination;
    }
1050576
public function useFiles($path, $level = 'debug', $format='', $dateFormat = 'Y-m-d H:i:s', $permissions=null)
	{
		$level = $this->parseLevel($level);

		$handler = new StreamHandler($path, $level, true, $permissions);
		if ($format)
		{
			$handler->setFormatter(new LineFormatter($format, $dateFormat));
		}

		$this->monolog->pushHandler($handler);
	}
712858
public function publishNodesAction(array $nodes, $targetWorkspaceName  = null)
    {
        $targetWorkspace = ($targetWorkspaceName !== null) ? $this->workspaceRepository->findOneByName($targetWorkspaceName) : null;
        $this->publishingService->publishNodes($nodes, $targetWorkspace);

        $this->throwStatus(204, 'Nodes published', '');
    }
1054941
private function prepareNode(&$node, $key)
    {
        if (!isset($node[$key])) {
            $node[$key] = null;
        } elseif (!is_array($node[$key])) {
            $node[$key] = [$node[$key]];
        }
    }
959552
public function execute(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        $this->checkOptionsForValidity($options);

        $this->shell->execute('rm -f ' . $options['targetFile'] . '; mkdir -p ' . dirname($options['targetFile']), $node, $deployment);
        $sourcePath = $deployment->getApplicationReleasePath($application);

        $tarOptions = sprintf(' --transform="s,^%s,%s," ', ltrim($sourcePath, '/'), $options['baseDirectory']);
        if (isset($options['exclude']) && is_array($options['exclude'])) {
            foreach ($options['exclude'] as $excludePattern) {
                $tarOptions .= sprintf(' --exclude="%s" ', $excludePattern);
            }
        }

        if (substr($options['targetFile'], -7) === '.tar.gz') {
            $tarOptions .= sprintf(' -czf %s %s', $options['targetFile'], $sourcePath);
            $this->shell->execute(sprintf('tar %s || gnutar %s', $tarOptions, $tarOptions), $node, $deployment);
        } elseif (substr($options['targetFile'], -8) === '.tar.bz2') {
            $tarOptions .= sprintf(' -cjf %s %s', $options['targetFile'], $sourcePath);
            $this->shell->execute(sprintf('tar %s || gnutar %s', $tarOptions, $tarOptions), $node, $deployment);
        } elseif (substr($options['targetFile'], -4) === '.zip') {
            $temporaryDirectory = sys_get_temp_dir() . '/' . uniqid('f3_deploy');
            $this->shell->execute(sprintf('mkdir -p %s', $temporaryDirectory), $node, $deployment);
            $tarOptions .= sprintf(' -cf %s/out.tar %s', $temporaryDirectory, $sourcePath);
            $this->shell->execute(sprintf('tar %s || gnutar %s', $tarOptions, $tarOptions), $node, $deployment);
            $this->shell->execute(sprintf('cd %s; tar -xf out.tar; rm out.tar; zip --quiet -9 -r out %s', $temporaryDirectory, $options['baseDirectory']), $node, $deployment);
            $this->shell->execute(sprintf('mv %s/out.zip %s; rm -Rf %s', $temporaryDirectory, $options['targetFile'], $temporaryDirectory), $node, $deployment);
        } else {
            throw new TaskExecutionException('Unknown target file format', 1314248387);
        }
    }
1235975
public function htmlActionsPanel(INode $node, &$output, $path)
    {
        if (!$node instanceof ISharedNode) {
            return;
        }

        $aclPlugin = $this->server->getPlugin('acl');
        if ($aclPlugin) {
            if (!$aclPlugin->checkPrivileges($path, '{DAV:}share', \Sabre\DAVACL\Plugin::R_PARENT, false)) {
                // Sharing is not permitted, we will not draw this interface.
                return;
            }
        }

        $output .= '<tr><td colspan="2"><form method="post" action="">
            <h3>Share this resource</h3>
            <input type="hidden" name="sabreAction" value="share" />
            <label>Share with (uri):</label> <input type="text" name="href" placeholder="mailto:user@example.org"/><br />
            <label>Access</label>
                <select name="access">
                    <option value="readwrite">Read-write</option>
                    <option value="read">Read-only</option>
                    <option value="no-access">Revoke access</option>
                </select><br />
             <input type="submit" value="share" />
            </form>
            </td></tr>';
    }
1295162
public function setFormat(string $format)
    {
        $allowed = [
            'html',
            'xml',
            'json',
            'file'
        ];
        
        if (! in_array(strtolower($format), $allowed)) {
            Throw new RouterException(sprintf('Your format "%s" is not an allowed format. Use one of these formats %s', $format, implode(', ', $allowed)));
        }
        
        $this->format = $format;
    }
1014072
public function setFormat($format = null)
    {
        if ( ! is_null($format)) {
            self::checkFormat($format);
            $this->format = $format;
        }

        return $this;
    }
825933
public function createSetNode($path, $node)
    {
        return new SetNode(end($path), $this->exprcompiler->parse($node));
    }
328209
public function publish(string $path)
    {
        if (!is_dir($path)) {
            throw new \Exception("Bad path ($path)");
        }
        $this->recurseCopy($path, base_path('public/'));
    }
587959
static void writeResponse(Configuration conf, Writer out, String format)
    throws IOException, BadFormatException {
    if (FORMAT_JSON.equals(format)) {
      Configuration.dumpConfiguration(conf, out);
    } else if (FORMAT_XML.equals(format)) {
      conf.writeXml(out);
    } else {
      throw new BadFormatException("Bad format: " + format);
    }
  }
631144
protected function publishFiles(Filesystem $filesystem, array $paths, $force = false)
    {
        foreach ($paths as $from => $to) {
            if ($filesystem->isFile($from)) {
                $this->publishFile($filesystem, $from, $to, $force);
            } elseif ($filesystem->isDirectory($from)) {
                $this->publishDirectory($from, $to, $force);
            } else {
                $this->error("Can't locate path: <{$from}>");
            }
        }
    }
1182788
public function publishNodeAction(NodeInterface $node, Workspace $selectedWorkspace)
    {
        $this->publishingService->publishNode($node);
        $this->addFlashMessage($this->translator->translateById('workspaces.selectedChangeHasBeenPublished', [], null, null, 'Modules', 'Neos.Neos'));
        $this->redirect('show', null, null, ['workspace' => $selectedWorkspace]);
    }
946917
public function process($node, $path = null)
    {
        $this->_depth = 0;
        $this->_variables[$this->_depth] = [];
        $this->_processTree($node);
        if ($this->_variables[$this->_depth]) {
            $this->_flushVariables($node);
        }
        $this->_variables = [];
        return $node;
    }
407522
public function fileXmlShouldBeLike($path, PyStringNode $text)
    {
        $path = $this->workingDir . '/' . $path;
        Assert::assertFileExists($path);

        $fileContent = trim(file_get_contents($path));

        $fileContent = preg_replace('/time="(.*)"/', 'time="-IGNORE-VALUE-"', $fileContent);

        $dom = new DOMDocument();
        $dom->loadXML($text);
        $dom->formatOutput = true;

        Assert::assertEquals(trim($dom->saveXML(null, LIBXML_NOEMPTYTAG)), $fileContent);
    }