Skip to content

Commit

Permalink
Merge pull request #185 from pdffiller/minor-fixes
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
tedivm authored Nov 26, 2016
2 parents adb70ad + 4053148 commit 9a1b0eb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 5.5
- 5.6
- hhvm
- hhvm-nightly
Expand Down
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('username', 'password');
$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
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>
<testsuites>
<testsuite name="Fetch Test Suite">
<directory>./tests</directory>
<directory>./tests/Fetch</directory>
</testsuite>
</testsuites>
<filter>
Expand Down
5 changes: 3 additions & 2 deletions tests/runTests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#/usr/bin/env/sh
#!/usr/bin/env bash

set -e

if [ ! -n "$TRAVIS" ]; then
Expand All @@ -14,4 +15,4 @@ echo ''
echo ''
echo 'Testing for Coding Styling Compliance.'
echo 'All code should follow PSR standards.'
./vendor/bin/php-cs-fixer fix ./ --level="all" -vv --dry-run
./vendor/bin/php-cs-fixer fix ./ --level="all" -vv --dry-run

0 comments on commit 9a1b0eb

Please sign in to comment.