Esempio n. 1
0
 /**
  * Saves the environment for us
  *
  * @param  string $env
  * @return void
  */
 public function saveEnvironment($env)
 {
     $validator = $this->Validator->make(['environment' => $env], ['environment' => 'required|alpha']);
     if ($validator->fails()) {
         $this->errors = $validator->errors();
         return;
     }
     $this->EnvironmentFileManager->merge(['APP_ENV' => $env]);
 }
Esempio n. 2
0
 /**
  * [uploadValidate description]
  * @param  string $section [description]
  * @return [type]          [description]
  */
 public function uploadValidate($section = 'files')
 {
     // Make validation
     $validator = $this->validator->make($this->input, $this->rules[$section], $this->messages);
     if ($validator->fails()) {
         $this->errors = $validator->messages();
         return false;
     }
     return true;
 }
Esempio n. 3
0
 /**
  * crom animated gif's frames
  * @param  [type] $width  [description]
  * @param  [type] $height [description]
  * @param  [type] $x      [description]
  * @param  [type] $y      [description]
  * @return [type]         [description]
  */
 protected function _cropAnimated($width, $height, $x = null, $y = null)
 {
     $framesProcessed = array();
     foreach ($this->frames as $frame) {
         $this->imgFileRes = $this->interImage->make($frame['image']);
         $this->_crop($width, $height, $x, $y);
         $frameProcessed = array('image' => $this->imgFileRes->getCore(), 'duration' => $frame['duration']);
         $framesProcessed[] = $frameProcessed;
     }
     $this->frames = $framesProcessed;
 }