From 464f4d3497617fadb9d7752868f1175849cfa6d2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 7 Jan 2012 08:21:00 -0800 Subject: Refactor to separate the framework from the app; drop message stuff, this app is just user management. Add a json view for individual users --- src/ext/MimeMailParser_attachment.class.php | 136 ---------------------------- 1 file changed, 136 deletions(-) delete mode 100644 src/ext/MimeMailParser_attachment.class.php (limited to 'src/ext/MimeMailParser_attachment.class.php') diff --git a/src/ext/MimeMailParser_attachment.class.php b/src/ext/MimeMailParser_attachment.class.php deleted file mode 100644 index 6bd327c..0000000 --- a/src/ext/MimeMailParser_attachment.class.php +++ /dev/null @@ -1,136 +0,0 @@ -filename = $filename; - $this->content_type = $content_type; - $this->stream = $stream; - $this->content = null; - $this->content_disposition = $content_disposition; - $this->headers = $headers; - } - - /** - * retrieve the attachment filename - * @return String - */ - public function getFilename() { - return $this->filename; - } - - /** - * Retrieve the Attachment Content-Type - * @return String - */ - public function getContentType() { - return $this->content_type; - } - - /** - * Retrieve the Attachment Content-Disposition - * @return String - */ - public function getContentDisposition() { - return $this->content_disposition; - } - - /** - * Retrieve the Attachment Headers - * @return String - */ - public function getHeaders() { - return $this->headers; - } - - /** - * Retrieve the file extension - * @return String - */ - public function getFileExtension() { - if (!$this->extension) { - $ext = substr(strrchr($this->filename, '.'), 1); - if ($ext == 'gz') { - // special case, tar.gz - // todo: other special cases? - $ext = preg_match("/\.tar\.gz$/i", $ext) ? 'tar.gz' : 'gz'; - } - $this->extension = $ext; - } - return $this->extension; - } - - /** - * Read the contents a few bytes at a time until completed - * Once read to completion, it always returns false - * @return String - * @param $bytes Int[optional] - */ - public function read($bytes = 2082) { - return feof($this->stream) ? false : fread($this->stream, $bytes); - } - - /** - * Retrieve the file content in one go - * Once you retreive the content you cannot use MimeMailParser_attachment::read() - * @return String - */ - public function getContent() { - if ($this->content === null) { - fseek($this->stream, 0); - while(($buf = $this->read()) !== false) { - $this->content .= $buf; - } - } - return $this->content; - } - - /** - * Allow the properties - * MimeMailParser_attachment::$name, - * MimeMailParser_attachment::$extension - * to be retrieved as public properties - * @param $name Object - */ - public function __get($name) { - if ($name == 'content') { - return $this->getContent(); - } else if ($name == 'extension') { - return $this->getFileExtension(); - } - return null; - } - -} - -?> \ No newline at end of file -- cgit v1.2.3-2-g168b