當前位置: 首頁>>代碼示例>>PHP>>正文


PHP storage::disk方法代碼示例

本文整理匯總了PHP中storage::disk方法的典型用法代碼示例。如果您正苦於以下問題:PHP storage::disk方法的具體用法?PHP storage::disk怎麽用?PHP storage::disk使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在storage的用法示例。


在下文中一共展示了storage::disk方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setup

 /**
  * @param $contract
  * @return array
  * @throws \Exception
  */
 public function setup($contract)
 {
     $this->logger->info('Download started...', ['file' => $contract->file]);
     $pdfFile = '';
     try {
         $pdfFile = $this->storage->disk('s3')->get($contract->file);
     } catch (\Exception $e) {
         $this->logger->error($e->getMessage(), ['contract id' => $contract->id, 'file' => $contract->file]);
     }
     $this->storage->disk('local')->put($contract->file, $pdfFile);
     $this->logger->info('Download completed...', ['file' => $pdfFile]);
     if (!$this->fileSystem->isDirectory($this->getContractDirectory($contract->id))) {
         $this->addDirectory($contract->id, $this->getWriteDirectory());
     }
     $writeFolderPath = $this->getContractDirectory($contract->id);
     $readFilePath = sprintf('%s/app/%s', storage_path(), $contract->file);
     return [$writeFolderPath, $readFilePath];
 }
開發者ID:sadhakbj,項目名稱:resourcecontracts.org,代碼行數:23,代碼來源:ProcessService.php

示例2: configAboutUs

 /**
  * @Post("config/module/aboutUs")
  */
 public function configAboutUs(Request $request)
 {
     $file = \Storage::disk('modules')->get('home/aboutUs.blade.php');
     if ($request->description1 != "" || $request->description2 != "" || $request->description3 != "") {
         if ($request->description1 != "") {
             $file = preg_replace("/(<!--text1-->)(.*)(<!--endtext1-->)/", "<!--text1-->" . $request->description1 . "<!--endtext1-->", $file);
         }
         if ($request->description2 != "") {
             $file = preg_replace("/(<!--text2-->)(.*)(<!--endtext2-->)/", "<!--text2-->" . $request->description2 . "<!--endtext2-->", $file);
         }
         if ($request->description3 != "") {
             $file = preg_replace("/(<!--text3-->)(.*)(<!--endtext3-->)/", "<!--text3-->" . $request->description3 . "<!--endtext3-->", $file);
         }
     }
     \Storage::disk('modules')->put('home/aboutUs.blade.php', $file);
     if (isset($request->image1)) {
         $image = $request->file('image1');
         $nombre = $image->getClientOriginalName();
         $format = substr($nombre, -3);
         \Storage::disk('local')->put('modules/aboutUs/img1.' . $format, \File::get($image));
         $file = \Storage::disk('modules')->get('home/aboutUs.blade.php');
         $file = preg_replace("/(jpg)|(png)|(jpeg)/", $format, $file);
         \storage::disk('modules')->put('home/aboutUs.blade.php', $file);
     }
     if (isset($request->image2)) {
         $image = $request->file('image2');
         $nombre = $image->getClientOriginalName();
         $format = substr($nombre, -3);
         \Storage::disk('local')->put('modules/aboutUs/img2.' . $format, \File::get($image));
         $file = \Storage::disk('modules')->get('home/aboutUs.blade.php');
         $file = preg_replace("/(jpg)|(png)|(jpeg)/", $format, $file);
         \storage::disk('modules')->put('home/aboutUs.blade.php', $file);
     }
     if (isset($request->image3)) {
         $image = $request->file('image3');
         $nombre = $image->getClientOriginalName();
         $format = substr($nombre, -3);
         \Storage::disk('local')->put('modules/aboutUs/img3.' . $format, \File::get($image));
         $file = \Storage::disk('modules')->get('home/aboutUs.blade.php');
         $file = preg_replace("/(jpg)|(png)|(jpeg)/", $format, $file);
         \storage::disk('modules')->put('home/aboutUs.blade.php', $file);
     }
     $file = \Storage::disk('modules')->get('home/aboutUs.blade.php');
     if (isset($request->fontFormat)) {
         switch ($request->fontFormat) {
             case '1':
                 $file = preg_replace("/(font-family)(.*)/", "font-family: 'Courier New', Courier, monospace;", $file);
                 \storage::disk('modules')->put('home/aboutUs.blade.php', $file);
                 break;
             case '2':
                 $file = preg_replace("/(font-family)(.*)/", "font-family: Georgia, 'Times New Roman', Times, serif;", $file);
                 \storage::disk('modules')->put('home/aboutUs.blade.php', $file);
                 break;
             case '3':
                 $file = preg_replace("/(font-family)(.*)/", "font-family: Verdana, Arial, Helvetica, sans-serif;", $file);
                 \storage::disk('modules')->put('home/aboutUs.blade.php', $file);
                 break;
             case '4':
                 $file = preg_replace("/(font-family)(.*)/", "font-family: 'Times New Roman', Times, serif;", $file);
                 \storage::disk('modules')->put('home/aboutUs.blade.php', $file);
                 break;
             case '5':
                 $file = preg_replace("/(font-family)(.*)/", "font-family: Arial, Helvetica, sans-serif;", $file);
                 \storage::disk('modules')->put('home/aboutUs.blade.php', $file);
                 break;
         }
     }
     $file = \Storage::disk('modules')->get('home/aboutUs.blade.php');
     if (isset($request->descriptionColor)) {
         $file = preg_replace("/(.image_under_monitor{background-color)(.*)/", ".image_under_monitor{background-color:" . $request->descriptionColor . ";", $file);
         \storage::disk('modules')->put('home/aboutUs.blade.php', $file);
     }
     if (isset($request->backgroundColor)) {
         $file = preg_replace("/(aboutUs{background-color)(.*)/", "aboutUs{background-color:" . $request->backgroundColor . ";", $file);
         \storage::disk('modules')->put('home/aboutUs.blade.php', $file);
     }
     if (isset($request->fontColor)) {
         $file = preg_replace("/(box{color)(.*)/", "box{color:" . $request->fontColor . ";", $file);
         \storage::disk('modules')->put('home/aboutUs.blade.php', $file);
     }
     return Redirect::to("config/modulos/home");
 }
開發者ID:JuanmaBM,項目名稱:Sport-Center-Manager,代碼行數:85,代碼來源:ConfigController.php


注:本文中的storage::disk方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。