phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [phpGroupWare-developers] datetime class and PHP 5.2


From: Chris Weiss
Subject: Re: [phpGroupWare-developers] datetime class and PHP 5.2
Date: Tue, 26 Dec 2006 19:41:15 -0600

On 12/26/06, Dave Hall <address@hidden> wrote:
Prefix by app:
app/inc/class.blah.inc.php contains a class called "app_blah" which
createObject will "auto prepend" the app_ to the class name before
instantiating it.  I prefer this option as it will also prevent class
name clashes within phpGW.


this sounds great, with a bit of class_exists()...
if (class_exists($app.'_'.$class))
{
 //new naming
}
else
{
 //old naming
}

assuming class_exists() doens't have any more overhead than isset().
And also maybe a class_exists() on the old too just to be sure we
don't try to instanciate a non-existant class.

and if you wanted backward compat  just to be sure, you could have the
old style as a file with a class that extends the new nameing style.
would work for everything but static classes.  These files could even
just be offered as code in the readme and mailing lists for those that
extend the base stuff and don't have time to update their private
code.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]