本文整理汇总了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'];
}
}
示例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);
}
}
示例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;
}
示例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'];
}
示例5: testDotToPath
function testDotToPath()
{
$this->assertEquals("this/is/a/path/to/a/file.php", FileUtils::dotToPath("this.is.a.path.to.a.file"));
}