當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。