mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-28 13:36:02 +03:00
Added more information to the README.md file.
This commit is contained in:
parent
812e4eb048
commit
5293e0e986
30
README.md
30
README.md
@ -9,3 +9,33 @@ currently being migrated over to Github, as well as being updated to support
|
|||||||
modern php features. While the project is in flux I encourage you to try it out,
|
modern php features. While the project is in flux I encourage you to try it out,
|
||||||
but be careful about using it in a production environment without proper
|
but be careful about using it in a production environment without proper
|
||||||
testing.
|
testing.
|
||||||
|
|
||||||
|
Installation
|
||||||
|
============
|
||||||
|
|
||||||
|
The most easy way to install the library is via composer. To do so, you have to do
|
||||||
|
the following:
|
||||||
|
|
||||||
|
php composer.phar require tedivm/fetch
|
||||||
|
|
||||||
|
Composer will then ask you which version you want to install. Until there are stable
|
||||||
|
versions, by using "@dev" it'll install the latest version.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
require 'autoload.php';
|
||||||
|
|
||||||
|
$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";
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user