public static function getInstance() { if (is_null(self::$instance)) { self::$instance = new self(); } return self::$instance; }
protected function simpleProcess() { $upload_path = $this->_getUploadPath(); $newFilename = $this->_getNewFilename(); $file = array('name' => $this->options['file']['name'], 'tmp_name' => $this->options['file']['tmp_name']); $filesize = @filesize($this->options['file']['tmp_name']); ApuImageCropper::getInstance()->crop($file, $newFilename, $this->options['context']); $newFile = $upload_path . DIRECTORY_SEPARATOR . $newFilename; if (move_uploaded_file($this->options['file']['tmp_name'], $newFile)) { $this->uploadedFilename = $newFilename; $this->uploadedFilesize = $filesize; $this->_setOptions(); $this->save(); } }