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


PHP vfsStreamDirectory::getName方法代码示例

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


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

示例1: visitDirectory

 /**
  * visit a directory and process it
  *
  * @param   vfsStreamDirectory  $dir
  * @return  vfsStreamStructureVisitor
  */
 public function visitDirectory(vfsStreamDirectory $dir)
 {
     $this->current[$dir->getName()] = array();
     $tmp =& $this->current;
     $this->current =& $tmp[$dir->getName()];
     foreach ($dir as $child) {
         $this->visit($child);
     }
     $this->current =& $tmp;
     return $this;
 }
开发者ID:oalkhanishvili,项目名称:track2,代码行数:17,代码来源:vfsStreamStructureVisitor.php

示例2: testGetProjectRoot

 public function testGetProjectRoot()
 {
     $tempDir = $this->root->getName();
     $testDir = tempnam($tempDir, '');
     unlink($testDir);
     mkdir("{$testDir}/1/2/3/4/5", 0755, true);
     $expectedRoot = "{$testDir}/1";
     touch("{$expectedRoot}/.platform-project");
     chdir($testDir);
     $this->assertFalse(LocalProject::getProjectRoot());
     chdir($expectedRoot);
     $this->assertEquals($expectedRoot, LocalProject::getProjectRoot());
     chdir("{$testDir}/1/2/3/4/5");
     $this->assertEquals($expectedRoot, LocalProject::getProjectRoot());
 }
开发者ID:drewmelck,项目名称:platformsh-cli,代码行数:15,代码来源:LocalProjectTest.php

示例3: visitDirectory

 /**
  * visit a directory and process it
  *
  * @param   vfsStreamDirectory  $dir
  * @return  vfsStreamPrintVisitor
  */
 public function visitDirectory(vfsStreamDirectory $dir)
 {
     $this->printContent($dir->getName());
     $this->depth++;
     foreach ($dir as $child) {
         $this->visit($child);
     }
     $this->depth--;
     return $this;
 }
开发者ID:mikey179,项目名称:vfsstream,代码行数:16,代码来源:vfsStreamPrintVisitor.php

示例4: createDummyProject

 /**
  * @param string $sourceDir
  *
  * @return string
  */
 protected function createDummyProject($sourceDir)
 {
     if (!is_dir($sourceDir)) {
         throw new \InvalidArgumentException("Not a directory: {$sourceDir}");
     }
     $tempDir = self::$root->getName();
     $projectRoot = tempnam($tempDir, '');
     unlink($projectRoot);
     mkdir($projectRoot);
     // Set up the project files.
     $local = new LocalProject();
     $local->createProjectFiles($projectRoot, 'testProjectId');
     // Make a dummy repository.
     $repositoryDir = $projectRoot . '/' . LocalProject::REPOSITORY_DIR;
     mkdir($repositoryDir);
     $fsHelper = new FilesystemHelper();
     $fsHelper->copyAll($sourceDir, $repositoryDir);
     return $projectRoot;
 }
开发者ID:drewmelck,项目名称:platformsh-cli,代码行数:24,代码来源:BaseToolstackTest.php

示例5: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->dir = vfsStream::setup();
     vfsStream::copyFromFileSystem(__DIR__ . '/../fixtures/images', $this->dir);
     $dir = $this->dir;
     $image = $this->getMock('\\Imagine\\Image\\ImageInterface');
     $image->expects($this->any())->method('save')->will($this->returnCallback(function ($destFile) use($dir) {
         $temp = vfsStream::newFile(basename($destFile));
         $dir->addChild($temp);
         return TRUE;
     }));
     $imagine = $this->getMock('\\Imagine\\Image\\ImagineInterface');
     $imagine->expects($this->any())->method('open')->will($this->returnValue($image));
     $this->media = $this->getMock('\\Oryzone\\MediaStorage\\Model\\MediaInterface');
     $this->media->expects($this->any())->method('getContext')->will($this->returnValue('default'));
     $this->media->expects($this->any())->method('getName')->will($this->returnValue('sample'));
     $this->variant = $this->getMock('\\Oryzone\\MediaStorage\\Variant\\VariantInterface');
     $this->variant->expects($this->any())->method('getName')->will($this->returnValue('default'));
     $this->variant->expects($this->any())->method('getOptions')->will($this->returnValue(array('width' => 50, 'height' => 30, 'resize' => 'stretch')));
     $this->variant->expects($this->any())->method('getMetaValue')->will($this->returnValueMap(array(array('width', NULL, 50), array('height', NULL, 30))));
     $this->provider = new ImageProvider(vfsStream::url($this->dir->getName()) . '/', $imagine);
 }
开发者ID:jmcclell,项目名称:OryzoneMediaStorage,代码行数:26,代码来源:ImageProviderTest.php

示例6: tempDir

 /**
  * Create a test directory with a unique name.
  *
  * @param bool $fill Fill the directory with some files.
  *
  * @return string
  */
 protected function tempDir($fill = false)
 {
     $tempDir = $this->root->getName();
     $testDir = tempnam($tempDir, '');
     unlink($testDir);
     mkdir($testDir);
     if ($fill) {
         touch($testDir . '/test-file');
         mkdir($testDir . '/test-dir');
         touch($testDir . '/test-dir/test-file');
         mkdir($testDir . '/test-nesting/1/2/3', 0755, true);
         touch($testDir . '/test-nesting/1/2/3/test-file');
     }
     return $testDir;
 }
开发者ID:pjcdawkins,项目名称:platformsh-cli,代码行数:22,代码来源:FilesystemHelperTest.php


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