Re: [PHP] OOP, dynamic class extention

From: Marek Kilimajer (kilimajer_at_webglobe.sk)
Date: 10/30/03


Date: Thu, 30 Oct 2003 20:27:55 +0100
To: Jackson Miller <jackson@coldfeetcreative.com>

Why? I guess because php is interpreted language and is parsed only
once, no preprocessor. Workaround is quite easy, use variable:

<?php

// settings to be set on install of the app
$MY_BASE_CLASS="base_class";
define("MY_BASE_CLASSFILE","base_class.php");

// require the class file
require_once(MY_BASE_CLASSFILE);

class my_child_class extends $MY_BASE_CLASS {
        // yada yada
}
?>
Jackson Miller wrote:
> On Thursday 30 October 2003 12:29 pm, Marek Kilimajer wrote:
>
>>php is not c, you can't use constants this way.
>
> but why? Is there a work around?
>
> -Jackson
>



Relevant Pages

  • Re: sendmail config double check
    ... > my bsd LAMP machine won't send any emails through php. ... > now, if my brain is straight, these settings should reject outside ... e-mail without an MTA process in there somewhere, ... I'm not exactly sure how PHP sends e-mail on a Unix system. ...
    (freebsd-questions)
  • Re: Error reporting
    ... seems that it indeed was my mistake in configuring PHP. ... looking at the output from phpinfo(). ... later in the same file the same settings were set to Off. ... > to the fake function. ...
    (comp.lang.php)
  • Re: [PHP] Sending E-mail
    ... try to use a local email address first. ... is borked (in which case php won't be able to use it to send any email!). ... smtp and smtp_port are ini settings that are only valid for windows, ... other than that I can only suggest looking at the moon - it won't ...
    (php.general)
  • Re: netscape mozilla iexplorer standard
    ... >> PHP with default settings ... >> You will end up with validation errors. ... >> (Bug and workarounds can be found in the php bug database) ...
    (comp.lang.php)
  • Re: [PHP] Sending E-mail
    ... Janet Smith wrote: ... is borked (in which case php won't be able to use it to send any email!). ... smtp and smtp_port are ini settings that are only valid for windows, ... other than that I can only suggest looking at the moon - it won't ...
    (php.general)