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


PHP ResourceStorage::addFile方法代码示例

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


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

示例1: addFileFailsIfFileDoesNotExist

 /**
  * @test
  */
 public function addFileFailsIfFileDoesNotExist()
 {
     $mockedFolder = $this->getMock('TYPO3\\CMS\\Core\\Resource\\Folder', array(), array(), '', FALSE);
     $this->setExpectedException('InvalidArgumentException', '', 1319552745);
     $this->prepareFixture(array());
     $this->fixture->addFile('/some/random/file', $mockedFolder);
 }
开发者ID:samuweiss,项目名称:TYPO3-Site,代码行数:10,代码来源:ResourceStorageTest.php

示例2: addFileFailsIfFileDoesNotExist

 /**
  * @test
  */
 public function addFileFailsIfFileDoesNotExist()
 {
     /** @var Folder|\PHPUnit_Framework_MockObject_MockObject $mockedFolder */
     $mockedFolder = $this->getMock(Folder::class, array(), array(), '', false);
     $this->setExpectedException('InvalidArgumentException', '', 1319552745);
     $this->prepareSubject(array());
     $this->subject->addFile('/some/random/file', $mockedFolder);
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:11,代码来源:ResourceStorageTest.php

示例3: addFileChangesFilenameIfFileExists

 /**
  * @test
  */
 public function addFileChangesFilenameIfFileExists()
 {
     $mockedFolder = $this->getSimpleFolderMock('/');
     $this->addToMount(array('targetFolder' => array('file.ext' => 'asdf', 'file_01.ext' => 'asjdlkajs'), 'file.ext' => 'ajslkd'));
     $this->initializeVfs();
     $this->prepareFixture(array());
     /** @var $driver \TYPO3\CMS\Core\Resource\Driver\LocalDriver */
     $driver = $this->getMock('TYPO3\\CMS\\Core\\Resource\\Driver\\LocalDriver', array('addFile', 'fileExistsInFolder'), array(array('basePath' => $this->getUrlInMount('targetFolder/'))));
     $driver->expects($this->once())->method('addFile')->with($this->anything(), $this->anything(), $this->equalTo('file_02.ext'));
     $driver->expects($this->exactly(3))->method('fileExistsInFolder')->will($this->onConsecutiveCalls($this->returnValue(TRUE), $this->returnValue(TRUE), $this->returnValue(FALSE)));
     $this->fixture->setDriver($driver);
     $this->fixture->addFile($this->getUrlInMount('file.ext'), $mockedFolder);
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:16,代码来源:ResourceStorageTest.php

示例4: addFile

	/**
	 * Adds a file from the local server disk. If the file already exists and
	 * overwriting is disabled,
	 *
	 * @param string $localFilePath
	 * @param string $fileName
	 * @param string $conflictMode possible value are 'cancel', 'replace', 'changeName'
	 * @return File The file object
	 */
	public function addFile($localFilePath, $fileName = NULL, $conflictMode = 'cancel') {
		$fileName = $fileName ? $fileName : PathUtility::basename($localFilePath);
		return $this->storage->addFile($localFilePath, $this, $fileName, $conflictMode);
	}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例5: addFile

 /**
  * Adds a file from the local server disk. If the file already exists and
  * overwriting is disabled,
  *
  * @param string $localFilePath
  * @param string $fileName
  * @param string $conflictMode a value of the \TYPO3\CMS\Core\Resource\DuplicationBehavior enumeration
  * @return File The file object
  */
 public function addFile($localFilePath, $fileName = null, $conflictMode = DuplicationBehavior::CANCEL)
 {
     $fileName = $fileName ? $fileName : PathUtility::basename($localFilePath);
     return $this->storage->addFile($localFilePath, $this, $fileName, $conflictMode);
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:14,代码来源:Folder.php


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