当前位置: 首页>>代码示例>>PHP>>正文


PHP Storage::unlink方法代码示例

本文整理汇总了PHP中OC\Files\Storage\Storage::unlink方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::unlink方法的具体用法?PHP Storage::unlink怎么用?PHP Storage::unlink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC\Files\Storage\Storage的用法示例。


在下文中一共展示了Storage::unlink方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testMoveCrossStorage

	public function testMoveCrossStorage() {
		$storage2 = new Temporary(array());
		$cache2 = $storage2->getCache();
		Filesystem::mount($storage2, array(), '/bar');
		$this->storage->file_put_contents('foo.txt', 'qwerty');

		$this->updater->update('foo.txt');

		$this->assertTrue($this->cache->inCache('foo.txt'));
		$this->assertFalse($cache2->inCache('bar.txt'));
		$cached = $this->cache->get('foo.txt');

		// "rename"
		$storage2->file_put_contents('bar.txt', 'qwerty');
		$this->storage->unlink('foo.txt');

		$this->assertTrue($this->cache->inCache('foo.txt'));
		$this->assertFalse($cache2->inCache('bar.txt'));

		$this->updater->rename('foo.txt', 'bar/bar.txt');

		$this->assertFalse($this->cache->inCache('foo.txt'));
		$this->assertTrue($cache2->inCache('bar.txt'));

		$cachedTarget = $cache2->get('bar.txt');
		$this->assertEquals($cached['mtime'], $cachedTarget['mtime']);
		$this->assertEquals($cached['size'], $cachedTarget['size']);
		$this->assertEquals($cached['etag'], $cachedTarget['etag']);
		$this->assertEquals($cached['fileid'], $cachedTarget['fileid']);
	}
开发者ID:ninjasilicon,项目名称:core,代码行数:30,代码来源:updater.php

示例2: testScanRemovedFile

 public function testScanRemovedFile()
 {
     $this->fillTestFolders();
     $this->scanner->scan('');
     $this->assertTrue($this->cache->inCache('folder/bar.txt'));
     $this->storage->unlink('folder/bar.txt');
     $this->scanner->scanFile('folder/bar.txt');
     $this->assertFalse($this->cache->inCache('folder/bar.txt'));
 }
开发者ID:0x17de,项目名称:core,代码行数:9,代码来源:scanner.php

示例3: testParentSize

 public function testParentSize()
 {
     $this->storage->getScanner()->scan('');
     $parentCached = $this->cache->get('');
     $this->assertEquals(0, $parentCached['size']);
     $this->storage->file_put_contents('foo.txt', 'bar');
     $parentCached = $this->cache->get('');
     $this->assertEquals(0, $parentCached['size']);
     $this->updater->update('foo.txt');
     $parentCached = $this->cache->get('');
     $this->assertEquals(3, $parentCached['size']);
     $this->storage->file_put_contents('foo.txt', 'qwerty');
     $parentCached = $this->cache->get('');
     $this->assertEquals(3, $parentCached['size']);
     $this->updater->update('foo.txt');
     $parentCached = $this->cache->get('');
     $this->assertEquals(6, $parentCached['size']);
     $this->storage->unlink('foo.txt');
     $parentCached = $this->cache->get('');
     $this->assertEquals(6, $parentCached['size']);
     $this->updater->remove('foo.txt');
     $parentCached = $this->cache->get('');
     $this->assertEquals(0, $parentCached['size']);
 }
开发者ID:Combustible,项目名称:core,代码行数:24,代码来源:updater.php

示例4: unlink

 /**
  * see http://php.net/manual/en/function.unlink.php
  *
  * @param string $path
  * @return bool
  */
 public function unlink($path)
 {
     return $this->storage->unlink($path);
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:10,代码来源:Wrapper.php


注:本文中的OC\Files\Storage\Storage::unlink方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。