本文整理汇总了PHP中Webmozart\PathUtil\Path::isRelative方法的典型用法代码示例。如果您正苦于以下问题:PHP Path::isRelative方法的具体用法?PHP Path::isRelative怎么用?PHP Path::isRelative使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Webmozart\PathUtil\Path
的用法示例。
在下文中一共展示了Path::isRelative方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fixSuitePath
private function fixSuitePath($fix_path)
{
$xpath = new DOMXPath($this->doc);
$node_list = $xpath->query('//testsuite/directory | //testsuite/file | //testsuite/exclude');
foreach ($node_list as $node) {
if (Path::isRelative($path = $node->textContent)) {
$new_text = new DOMText(Path::canonicalize($fix_path . '/' . $path));
if ($node->firstChild) {
$node->replaceChild($new_text, $node->firstChild);
} else {
$node->appendChild($new_text);
}
}
}
}
示例2: testIsRelativeFailsIfInvalidPath
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage The path must be a string. Got: array
*/
public function testIsRelativeFailsIfInvalidPath()
{
Path::isRelative(array());
}
示例3: processDir
/**
* Process given dir with replacements and makes it absolute.
*
* @param string $dir
*
* @return string
* Absolute path with placeholders replaced.
*/
protected function processDir($dir)
{
$dir = $this->replacePattern($dir);
// The absolute path has to be calculated relative to the configuration file
if (Path::isRelative($dir)) {
$dir = Path::makeAbsolute($dir, dirname($this->configFile));
}
return rtrim($dir, '/');
}