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


PHP Filesystem::keys方法代码示例

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


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

示例1: testCache

 public function testCache()
 {
     $cacheAdapter = new InMemory(array());
     $this->app['finder.cache.adapter'] = $cacheAdapter;
     $cache = new Filesystem($cacheAdapter);
     $this->assertEmpty($cache->keys());
     // exec without cache
     $this->runCommand('rollback', array('sourcePath' => 'src/'));
     $this->assertEmpty($cache->keys());
     // exec with cache
     $this->runCommand('rollback', array('--cache' => true, 'sourcePath' => 'src/'));
     $this->assertNotEmpty($cache->keys());
 }
开发者ID:niktux,项目名称:karma,代码行数:13,代码来源:RollbackCommandTest.php

示例2: clearCache

 /**
  * {@inheritDoc}
  */
 public function clearCache($maxAge)
 {
     $delTime = time() - (int) $maxAge;
     $num = 0;
     foreach ($this->temporaryFilesystem->keys() as $key) {
         if (!$this->temporaryFilesystem->getAdapter()->isDirectory($key)) {
             if ($delTime > $this->temporaryFilesystem->mtime($key)) {
                 $this->temporaryFilesystem->delete($key);
                 $num++;
             }
         }
     }
     return $num;
 }
开发者ID:thrace-project,项目名称:media-bundle,代码行数:17,代码来源:AbstractManager.php

示例3: shouldWorkWithHiddenFiles

 /**
  * @test
  * @group functional
  */
 public function shouldWorkWithHiddenFiles()
 {
     $this->filesystem->write('.foo', 'hidden');
     $this->assertTrue($this->filesystem->has('.foo'));
     $this->assertContains('.foo', $this->filesystem->keys());
     $this->filesystem->delete('.foo');
     $this->assertFalse($this->filesystem->has('.foo'));
 }
开发者ID:course-hero,项目名称:gaufrette-extras,代码行数:12,代码来源:FunctionalTestCase.php

示例4: shouldFetchKeys

 /**
  * @test
  * @group functional
  */
 public function shouldFetchKeys()
 {
     $this->assertEquals(array(), $this->filesystem->keys());
     $this->filesystem->write('foo', 'Some content');
     $this->filesystem->write('bar', 'Some content');
     $this->filesystem->write('baz', 'Some content');
     $actualKeys = $this->filesystem->keys();
     $this->assertEquals(3, count($actualKeys));
     foreach (array('foo', 'bar', 'baz') as $key) {
         $this->assertContains($key, $actualKeys);
     }
 }
开发者ID:saberyounis,项目名称:Sonata-Project,代码行数:16,代码来源:FunctionalTestCase.php


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