/** * Constructor * * @param string $name, the full filename of the file or dir * @param integer $from, the file path is : self::FILE_SYSTEM or self::WEBROOT * @param integer $type, the type of the current object : self::TYPE_FILE for a file, self::TYPE_DIRECTORY for a dir, false for undefined * @return void */ function __construct($name, $from = self::FILE_SYSTEM, $type = self::TYPE_FILE) { parent::__construct($name, $from, $type); if (!in_array($this->getExtension(), array('gif', 'png', 'jpg', 'jpe', 'jpeg'))) { $this->raiseError('File extension is not a valid image extension : ' . $this->getExtension()); return false; } }