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

(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?
Reply
#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
#13

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

I was in the same boat as the OP.

Been writing PHP for over 10 years, always wanted to learn a framework but never had time.

Even now my time is stretched to the limit but for my last project I sacraficed evenings and weekends to learn Code Igniter. There was some overhead in doing so but I don't regret it, and I know the next project will be much quicker to develop than doing it in plain PHP.

There's a story about a wood cutter who spends an entire day sharpening his axe, but at the end of it he can cut wood much faster than if he started straight away with a blunt axe. We should all try and sharpen our axes now and again even if it feels like we don't have the time.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB