From: David K. <da...@ke...> - 2021-04-13 14:00:08
|
Looking at the iconv documentation that Lonnie pointed us at reminded me of something I do. I see in iconv that one of the things it can do is decode MIME. I needed to do exactly that a while ago when I decided to implement email-to-fax. Now there are a bunch of things that you need to do for email-to-fax that are way beyond what AstLinux can or should do. Unpacking email attachments from MIME is one, converting PDF to TIFF another. The answer was not to try and add lots of packages to AstLinux to accomplish this, the answer was in LXC containers. I have a "standard" linux distribution sitting inside LXC and I can pretty much install anything I need. Example usage... # extract all attached files result="$(lxc-attach -n fax -- munpack -f -q -C /mnt$tmpdir $tmpfile.mail)" # find PDF files only. Assumes only one attached PDF file" pdffile="$(echo "$result" | sed -n -e 's/[ ]*(application\/pdf).*//p')" # convert PDF to TIFF file format result="$(lxc-attach -n fax -- gs -q -dNOPAUSE -dBATCH -sDEVICE=tiffg4 -sPAPERSIZE=letter -sOutputFile=/mnt$tmpdir/$tmpfile.tiff /mnt$tmpdir/$pdffile)" My point being, we sometimes have to expand our thinking. When LXC was added to AstLinux it became a game changer for me. There is so much more possible now, while still preserving the lightweight nature of AstLinux itself -- currently I have 5 instances of Ubuntu sitting in LXC containers each with a single purpose (e.g. fax, homebridge, unifi). David On Tue, Apr 13, 2021 at 9:24 AM Lonnie Abelbeck <li...@lo...> wrote: > I'll look into enabling libcurl support in PHP, as David has been building > with it for a long time. > > As for "iconv", AFAIK this has nothing to do with parsing CSV, but rather > language character set conversion using libiconv [1] which is not the first > choice to other solutions. > > Matthew, if you are looking for CSV parsing, take a look at str_getcsv() > which we have. > > Lonnie > > [1] https://www.php.net/manual/en/book.iconv.php > > > > > > On Apr 13, 2021, at 7:55 AM, David Kerr <da...@ke...> wrote: > > > > Correction... Astlinux PHP version (7.2) is already at end-of-life. > > https://www.php.net/supported-versions.php > > > > David. > > > > ---------- Forwarded message --------- > > From: David Kerr <da...@ke...> > > Date: Tue, Apr 13, 2021 at 8:53 AM > > Subject: Re: [Astlinux-devel] FW: Astlinux PHP packages > > To: AstLinux Developers Mailing List < > ast...@li...> > > > > > > As many of you probably know I have my own custom build of Astlinux. > PHP-curl is one of the packages I included long ago. I don't recall why, I > just know that I discovered I needed it for something so I turned it on. > So I'll add my vote to Michaels request. > > > > While on the subject of PHP it may be worth observing that our current > version goes out-of-support in ~7 months. So an upgrade to version 8 needs > to be considered. I didn't know there was a version 8 until I ran across > the need to test for a string within a string and googling suggested I use > str_contains() function. Cool thinks I. Turns out that is a new function > added to v8 so not available to me yet. > > > > David. > > > > On Tue, Apr 13, 2021 at 12:55 AM Michael Knill < > mic...@ip...> wrote: > > Hi Devs > > > > > > > > Matthew (my developer) mentioned that the below PHP packages would be > very desirable to have included in the standard Astlinux build. Yes I know > I can roll my own but it is such a pain and others are so much better at it > than us. > > > > > > > > We are starting to do quite a bit of API integration and php-curl is > commonly required. My understanding is that they are pretty small. > > > > > > > > Thanks > > > > > > > > Regards > > > > Michael Knill > > > > > > > > From: Matthew Knill <mat...@ip...> > > Date: Tuesday, 13 April 2021 at 12:11 pm > > To: Michael Knill <mic...@ip...> > > Subject: Astlinux PHP packages > > > > > > > > • php7.2-curl – this package will be useful for making HTTP > requests directly from PHP and is used to integrate with many APIs (i.e. we > would use it for Mailgun integration) > > • php7.2-iconv – this package will be useful for converting > encoding for CSV imports (which we use for importing from a CSV to LDAP > directory) > > > > > > Regards, > > > > Matthew Knill > > > > > > > > _______________________________________________ > > Astlinux-devel mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/astlinux-devel > > _______________________________________________ > > Astlinux-devel mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/astlinux-devel > > > > _______________________________________________ > Astlinux-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/astlinux-devel > |