• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basics of PHP Frameworks

#11
(08-13-2017, 06:51 AM)Paradinight Wrote:
(08-11-2017, 06:48 PM)skunkbad Wrote:
(08-09-2017, 05: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?
Reply

#12
(08-13-2017, 10:11 AM)skunkbad Wrote:
(08-13-2017, 06:51 AM)Paradinight Wrote:
(08-11-2017, 06:48 PM)skunkbad Wrote:
(08-09-2017, 05: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

#13
I almost made all libraries and tools class for my projects! However the fact that CI is great!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.