Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improved README.md
  • Loading branch information
sergeyklay committed Nov 23, 2016
commit b42b4eefb5eafbb0505eb1bdecc6c7c0f0d65e85
45 changes: 28 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,28 @@ and IMAP protocols.


## Installing
> 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
```

> 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`

```sh
sudo ln -s /etc/php5/mods-available/imap.ini /etc/php5/cli/conf.d/30-imap.ini
```

### Composer

Installing Fetch can be done through a variety of methods, although Composer is
recommended.
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.*"
"tedivm/fetch": "0.7.*"
}
```

Expand All @@ -41,27 +46,33 @@ $ pear install tedivm/Fetch

### Github

Releases of Fetch are available on [Github](https://github.com/tedious/Fetch/releases).
Releases of Fetch are available on [Github][:releases:].


## 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.

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');
```php
use Fetch\Server;
use Fetch\Message;

$server = new 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";
}
/** @var $message Message[] */
$messages = $server->getMessages();

foreach ($messages as $message) {
echo "Subject: {$message->getSubject()}", PHP_EOL;
echo "Body: {$message->getMessageBody()}", PHP_EOL;
}
```

## License

Fetch is licensed under the BSD License. See the LICENSE file for details.

[:releases:]: https://github.com/tedious/Fetch/releases