Fetch/README.md

68 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

2014-05-21 12:16:33 +04:00
# Fetch [![Build Status](https://travis-ci.org/tedious/Fetch.svg?branch=master)](https://travis-ci.org/tedious/Fetch)
2013-12-19 04:59:03 +04:00
2014-05-21 12:16:33 +04:00
[![License](http://img.shields.io/packagist/l/tedivm/fetch.svg)](https://github.com/tedious/fetch/blob/master/LICENSE)
[![Latest Stable Version](http://img.shields.io/github/release/tedious/fetch.svg)](https://packagist.org/packages/tedivm/fetch)
[![Coverage Status](http://img.shields.io/coveralls/tedious/Fetch.svg)](https://coveralls.io/r/tedious/Fetch?branch=master)
2014-05-05 10:15:10 +04:00
[![Total Downloads](http://img.shields.io/packagist/dt/tedivm/fetch.svg)](https://packagist.org/packages/tedivm/fetch)
2012-06-11 01:57:02 +04:00
2012-06-12 06:49:24 +04:00
Fetch is a library for reading email and attachments, primarily using the POP
and IMAP protocols.
2013-12-19 04:59:03 +04:00
## Installing
2015-05-06 15:57:13 +03:00
> N.b. A note on Ubuntu 14.04 (probably other Debian-based / Apt managed systems), the install of php5-imap does not enable the extension for CLI (possibly others as well), which can cause composer to report fetch requires ext-imap
```
sudo ln -s /etc/php5/mods-available/imap.ini /etc/php5/cli/conf.d/30-imap.ini
```
2013-12-19 04:59:03 +04:00
### Composer
Installing Fetch can be done through a variety of methods, although Composer is
recommended.
Until Fetch reaches a stable API with version 1.0 it is recommended that you
review changes before even Minor updates, although bug fixes will always be
backwards compatible.
```
"require": {
"tedivm/fetch": "0.6.*"
2013-12-19 04:59:03 +04:00
}
```
### Pear
2013-12-19 04:59:03 +04:00
Fetch is also available through Pear.
2013-12-19 04:59:03 +04:00
```
$ pear channel-discover pear.tedivm.com
$ pear install tedivm/Fetch
```
2013-12-19 04:59:03 +04:00
### Github
2014-05-21 12:16:33 +04:00
Releases of Fetch are available on [Github](https://github.com/tedious/Fetch/releases).
2013-12-19 04:59:03 +04:00
## Sample Usage
This is just a simple code to show how to access messages by using Fetch. It uses Fetch
own autoload, but it can (and should be, if applicable) replaced with the one generated
by composer.
$server = new \Fetch\Server('imap.example.com', 993);
$server->setAuthentication('dummy', 'dummy');
$messages = $server->getMessages();
/** @var $message \Fetch\Message */
foreach ($messages as $message) {
echo "Subject: {$message->getSubject()}\nBody: {$message->getMessageBody()}\n";
}
2013-12-19 04:59:03 +04:00
## License
2013-12-19 05:02:34 +04:00
Fetch is licensed under the BSD License. See the LICENSE file for details.