本文整理匯總了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);
}