include (extended_methods_stuff.php);

}

I know that I can probably extend this class to add the extra
functionality however the other generated classes rely on the name of this
class so I cannot just extend this class and it's name cannot change.

Is there any way to have an include prior to the class being parsed?

Are you using PHP5 yet? If so there's an answer for this: __autoload. Assuming that you held classes in files that had the same name as the class, you would use:


<?php

class generatedFoo {
  public function __autoload($class) {
    include '/path/to/class/$class.php';
  }

  // other stuff
}

?>

http://www.php.net/zend-engine-2.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to