public function __construct($userfile) { $file = $_FILES[us($userfile)]; $this->name = $file['name']; $this->type = $file['type']; $this->size = $file['size']; $this->tmp_name = $file['tmp_name']; $this->error = $file['error']; parent::__construct($this->tmp_name); }
public function __construct($path, $parent = NULL) { Charcoal_ParamTrait::validateString(1, $path); Charcoal_ParamTrait::validateIsA(2, 'Charcoal_File', $parent, TRUE); parent::__construct($path, $parent); if (!is_readable(parent::getPath())) { _throw(new Charcoal_FileNotFoundException($this)); } $this->_data = getimagesize(parent::getPath()); if ($this->_data === FALSE) { _throw(new Charcoal_ImageGetSizeException($this)); } }