当前位置: 首页>>代码示例>>PHP>>正文


PHP PathHelper::normalizePath方法代码示例

本文整理汇总了PHP中PHPCR\Util\PathHelper::normalizePath方法的典型用法代码示例。如果您正苦于以下问题:PHP PathHelper::normalizePath方法的具体用法?PHP PathHelper::normalizePath怎么用?PHP PathHelper::normalizePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPCR\Util\PathHelper的用法示例。


在下文中一共展示了PathHelper::normalizePath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getNodePath

 public function getNodePath($workspace, $path, $withFilename = true)
 {
     $path = PathHelper::normalizePath($path);
     if (substr($path, 0, 1) == '/') {
         $path = substr($path, 1);
     }
     if ($path) {
         $path .= '/';
     }
     $nodeRecordPath = Storage::WORKSPACE_PATH . '/' . $workspace . '/' . $path . 'node.yml';
     if ($withFilename === false) {
         $nodeRecordPath = dirname($nodeRecordPath);
     }
     return $nodeRecordPath;
 }
开发者ID:jackalope,项目名称:jackalope-fs,代码行数:15,代码来源:StorageHelper.php

示例2: changePathToHistory

 /**
  * changes path node to history node.
  *
  * @param NodeInterface    $node
  * @param SessionInterface $session
  * @param string           $absSrcPath
  * @param string           $absDestPath
  */
 private function changePathToHistory(NodeInterface $node, SessionInterface $session, $absSrcPath, $absDestPath)
 {
     // get new path node
     $relPath = str_replace($absSrcPath, '', $node->getPath());
     $newPath = PathHelper::normalizePath($absDestPath . $relPath);
     $newPathNode = $session->getNode($newPath);
     // set history to true and set content to new path
     $node->setProperty('sulu:content', $newPathNode);
     $node->setProperty('sulu:history', true);
     // get referenced history
     /** @var PropertyInterface $property */
     foreach ($node->getReferences('sulu:content') as $property) {
         $property->getParent()->setProperty('sulu:content', $newPathNode);
     }
 }
开发者ID:ollietb,项目名称:sulu,代码行数:23,代码来源:PhpcrMapper.php

示例3: cloneFromImmediately

 /**
  * Implement the workspace clone method. It is dispatched immediately.
  *      http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#3.10%20Corresponding%20Nodes
  *      http://www.day.com/specs/jcr/2.0/10_Writing.html#10.8%20Cloning%20and%20Updating%20Nodes
  *
  * @param string  $srcWorkspace   the name of the workspace from which the copy is to be made.
  * @param string  $srcAbsPath     the path of the node to be cloned.
  * @param string  $destAbsPath    the location to which the node at srcAbsPath is to be cloned in this workspace.
  * @param boolean $removeExisting
  *
  * @throws \PHPCR\UnsupportedRepositoryOperationException
  * @throws \PHPCR\ItemExistsException
  *
  * @see Workspace::cloneFrom()
  */
 public function cloneFromImmediately($srcWorkspace, $srcAbsPath, $destAbsPath, $removeExisting)
 {
     if (!$this->transport instanceof WritingInterface) {
         throw new UnsupportedRepositoryOperationException('Transport does not support writing');
     }
     $srcAbsPath = PathHelper::normalizePath($srcAbsPath);
     $destAbsPath = PathHelper::normalizePath($destAbsPath, true);
     if (!$removeExisting && $this->session->nodeExists($destAbsPath)) {
         throw new ItemExistsException('Node already exists at destination and removeExisting is false');
     }
     $this->transport->cloneFrom($srcWorkspace, $srcAbsPath, $destAbsPath, $removeExisting);
 }
开发者ID:nikophil,项目名称:cmf-tests,代码行数:27,代码来源:ObjectManager.php

示例4: testNormalizePathInvalidNoThrow

 /**
  * @dataProvider dataproviderNormalizePathInvalid
  */
 public function testNormalizePathInvalidNoThrow($input)
 {
     $this->assertFalse(PathHelper::normalizePath($input, true, false));
 }
开发者ID:nikophil,项目名称:cmf-tests,代码行数:7,代码来源:PathHelperTest.php


注:本文中的PHPCR\Util\PathHelper::normalizePath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。