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


PHP Storage::copy方法代碼示例

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


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

示例1: store

 /**
  * Store the Satis configuration.
  *
  * @param  \KevinDierkx\Muse\Http\Requests\Initialize\StoreRequest  $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function store(StoreRequest $request)
 {
     Storage::copy('satis.json.dist', 'satis.json');
     $satis = App::make('satis');
     $satis->update($satis->getConfiguration(), $request->only('name', 'homepage'));
     return Redirect::route('admin.index')->with('success', 'The Satis repository has been successfully initialized!');
 }
開發者ID:kevindierkx,項目名稱:muse,代碼行數:13,代碼來源:InitializeController.php

示例2: index

 public function index()
 {
     if (Storage::disk('local')->has('data.txt')) {
         if (!Storage::disk('local')->has('data_temp.txt')) {
             Storage::copy('data.txt', 'data_temp.txt');
         }
         $file = Storage::disk('local')->get('data.txt');
         if (strlen($file) == 0) {
             $content_temp = Storage::disk('local')->get('data_temp.txt');
             Storage::put('data.txt', $content_temp);
         }
         $file = Storage::disk('local')->get('data.txt');
         $small = substr($file, 0, strpos($file, "\n"));
         $file = substr($file, strpos($file, "\n") + 1);
         Storage::put('data.txt', $file);
         return Response::json(array('line' => $small));
     }
 }
開發者ID:PinkFLoyd92,項目名稱:WebService_TextStorm,代碼行數:18,代碼來源:SentencesController.php

示例3: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     $array = Config::get('mail');
     switch ($this->settings->name) {
         case 'smtp_host':
             $array['host'] = $this->settings->str_value;
             break;
         case 'smtp_port':
             $array['port'] = $this->settings->int_value;
             break;
         case 'smtp_user':
             $array['username'] = $this->settings->str_value;
             break;
         case 'smtp_pass':
             $array['password'] = $this->settings->str_value;
             break;
         case 'smtp_tls':
             switch ($this->settings->int_value) {
                 case 1:
                     $array['encryption'] = 'tls';
                     break;
                 case 2:
                     $array['encryption'] = 'ssl';
                     break;
                 case 0:
                 default:
                     $array['encryption'] = null;
                     break;
             }
             break;
         case 'email_from_address':
             $array['from']['address'] = $this->settings->str_value == '' ? null : $this->settings->str_value;
             break;
         case 'email_from_name':
             $array['from']['name'] = $this->settings->str_value == '' ? null : $this->settings->str_value;
             break;
     }
     $data = var_export($array, 1);
     Storage::copy('/config/mail.php', '/storage/backups/config/mail.' . microtime(true) . '.bu.php');
     Storage::put('/config/mail.php', "<?php\n return {$data} ;");
     unset($array);
     unset($data);
 }
開發者ID:stryker250,項目名稱:simple_ticket,代碼行數:48,代碼來源:UpdateMailConfig.php

示例4: retrieveFile

 public function retrieveFile(Submission $submissions, $file)
 {
     $form = $submissions->formdefinition()->first();
     if ($submissions->group()->users()->get()->contains(Auth::user())) {
         //$file = Storage::get("form/".$form->id."/".$file);
         $filepath = "form/" . $form->id . "/" . $file;
         //Storage::get(form/)
         // if(Storage::exists($filepath)){
         /* if(copy($filepath,"/var/www/calwebtool/public/downloads/".$file)){
                    return respones()->file("downloads/".$file);
                }
                //Storage::copy($filepath,"downloads/".$file);
                return response()->file("downloads/".$file);
            //}
            /*else{
                flash()->overlay("The file does not exist.","Not Found");
                return redirect()->back();
            }*/
         if (Storage::exists($filepath)) {
             if (Storage::exists("downloads/" . $file)) {
                 Storage::delete("downloads/" . $file);
             }
             Storage::copy($filepath, "downloads/" . $file);
             return response()->download("downloads/" . $file);
         }
     }
 }
開發者ID:kcattakcaz,項目名稱:CALwebtool,代碼行數:27,代碼來源:SubmissionController.php

示例5: copyEnv

 /**
  * Copy ENV file.
  *
  * @return $this
  */
 private function copyEnv()
 {
     Storage::copy("{$this->getPath()}/.env.example", "{$this->getPath()}/.env.gitlab");
     return $this;
 }
開發者ID:iolson,項目名稱:support,代碼行數:10,代碼來源:GitlabGenerate.php


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