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


PHP Filesystem::get方法代码示例

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


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

 public function create(array $data)
 {
     try {
         $this->validator->with($data)->passesOrFail(ValidatorInterface::RULE_CREATE);
         $projectFile = $this->repository->skipPresenter()->create($data);
         $this->storage->put($projectFile->getFileName(), $this->filesystem->get($data['file']));
         return ['success' => true];
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessageBag(), "messageDev" => 'ValidatorException'];
     } catch (\Exception $e) {
         return ["error" => true, "message" => 'Falha ao gravar registro.', "messageDev" => $e->getMessage()];
     }
 }
开发者ID:jonasleitep4,项目名称:curso-laravel-angular,代码行数:13,代码来源:ProjectFileService.php

示例3: extendLexicon

 protected function extendLexicon(array &$aLexicon)
 {
     $sPatchFile = Config::get('path.real.root') . Config::get('path.relative.root_to_app') . Config::get('path.relative.app_to_data') . Config::get('jsreal.lexicon.simple_nlg.extension.' . $this->sLanguage);
     $sJsonExtension = Filesystem::get($sPatchFile);
     $aExtension = Conversion::getArrayFromJson($sJsonExtension);
     $aLexicon = array_merge_recursive($aLexicon, $aExtension);
 }
开发者ID:rali-udem,项目名称:JSrealB,代码行数:7,代码来源:JSRealService.php

示例4: newTempDir

 protected static function newTempDir()
 {
     $tmp['tok'] = getUser() . time() . rand(5, 20);
     $tmp['dir'] = addslash(self::$config['tempdir']) . '.rutorrent/.fman/' . $tmp['tok'] . '/';
     Filesystem::get()->mkdir($tmp['dir'], true, 777);
     return $tmp;
 }
开发者ID:stroebs,项目名称:rutorrent-thirdparty-plugins,代码行数:7,代码来源:Helper.php

示例5: getTemplate

 /**
  * Get a form template by name
  *
  * @param  string $type
  * @return string
  */
 protected function getTemplate($type = 'list')
 {
     return $this->file->get(static::$templatePath . "/{$type}.txt");
 }
开发者ID:amaly,项目名称:laravel-generators,代码行数:10,代码来源:FormDumperGenerator.php

示例6: applyLexiconPatchToTestVerb

 protected function applyLexiconPatchToTestVerb(array &$aTestConjugatedVerb)
 {
     $aTenseList = array('p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'ps1', 'ps2', 'ps3', 'ps4', 'ps5', 'ps6', 's1', 's2', 's3', 's4', 's5', 's6', 'ip2', 'ip4', 'ip5', 'pr', 'pp');
     $sPatchFile = Config::get('path.real.root') . Config::get('path.relative.root_to_app') . Config::get('path.relative.app_to_data') . Config::get('jsreal.lexicon.simple_nlg.patch.' . $this->sLanguage);
     $sJsonPatch = Filesystem::get($sPatchFile);
     $aPatch = Conversion::getArrayFromJson($sJsonPatch);
     foreach ($aPatch as $sUnit => $aInfo) {
         if (isset($aInfo['V'])) {
             foreach ($aInfo['V'] as $sTenseAndPerson => $sConjugatedVerb) {
                 if (Arr::in($aTenseList, $sTenseAndPerson)) {
                     $aTestConjugatedVerb[$sUnit][$sTenseAndPerson] = $sConjugatedVerb;
                 }
             }
         }
     }
 }
开发者ID:rali-udem,项目名称:JSrealB,代码行数:16,代码来源:JSRealFrService.php

示例7: __construct

 public function __construct($sFileRealPath, $sStrStart, $sStrEnd)
 {
     $sFullContent = Filesystem::get($sFileRealPath);
     $this->sSelectedContent = Str::getStringBetween($sFullContent, $sStrStart, $sStrEnd);
 }
开发者ID:rali-udem,项目名称:JSrealB,代码行数:5,代码来源:DmParser.php

示例8: testCopyFails

 public function testCopyFails()
 {
     $adapter = $this->getMock('League\\Flysystem\\AdapterInterface');
     $adapter->expects($this->exactly(2))->method('has')->withConsecutive(['file.txt'], ['files/copied.txt'])->willReturnOnConsecutiveCalls(true, false);
     $adapter->expects($this->once())->method('copy')->with('file.txt', 'files/copied.txt')->willReturn(false);
     $filesystem = new Filesystem($adapter);
     /** @var File $file */
     $file = $filesystem->get('file.txt', new File());
     $result = $file->copy('files/copied.txt');
     $this->assertFalse($result);
 }
开发者ID:mechiko,项目名称:staff-october,代码行数:11,代码来源:FileTests.php


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