Subject Re: PHP5RC3
Author abies12
--- In firebird-php@yahoogroups.com, "goncalo1959" <gfran@d...> wrote:
> Have anyone tried PHP5RC3 with Firebird on Windows/Apache2 ?
> After upgrading from PHP5RC2, my applications based om Firebird
stop
> working with the message: Call to undefined function ibase_timefmt
> () . If I copy php_interbase.dll from the PHP5RC2 they start
working
> again. Is something broken with the RC3 release?

Hello all,

As Lester told you, I removed ibase_timefmt() from PHP 5. As moving to
PHP 5 is not going to be painless for anyone, I decided this would be
the best time to drop it.

First of all, ini_set() is better than ibase_timefmt() was, because it
will return the previous value instead of just true or false.

But the real reason is that ibase_timefmt() was implemented really
poorly. It malloc()'ed & free()'d three different blocks of memory for
*each* request, whether it called ibase_timefmt() or not [or any
ibase_ function for that matter], while bypassing Zend's memory cache.
This meant 6 system calls for each request.

Instead of fixing ibase_timefmt(), I decided to drop it. To make the
change as easy as possible, you can add this to your includes.

<?php

define('IBASE_DATE','ibase.dateformat');
define('IBASE_TIME','ibase.timeformat');
define('IBASE_TIMESTAMP','ibase.timestampformat');

function ibase_timefmt($format, $which = IBASE_TIMESTAMP)
{
return (bool)ini_set($which, $format);
}

which emulates ibase_timefmt()'s behaviour exactly.

Please report all bugs and other issues you're having at bugs.php.net,
or email me directly at abies@.... I spent a lot of time turning
the PHP4 extension into what it is now, so I hope it will be useful to
a lot of people.

BTW, I was asked [by someone at MySQL :-)] to deliver a short talk on
PHP/Firebird at LinuxTag in Karlsruhe. [Germany] If you have any good
benchmarks, or issues you think should get some attention, please let
me know. I was going to talk about things like param binding, BLOB
API, event handling and other stuff that makes Firebird such a killer
database. I've also spent some time writing an UDF that makes PHP
functions accessible from SQL. Other suggestions are highly
appreciated.

Regards,

Ard Biesheuvel