Sets page root node name under /page/module.

Tip: You can gain a minimal speed increase if you set your page
root before adding XML.


@param string $root Pageroot node name

@return bool
331812
public function setPageRoot($root = false)
    {
        $this->issetpageroot = true;

        if (Conversion::validateNodeName($root) && $root != $this->page->nodeName) {
            $nodelist = $this->page->childNodes;
            $this->page = $this->dom->createElement($root);

            foreach ($nodelist as $item) {
                $this->page->appendChild($item->cloneNode(true));
            }
        }
    }
341138
public function setRootNodeName($name)
    {
        @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the context instead.', __METHOD__), E_USER_DEPRECATED);

        $this->defaultContext[self::ROOT_NODE_NAME] = $name;
    }
1146962
public function absolute($root = null)
    {
        //argument 1 must be a string or null
        Argument::i()->test(1, 'string', 'null');

        //if path is a directory or file
        if (is_dir($this->data) || is_file($this->data)) {
            return $this;
        }

        //if root is null
        if (is_null($root)) {
            //assume the root is doc root
            $root = $_SERVER['DOCUMENT_ROOT'];
        }

        //get the absolute path
        $absolute = $this->format($this->format($root).$this->data);

        //if absolute is a directory or file
        if (is_dir($absolute) || is_file($absolute)) {
            $this->data = $absolute;
            return $this;
        }

        //if we are here then it means that no path was found so we should throw an exception
        Exception::i()
            ->setMessage(self::ERROR_FULL_PATH_NOT_FOUND)
            ->addVariable($this->data)
            ->addVariable($absolute)
            ->trigger();
    }
1081396
public void setSiteRoot(String root) {

        // site roots must never end with a "/"
        if (root.endsWith("/")) {
            m_siteRoot = root.substring(0, root.length() - 1);
        } else {
            m_siteRoot = root;
        }
    }
522547
public function assign(array $data, $root = 'Ctrl')
    {
        foreach ($data as $k => $d) {
            if ($root != '') {
                if (!isset($this->viewData[$root])) {
                    $this->viewData[$root] = [];
                }
                $this->viewData[$root][$k] = $d;
            } else {
                $this->viewData[$k] = $d;
            }

        }
    }
911370
public function setConnectionRoot($path = '')
    {
        $basePath = $path ?: $this->config['root'];

        if ($basePath && (!ftp_chdir($this->connection, $basePath))) {
            throw new RuntimeException('Root is invalid or does not exist: ' . $basePath);
        }

        // Store absolute path for further reference.
        $this->base_directory = ftp_pwd($this->connection);
    }
32124
public function formatRoot($scheme, $root = null)
    {
        if (is_null($root)) {
            if (is_null($this->cachedRoot)) {
                $this->cachedRoot = $this->forcedRoot ?: $this->getRequestRoot();
            }

            $root = $this->cachedRoot;
        }

        return parent::formatRoot($scheme, $root);
    }
253986
private function addEncryptedAttributeStatement(DOMElement $root) : void
    {
        if ($this->getRequiredEncAttributes() === false) {
            return;
        }
        Assert::notNull($this->encryptionKey);

        $document = $root->ownerDocument;

        $attributeStatement = $document->createElementNS(Constants::NS_SAML, 'saml:AttributeStatement');
        $root->appendChild($attributeStatement);

        foreach ($this->attributes as $name => $values) {
            $document2 = DOMDocumentFactory::create();
            $attribute = $document2->createElementNS(Constants::NS_SAML, 'saml:Attribute');
            $attribute->setAttribute('Name', $name);
            $document2->appendChild($attribute);

            if ($this->nameFormat !== Constants::NAMEFORMAT_UNSPECIFIED) {
                $attribute->setAttribute('NameFormat', $this->getAttributeNameFormat());
            }

            foreach ($values as $value) {
                if (is_string($value)) {
                    $type = 'xs:string';
                } elseif (is_int($value)) {
                    $type = 'xs:integer';
                } else {
                    $type = null;
                }

                $attributeValue = $document2->createElementNS(Constants::NS_SAML, 'saml:AttributeValue');
                $attribute->appendChild($attributeValue);
                if ($type !== null) {
                    $attributeValue->setAttributeNS(Constants::NS_XSI, 'xsi:type', $type);
                }

                if ($value instanceof DOMNodeList) {
                    foreach ($value as $v) {
                        $node = $document2->importNode($v, true);
                        $attributeValue->appendChild($node);
                    }
                } else {
                    $value = strval($value);
                    $attributeValue->appendChild($document2->createTextNode($value));
                }
            }
            /*Once the attribute nodes are built, the are encrypted*/
            $EncAssert = new XMLSecEnc();
            $EncAssert->setNode($document2->documentElement);
            $EncAssert->type = 'http://www.w3.org/2001/04/xmlenc#Element';
            /*
             * Attributes are encrypted with a session key and this one with
             * $EncryptionKey
             */
            $symmetricKey = new XMLSecurityKey(XMLSecurityKey::AES256_CBC);
            $symmetricKey->generateSessionKey();
            /** @psalm-suppress PossiblyNullArgument */
            $EncAssert->encryptKey($this->encryptionKey, $symmetricKey);
            /** @psalm-suppress UndefinedClass */
            $EncrNode = $EncAssert->encryptNode($symmetricKey);

            $EncAttribute = $document->createElementNS(Constants::NS_SAML, 'saml:EncryptedAttribute');
            $attributeStatement->appendChild($EncAttribute);
            /** @psalm-suppress InvalidArgument */
            $n = $document->importNode($EncrNode, true);
            $EncAttribute->appendChild($n);
        }
    }
567215
public static function should_be_on_root(SiteTree $page)
    {
        return (!self::$is_at_root && self::get_homepage_link() == trim($page->RelativeLink(true), '/'));
    }
1241311
public function build($includeRoot = false, $root = null, $depth = null)
    {
        $root = $root === null ? $this->getRoot() : $root;
        $depth = $depth === null ? $this->depth : $depth;

        $result = [];

        /** @var NodeInterface $childNode */
        foreach ($root->getChildNodes($this->nodeTypeFilter) as $childNode) {
            $hasChildNodes = $childNode->hasChildNodes($this->nodeTypeFilter);
            $shouldLoadChildNodes = $hasChildNodes && ($depth > 1 || $this->isInRootLine($this->active, $childNode));

            $result[$childNode->getName()] = [
                'label' => $childNode->getNodeType()->isOfType('Neos.Neos:Document') ?
                    $childNode->getProperty('title') : $childNode->getLabel(),
                'contextPath' => $childNode->getContextPath(),
                'nodeType' => $childNode->getNodeType()->getName(),
                'hasChildren' => $hasChildNodes,
                'isActive' => $this->active && ($childNode->getPath() === $this->active->getPath()),
                'isFocused' => $this->active && ($childNode->getPath() === $this->active->getPath()),
                'isCollapsed' => !$shouldLoadChildNodes,
                'isCollapsable' => $hasChildNodes
            ];

            if ($shouldLoadChildNodes) {
                $result[$childNode->getName()]['children'] =
                    $this->build(false, $childNode, $depth - 1);
            }

            if ($childNode->getNodeType()->isOfType('Neos.Neos:Document')) {
                $result[$childNode->getName()]['href'] = $this->linkingService->createNodeUri(
                    /* $controllerContext */ $this->controllerContext,
                    /* $node */ $childNode,
                    /* $baseNode */ null,
                    /* $format */ null,
                    /* $absolute */ true,
                    /* $arguments */ [],
                    /* $section */ '',
                    /* $addQueryString */ false,
                    /* $argumentsToBeExcludedFromQueryString */ [],
                    /* $resolveShortcuts */ false
                );
            }
        }

        if ($includeRoot) {
            return [
                $root->getName() => [
                    'label' => $root->getNodeType()->isOfType('Neos.Neos:Document') ?
                        $root->getProperty('title') : $root->getLabel(),
                    'icon' => 'globe',
                    'contextPath' => $root->getContextPath(),
                    'nodeType' => $root->getNodeType()->getName(),
                    'hasChildren' => count($result),
                    'isCollapsed' => false,
                    'isActive' => $this->active && ($root->getPath() === $this->active->getPath()),
                    'isFocused' => $this->active && ($root->getPath() === $this->active->getPath()),
                    'children' => $result
                ]
            ];
        }

        return $result;
    }
1233777
public function setRoot($root)
    {
        // do nothing if root isn't a valid prefix
        if (empty($root)) {
            return null;
        }

        // Kill slash padding and add a trailing slash afterwards
        $root = trim($root, '/');
        $root .= '/';
        $this->root = $root;
    }
703463
public function setBaseHref($url)
    {
        $node = $this->filterXPath('descendant-or-self::base')->getNode(0);
        if ($node == null) {
            $node = $this->dom->createElement('base');
            $this->getHeadNode()->appendChild($node);
        }
        $node->setAttribute('href', $url);
    }
785104
public function setNamespaceRoot($namespaceRoot = '\\')
    {
        $namespaceRoot = trim($namespaceRoot, '/\\');
        if (empty($namespaceRoot)) {
            $this->namespaceRoot = '\\';
            return true;
        }
        $this->namespaceRoot = sprintf('\\%s\\', $namespaceRoot);
        return true;
    }
1083175
protected function addCommandInPath(string $root)
    {
        $iterator = new DirectoryIterator($root);

        foreach ($iterator as $path) {
            if ($path->isDot()) {
                continue;
            }

            if ($path->isDir()) {
                $this->addCommandInPath($path->getPathName());
            }

            if ($path->isFile() && $path->getExtension() === 'php') {
                if ($command = $this->createCommand($path)) {
                    $this->add($command);
                }
            }
        }

        unset($iterator);
    }
28032
public void setSiteRoot(String siteRoot) {

        if (siteRoot != null) {
            siteRoot = siteRoot.replaceFirst("/$", "");
        }
        m_siteRoot = siteRoot;
    }
312554
final protected function _setRoot($node = 'root')
	{
		if (is_string($node)) {
			$this->body = $this->appendChild($this->createElement($node));
		} elseif (is_object($node) and $node instanceof \DOMNode) {
			$this->body = $this->appendChild($node);
		} else {
			trigger_error(
				sprintf('$node must be either a DOMNode or string, %s given', gettype($node)),
				E_USER_WARNING
			);
		}
		return $this;
	}
931969
protected function _is_root( $root ) {
		$this->root = $root;

		$is_root = (bool) $this->_root_locate_template();
		if ( ! $is_root ) {
			$this->root = '';
		}

		return $is_root;
	}