本文整理汇总了PHP中OC\Files\View::rmdir方法的典型用法代码示例。如果您正苦于以下问题:PHP View::rmdir方法的具体用法?PHP View::rmdir怎么用?PHP View::rmdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC\Files\View
的用法示例。
在下文中一共展示了View::rmdir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$view = new View('/');
$children = $view->getDirectoryContent('/');
foreach ($children as $child) {
if ($view->is_dir($child->getPath())) {
$thumbnailsFolder = $child->getPath() . '/thumbnails';
if ($view->is_dir($thumbnailsFolder)) {
$view->rmdir($thumbnailsFolder);
}
}
}
}
示例2: testSingleStorageDeleteFolderFail
/**
* Delete should fail is the source folder cant be deleted
*/
public function testSingleStorageDeleteFolderFail()
{
/**
* @var \OC\Files\Storage\Temporary | \PHPUnit_Framework_MockObject_MockObject $storage
*/
$storage = $this->getMockBuilder('\\OC\\Files\\Storage\\Temporary')->setConstructorArgs([[]])->setMethods(['rename', 'unlink', 'rmdir'])->getMock();
$storage->expects($this->any())->method('rmdir')->will($this->returnValue(false));
$cache = $storage->getCache();
Filesystem::mount($storage, [], '/' . $this->user . '/files');
$this->userView->mkdir('folder');
$this->userView->file_put_contents('folder/test.txt', 'foo');
$this->assertTrue($storage->file_exists('folder/test.txt'));
$this->assertFalse($this->userView->rmdir('folder'));
$this->assertTrue($storage->file_exists('folder'));
$this->assertTrue($storage->file_exists('folder/test.txt'));
$this->assertTrue($cache->inCache('folder'));
$this->assertTrue($cache->inCache('folder/test.txt'));
// file should not be in the trashbin
$results = $this->rootView->getDirectoryContent($this->user . '/files_trashbin/files/');
$this->assertEquals(0, count($results));
}
示例3: rmdir
public static function rmdir($path)
{
return self::$defaultInstance->rmdir($path);
}