diff --git a/README.md b/README.md index 4beb9b5..502cf6c 100644 --- a/README.md +++ b/README.md @@ -17,19 +17,19 @@ Simply set the configuration file with the details for your account and path to require("BitFunnel.php"); -$config = array(); - -$config['account'][0]['server']['host'] = "imap.gmail.com"; //eg. imap.gmail.com -$config['account'][0]['server']['port'] = "993"; //eg IMAP SSL (Gmail Default) -$config['account'][0]['server']['user'] = "foo"; -$config['account'][0]['server']['password'] = "bar"; -$config['account'][0]['server']['flags'][] = "imap"; //Gmail defaults -$config['account'][0]['server']['flags'][] = "ssl"; //Gmail defaults -$config['account'][0]['server']['mailbox'] = "INBOX"; // eg. INBOX (Gmail Default) -$config['account'][0]['savePath'] = "attachments/"; - - -$myAccount = $config['account'][0]; +$myAccount = array( + 'account' => array( + 'server' => array( + 'host' => 'imap.gmail.com' + , 'port' => '993' + , 'user' => 'youruser' + , 'password' => 'swordfish' + , 'flags' => array('imap', 'ssl') + , 'mailbox' => "INBOX" + ) + , 'savepath' => 'attachments/' + ) +); //grab the attachments $bitFunnel = new BitFunnel($myAccount); diff --git a/config.php b/config.php index 3b27b14..e7baed8 100644 --- a/config.php +++ b/config.php @@ -4,22 +4,17 @@ config.php - Sets an array with connection details for your remote IMAP server. -*/ +HOST - Internet domain name or bracketed IP address of server. -//HOST - Internet domain name or bracketed IP address of server. -$config['account'][0]['server']['host'] = "imap.gmail.com"; //eg. imap.gmail.com +PORT - optional TCP port number, default is the default port for that service -//PORT - optional TCP port number, default is the default port for that service -$config['account'][0]['server']['port'] = "993"; //eg IMAP SSL (Gmail Default) +USER - your account name -//USERNAME - your account name -$config['account'][0]['server']['user'] = ""; -//PASSWORD - your account password -$config['account'][0]['server']['password'] = ""; +PASSWORD - your account password + -/* FLAGS - optional flags, see following table. /service=service mailbox access service, default is "imap" @@ -38,14 +33,29 @@ /tls force use of start-TLS to encrypt the session, and reject connection to servers that do not support it /notls do not do start-TLS to encrypt the session, even with servers that support it /readonly request read-only mailbox open (IMAP only; ignored on NNTP, and an error with SMTP and POP3) -*/ -$config['account'][0]['server']['flags'][] = "imap"; //Gmail defaults -$config['account'][0]['server']['flags'][] = "ssl"; //Gmail defaults -//MAILBOX - remote mailbox name, default is INBOX -$config['account'][0]['server']['mailbox'] = "INBOX"; // eg. INBOX (Gmail Default) -//SAVEPATH - where to save attachments on the local server -$config['account'][0]['savePath'] = "attachments/"; \ No newline at end of file +MAILBOX - remote mailbox name, default is INBOX + + +SAVEPATH - where to save attachments on the local server + + +*/ + +return array( + 'account' => array( + 'server' => array( + 'host' => 'imap.gmail.com' + , 'port' => '993' + , 'user' => 'youruser' + , 'password' => 'swordfish' + , 'flags' => array('imap', 'ssl') + , 'mailbox' => "INBOX" + ) + , 'savepath' => 'attachments/' + ) +); + diff --git a/example.php b/example.php index fb64c9c..42a9754 100644 --- a/example.php +++ b/example.php @@ -1,8 +1,11 @@