本文整理汇总了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']);
}
示例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'));
}
示例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']);
}
示例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);
}