本文整理汇总了PHP中League\Flysystem\Util::normalizePrefix方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::normalizePrefix方法的具体用法?PHP Util::normalizePrefix怎么用?PHP Util::normalizePrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类League\Flysystem\Util
的用法示例。
在下文中一共展示了Util::normalizePrefix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteDir
public function deleteDir($dirname)
{
$path = Util::normalizePrefix($dirname, '/');
$length = strlen($path);
for ($i = 0; $i < $this->archive->numFiles; $i++) {
$info = $this->archive->statIndex($i);
if (substr($info['name'], 0, $length) === $path) {
$this->archive->deleteIndex($i);
}
}
return $this->archive->deleteName($dirname);
}
示例2: deleteDir
public function deleteDir($dirname)
{
// This is needed to ensure the right number of
// files are set to the $numFiles property.
$this->reopenArchive();
$location = $this->applyPathPrefix($dirname);
$path = Util::normalizePrefix($location, '/');
$length = strlen($path);
for ($i = 0; $i < $this->archive->numFiles; $i++) {
$info = $this->archive->statIndex($i);
if (substr($info['name'], 0, $length) === $path) {
$this->archive->deleteIndex($i);
}
}
return $this->archive->deleteName($dirname);
}
示例3: __construct
/**
* Constructor
*
* @param string $root
*/
public function __construct($root)
{
$root = $this->ensureDirectory($root);
$this->root = Util::normalizePrefix($root, DIRECTORY_SEPARATOR);
}