Welcome Guest, Not a member yet? Register   Sign In
Basics of PHP Frameworks
#12

(08-13-2017, 09:11 AM)skunkbad Wrote:
(08-13-2017, 05:51 AM)Paradinight Wrote:
(08-11-2017, 05:48 PM)skunkbad Wrote:
(08-09-2017, 04:48 PM)shannon Wrote: Below is a list of functions I need to build into the app - how much would already exist in the framework?
  1. Check IMAP email Inbox
  2. Get message and check for attachment
  3. Extract attachment and read contents of text file
  4. Re-format and export into CSV
  5. SFTP CSV to another server
  6. Send CSV as attachment

CodeIgniter will do none of this, and I'm not aware of any frameworks that have IMAP and SFTP libraries. You're going to need to find these libraries, or make your own.

For SFTP, I use phpseclib. It works great.

For IMAP, I made my own, but can't share because it's something that I was paid to create.

For imap, i am using zend mail Smile.

A framework should not do all the things.

That's interesting. It works with CI, or you wouldn't mention it, right? ... and it does all of the things OP was asking for related to IMAP? If it does, can you link me up?

https://docs.zendframework.com/zend-mail/

PHP Code:
// Connecting with Imap:
$mail = new Imap([
    
'host'     => 'xxx',
    
'user'     => 'xxx',
    
'password' => 'xxx',
]);

foreach (
$mail as $messageNum => $message) {
    echo 
$message->subject;

    
// Check for attachment
    
if ($message->isMultipart()) {
        foreach (
$message as $part) {
            if (
$part->getHeaders()->has('Content-Disposition')) {
                
$fileName $part->getHeader('Content-Description')->getFieldValue();

                
$content base64_decode($part->getContent());

                
file_put_contents(__DIR__.'/'.$fileName,$content);
            }

        }
    }


@skunkbad an example for you. codeigniter work with composer.
Reply


Messages In This Thread
Basics of PHP Frameworks - by shannon - 08-09-2017, 04:48 PM
RE: Basics of PHP Frameworks - by jarmen_kell - 08-09-2017, 07:17 PM
RE: Basics of PHP Frameworks - by marksman - 08-10-2017, 03:29 AM
RE: Basics of PHP Frameworks - by InsiteFX - 08-10-2017, 04:20 AM
RE: Basics of PHP Frameworks - by shannon - 08-11-2017, 12:20 AM
RE: Basics of PHP Frameworks - by jarmen_kell - 08-11-2017, 06:30 AM
RE: Basics of PHP Frameworks - by Kaosweaver - 08-11-2017, 09:19 AM
RE: Basics of PHP Frameworks - by skunkbad - 08-11-2017, 05:48 PM
RE: Basics of PHP Frameworks - by Paradinight - 08-13-2017, 05:51 AM
RE: Basics of PHP Frameworks - by skunkbad - 08-13-2017, 09:11 AM
RE: Basics of PHP Frameworks - by Paradinight - 08-13-2017, 11:29 AM
RE: Basics of PHP Frameworks - by ciadvantage - 08-12-2017, 11:59 AM
RE: Basics of PHP Frameworks - by ciadvantage - 08-13-2017, 04:32 PM
RE: Basics of PHP Frameworks - by CINewb - 08-16-2017, 04:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB