Tags: php


  06:03:00 pm, by The Dreamer   , 976 words  
Categories: FreeBSD, CFEngine

Wonder if this will work - package_method=>freebsd_portmaster and /var/db/pkg

On my FreeBSD system, my apache webserver would get angry whenever I update the php & extensions ports. Requiring a bunch of other operations after the 'portmaster -a'.

Since I've been playing around with CFEngine 3, I had started to add to my "bundle agent apache", to do more than just promise config files current, process running, reloads, etc.

So, one of the first problems I had run into on FreeBSD, is that there are certain extensions that need to be in order in '/usr/local/etc/php/extension.ini'. Which is solved by using fixphpextorder.sh.

Well, fortunately when this script is run it results in a backup file of 'extensions.ini.old' which is the same age or newer than 'extennsions.ini'.

CFEngine3 can take care of it this way:


    "ext_dir"       string => "/usr/local/etc/php";
    "ext_file"      string => "extensions.ini";
    "fix_php_ext"   string => "/usr/local/etc/fixphpextorder.sh";
    "need_fix_php" expression => isnewerthan("$(ext_dir)/$(ext_file)","$(ext_dir)/$(ext_file).old");
        "$(fix_php_ext)"    contain => in_dir("$(ext_dir)");
        "$(g.lrc_d)/$(g.apache) graceful";

g.apache is "apache22" currently on FreeBSD, and "apache2" on Ubuntu. Someday it might become "apache24" on FreeBSD.

Since I did FreeBSD first, and I'm still working on getting my one of 4 (or less) Ubuntu rolled in, I have:

g.rc_d as "/etc/rc.d" and g.lrc_d as "/usr/local/etc/rc.d" for FreeBSD. They are both set to "/etc/init.d" for Ubuntu. I also have a g.init_d for Ubuntu, but not FreeBSD. Not sure which I'll use where....I suppose if its an OS specific case, g.init_d would get used and if its not...then which ever one is the correct one for FreeBSD will get used.

Pages: 1· 2


  12:50:05 pm, by The Dreamer   , 144 words  
Categories: General, Software

Making getmail.php work in b2evo 3.3.1

Once again the stock getmail.php didn't work after a significant upgrade in b2evolution version.

After a long and complicated battle, I have something that should work....we'll find out tomorrow.

First I had to do was add these two lines to 'inc/_core/_class5.funcs.php':


'mime_parser_class' => $inc_path.'_ext/mime_parser/mime_parser.php',
'rfc822_addresses_class' => $inc_path.'_ext/mime_parser/rfc822_addresses.php',

Should be obvious where they go....

Next problem was 'Could not parse data header!':

Changed preg_match to be:


if(!preg_match('#^(.{3}, )?(\d{1,2}) (.{3}) (\d{4}) (\d{2}):(\d{2}):(\d{2})#'$ddate$match))

Probably wouldn't have tripped me up if I had waited until September 10th to work on things further.... :>>

Then the final was that the 'html' email did not have an 'Alternative'.

Try this for size:


// mail is html
if( $parsedMIME['Type'] == 'html'){
    if (array_key_exists('Alternative',$parsedMIME)){
        foreach ( $parsedMIME['Alternative'] as $alternative ){
            if( $alternative['Type'] == 'text' ){
                echo_message'HTML alternative message part saved as ' $alternative['DataFile'], INFO);
                $strbody imap_qprintfile_get_contents$alternative['DataFile'] ) );
                break; // stop after first alternative
    } else {
        $strbody strip_tags(file_get_contents$parsedMIME['DataFile'] ),'<img><p><br><i><b><u><em><strong><strike><font><span><div><ul><li><a>');

Now instead of subjecting some poor random forum to a long rambling thought, I will try to consolidate those things into this blog where they can be more easily ignored profess to be collected thoughts from my mind.

Latest Poopli Updaters -- http://lkc.me/poop


There are 18 years 1 month 9 days 11 hours 11 minutes and 36 seconds until the end of time.
And, it has been 6 years 11 months 19 days 2 hours 51 minutes and 20 seconds since The Doctor saved us all from the end of the World!


December 2019
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31