本文整理汇总了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!');
}
示例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));
}
}
示例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);
}
示例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);
}
}
}
示例5: copyEnv
/**
* Copy ENV file.
*
* @return $this
*/
private function copyEnv()
{
Storage::copy("{$this->getPath()}/.env.example", "{$this->getPath()}/.env.gitlab");
return $this;
}