[FEATURE] Added Input classes from pecee-framework.

- Updated documentation to reflect new changes.
This commit is contained in:
Simon Sessingø
2016-04-15 23:07:51 +02:00
parent 7a429cec1d
commit 17adfb8aa4
6 changed files with 472 additions and 0 deletions
+88
View File
@@ -0,0 +1,88 @@
<?php
namespace Pecee\Http\Input;
class InputFile {
protected $index;
protected $name;
protected $size;
protected $type;
protected $error;
protected $tmpName;
public function getIndex() {
return $this->index;
}
/**
* @return string
*/
public function getName() {
return $this->name;
}
/**
* @return string
*/
public function getSize() {
return $this->size;
}
/**
* @return string
*/
public function getType() {
return $this->type;
}
/**
* @return string
*/
public function getError() {
return $this->error;
}
/**
* @return string
*/
public function getTmpName() {
return $this->tmpName;
}
public function getExtension() {
return pathinfo($this->getName(), PATHINFO_EXTENSION);
}
public function move($destination) {
return move_uploaded_file($this->tmpName, $destination);
}
public function getContents() {
return file_get_contents($this->tmpName);
}
public function setIndex($index) {
$this->index = $index;
}
public function setName($name) {
$this->name = $name;
}
public function setTmpName($name) {
$this->tmpName = $name;
}
public function setSize($size) {
$this->size = $size;
}
public function setType($type) {
$this->type = $type;
}
public function setError($error) {
$this->error = $error;
}
}