/** * 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!'); }
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)); } }
/** * 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); }
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); } } }
/** * Copy ENV file. * * @return $this */ private function copyEnv() { Storage::copy("{$this->getPath()}/.env.example", "{$this->getPath()}/.env.gitlab"); return $this; }