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


PHP FileUtils::dotToPath方法代码示例

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


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

示例1: __construct

 /**
  * Construct the result definition from the contents of the ubar.xml file.
  *
  * @param class $xmlObj - XML representation of an result definition.
  *
  * @see ActionDef::getResult()
  * @see Result::getGlobalResult()
  */
 public function __construct($xmlObj)
 {
     $this->type = isset($xmlObj['type']) ? (string) $xmlObj['type'] : GlobalConstants::DEFAULT_TYPE;
     $this->name = isset($xmlObj['name']) ? (string) $xmlObj['name'] : GlobalConstants::DEFAULT_NAME;
     $this->target = (string) $xmlObj;
     if ($this->type == GlobalConstants::PAGE_TYPE && $this->target != '') {
         $this->viewLocation = FileUtils::dotToPath($this->target);
     }
     if (isset($xmlObj['template'])) {
         $this->templateName = (string) $xmlObj['template'];
     }
 }
开发者ID:Rkandel23,项目名称:ubar,代码行数:20,代码来源:Result.php

示例2: __construct

 /**
  * Construct the action definition from the contents of the ubar.xml file.
  *
  * @param class $xmlDef - XML representation of an template definition.
  *
  * @see ActionMapper::getTemplate()
  */
 public function __construct($xmlDef)
 {
     if (!is_null($xmlDef->attributes()->path)) {
         $pathString = (string) $xmlDef->attributes()->path;
         $this->path = FileUtils::dotToPath($pathString);
     }
     foreach ($xmlDef->param as $param) {
         $attribs = $param->attributes();
         $name = (string) $attribs->name;
         $value = (string) $attribs->value;
         $this->addParam($name, $value);
     }
 }
开发者ID:Rkandel23,项目名称:ubar,代码行数:20,代码来源:TemplateDef.php

示例3: __construct

 /**
  * Constructor for all definitions: actions, default action, global
  * results, templates, etc.
  *
  * @param string Path to ubar.xml file.
  *
  * @todo Make parsing failures be more graceful and provide more meaninful feedback.
  */
 public function __construct($file)
 {
     // convert xml of action definitions to an xml object
     libxml_clear_errors();
     $actionDefsXML = simplexml_load_file($file, "SimpleXMLElement", LIBXML_DTDVALID);
     if (libxml_get_last_error()) {
         throw new Exception('Error validating / loading XML');
     }
     // get the name of the default action
     $this->defaultActionName = (string) $actionDefsXML->defaultAction['name'];
     // get the name of the default action
     if (!is_null($actionDefsXML->dummyAction['path'])) {
         $this->dummyActionPath = FileUtils::dotToPath((string) $actionDefsXML->dummyAction['path']);
     }
     // assign actions as a local variable
     $this->actions = $actionDefsXML->actions->action;
     // assign results as a local variable
     $this->globalResults = $actionDefsXML->globalResults->result;
     // assign permission groups as a local variable
     $this->permissionGroups = $actionDefsXML->permissionGroups;
     // assign permission groups as a local variable
     $this->templates = $actionDefsXML->templates->template;
 }
开发者ID:Rkandel23,项目名称:ubar,代码行数:31,代码来源:ActionMapper.php

示例4: __construct

 /**
  * Construct the action definition from the contents of the ubar.xml file.
  *
  * NOTE: If no path is defined for the action, a dummy action that always
  * returns GlobalConstants::SUCCESS will be used.
  *
  * @param class $actionXML - XML representation of an action definition.
  *
  * @see ActionMapper::getAction()
  */
 public function __construct($actionXML)
 {
     $path = (string) $actionXML['path'];
     // use dummy action if no action defined
     if ($path != '') {
         $this->actionLocation = FileUtils::dotToPath($path);
         $this->actionClassName = FileUtils::classFromFile($this->actionLocation);
     } else {
         $this->actionClassName = GlobalConstants::DUMMY_ACTION;
     }
     if (!is_null($actionXML['template'])) {
         $this->templateName = (string) $actionXML['template'];
     }
     if (!is_null($actionXML['view'])) {
         $this->viewLocation = FileUtils::dotToPath((string) $actionXML['view']);
     }
     $this->results = $actionXML->results->result;
     $this->permissionGroup = $actionXML->permissionGroup;
     $this->permissions = $actionXML->permissions;
     $this->name = (string) $actionXML['name'];
     // add params
     foreach ($actionXML->param as $param) {
         $attribs = $param->attributes();
         $name = (string) $attribs->name;
         $value = (string) $attribs->value;
         $this->addParam($name, $value);
     }
     // display values
     $this->title = (string) $actionXML['title'];
     $this->titleKey = (string) $actionXML['titleKey'];
     // TODO: page mostly makes sense as action name, consider decoupling however
     $this->page = (string) $actionXML['name'];
     $this->section = (string) $actionXML['section'];
     $this->subSection = (string) $actionXML['subSection'];
 }
开发者ID:Rkandel23,项目名称:ubar,代码行数:45,代码来源:ActionDef.php

示例5: testDotToPath

 function testDotToPath()
 {
     $this->assertEquals("this/is/a/path/to/a/file.php", FileUtils::dotToPath("this.is.a.path.to.a.file"));
 }
开发者ID:Rkandel23,项目名称:ubar,代码行数:4,代码来源:FileUtilsTest.php


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