本文整理汇总了PHP中FileBackend::parentStoragePath方法的典型用法代码示例。如果您正苦于以下问题:PHP FileBackend::parentStoragePath方法的具体用法?PHP FileBackend::parentStoragePath怎么用?PHP FileBackend::parentStoragePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileBackend
的用法示例。
在下文中一共展示了FileBackend::parentStoragePath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
protected function tearDown()
{
$this->repo->cleanupBatch($this->createdFiles);
// delete files
foreach ($this->createdFiles as $tmp) {
// delete dirs
$tmp = $this->repo->resolveVirtualUrl($tmp);
while ($tmp = FileBackend::parentStoragePath($tmp)) {
$this->repo->getBackend()->clean(array('dir' => $tmp));
}
}
parent::tearDown();
}
示例2: testParentStoragePath
/**
* @dataProvider provider_testParentStoragePath
*/
public function testParentStoragePath($path, $res)
{
$this->assertEquals($res, FileBackend::parentStoragePath($path), "FileBackend::parentStoragePath on path '{$path}'");
}
示例3: deleteFiles
/**
* Delete the specified files, if they exist.
* @param array $files Full paths to files to delete.
*/
private static function deleteFiles($files)
{
$backend = RepoGroup::singleton()->getLocalRepo()->getBackend();
foreach ($files as $file) {
$backend->delete(array('src' => $file), array('force' => 1));
}
foreach ($files as $file) {
$tmp = FileBackend::parentStoragePath($file);
while ($tmp) {
if (!$backend->clean(array('dir' => $tmp))->isOK()) {
break;
}
$tmp = FileBackend::parentStoragePath($tmp);
}
}
}
示例4: deleteFiles
/**
* Delete the specified files and their parent directories
* @param array $files File backend URIs mwstore://...
*/
private function deleteFiles($files)
{
// Delete the files
$backend = RepoGroup::singleton()->getLocalRepo()->getBackend();
foreach ($files as $file) {
$backend->delete(['src' => $file], ['force' => 1]);
}
// Delete the parent directories
foreach ($files as $file) {
$tmp = FileBackend::parentStoragePath($file);
while ($tmp) {
if (!$backend->clean(['dir' => $tmp])->isOK()) {
break;
}
$tmp = FileBackend::parentStoragePath($tmp);
}
}
}
示例5: recursiveClean
private function recursiveClean($dir)
{
do {
if (!$this->backend->clean(array('dir' => $dir))->isOK()) {
break;
}
} while ($dir = FileBackend::parentStoragePath($dir));
}