コード例 #1
0
 /**
  * Handles POST requests for the update page
  *
  * @return \Illuminate\Support\Facades\Redirect
  */
 public function postUpdate()
 {
     // Stage 1 submitted
     if (Input::has('_update')) {
         // Define validation rules
         $validator = Validator::make(Input::all(), array('version' => 'required|in:' . Setup::updateVersions(TRUE)));
         // Run the validator
         if ($validator->passes()) {
             Session::put('setup.version', Input::get('version'));
             Session::put('setup.stage', 2);
             return Redirect::to('setup/update');
         } else {
             Session::flash('messages.error', $validator->messages()->all('<p>:message</p>'));
             return Redirect::to('setup/update')->withInput();
         }
     }
     // Setup complete
     if (Input::has('_finish')) {
         // Submit site statistics
         System::submitStats();
         // Redirect to home page
         return Redirect::to('/');
     }
 }