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


PHP Filesystem::put方法代码示例

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


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

示例1: processFile

 /**
  * Process a php target file to append PHP syntax-sensitive content 
  * from multiple template sources.
  *
  * @param  string $file, a php file to modify
  * @param  array  $templates list of key (property name), value (template file)
  * @param  string $data used to replace placeholders inside all template files
  * @param Boolean $front, set location to the front of the array 
  */
 protected function processFile($file, $templates, $data, $front = false)
 {
     $content = $this->files->get($file);
     $phpParser = new GenericPhpParser($content, $data, $this->parser);
     foreach ($templates as $property => $template) {
         $phpParser->parse($property, $template, $front);
     }
     $content = $phpParser->prettyPrint();
     if (!is_null($content)) {
         $this->files->put($file, $content);
     }
 }
开发者ID:Kre8ivTech,项目名称:entity_builder-extension,代码行数:21,代码来源:FileProcessor.php

示例2: put

 /**
  * Write the contents of a file
  *
  * @param  string  $path
  * @param  string  $contents
  * @param  bool  $lock
  * @return int
  */
 public function put($path, $contents, $avoid = false, $lock = false)
 {
     return $this->files->put($path, $contents, $avoid, $lock);
 }
开发者ID:websemantics,项目名称:entity_builder-extension,代码行数:12,代码来源:FileProcessor.php

示例3: exportToJson

 private function exportToJson($sJsonFilePath, array $aData, $bCompress = false)
 {
     $sNewJsonContent = Conversion::getJsonFromArray($aData, $bCompress);
     if (Filesystem::put($sJsonFilePath, $sNewJsonContent) !== false) {
         return Filesystem::name($sJsonFilePath) . '.' . Filesystem::extension($sJsonFilePath);
     } else {
         throw new FileNotCreatedException('File : ' . $sJsonFilePath);
     }
 }
开发者ID:rali-udem,项目名称:JSrealB,代码行数:9,代码来源:JSRealService.php

示例4: testFailingPut

 public function testFailingPut()
 {
     $mock = \Mockery::mock('League\\Flysystem\\Adapter\\AbstractAdapter');
     $cachemock = \Mockery::mock('League\\Flysystem\\Cache\\AbstractCache');
     $cachemock->shouldReceive('load')->andReturn(array());
     $cachemock->shouldReceive('has')->andReturn(false);
     $cachemock->shouldReceive('isComplete')->andReturn(false);
     $cachemock->shouldReceive('updateObject')->andReturn(false);
     $mock->shouldReceive('__toString')->andReturn('Flysystem\\Adapter\\AbstractAdapter');
     $cachemock->shouldReceive('__toString')->andReturn('Flysystem\\Cache\\AbstractCache');
     $filesystem = new Filesystem($mock, $cachemock);
     $mock->shouldReceive('write')->andReturn(false);
     $mock->shouldReceive('update')->andReturn(false);
     $mock->shouldReceive('has')->with('dummy.txt')->andReturn(true);
     $this->assertFalse($filesystem->put('dummy.txt', 'content'));
     $mock->shouldReceive('has')->with('dummy2.txt')->andReturn(false);
     $this->assertFalse($filesystem->put('dummy2.txt', 'content'));
 }
开发者ID:luoshulin,项目名称:falcon,代码行数:18,代码来源:FilesystemTests.php


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