You can also call static function by : call_user_func( "ezcClassName::myFunc" );
2010/7/31 Andreas Schamberger <[email protected]> > Hi, > > creating a successful new brand zeta components in my opinion also requires > to change the prefix even if causes some migration pain. > > Am 31.07.2010 13:36, schrieb Tobias Schlitt: > > -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Hi, >> >> On 07/31/2010 12:57 PM, Andreas Schamberger wrote: >> >> 1) I'm not so happy with keeping the ezc prefix. As far as I recall it >>> wasn't really considered to change the class prefix to zeta. Ok the >>> reasoning is valid but wouldn't this big step of moving to Apache justify >>> the change? If we don't change it now it'll maybe stay forever ... Using >>> the autoload files for a conversion script would be a save way to do the >>> conversion. >>> >> >> we considered several ways for changing the class prefix. A fundamental >> requirement here is, that people must be able to migrate smoothly. BC >> has always been one of the major concerns of eZ Components and we want >> to keep it that way. >> > > But it can also become a major annoyance when being obsessed with it ;) > > > Script based migration is not fully possible, due to PHP's dynamic >> nature. For example, if you're using call_user_func() and friends, >> conversion is likely to fail. We could therefore not guarantee that >> migration to a new class prefix works flawlessly. >> > > I think the script based approach could be considered relatively safe. > The call_user_func problem is obvious but I don't see it as a blocker. > > There are 3 major cases: > > 1) object method call > $object = 'ezcClassName'; > call_user_func( array( $object => 'method' ); > > 2) static class function call > call_user_func( array( 'ezcClassName' => 'method' ); > > 3) static class function call with variable > a) $className = 'ezcClassName'; > call_user_func( array( $className => 'method' ); > b) $className = 'ezc' . 'Class' . 'Name'; > call_user_func( array( $className => 'method' ); > > Is the only problematic case 3b), where the class name is constructed > completely dynamic worth not to change the prefix? Is it such a common use > case? > > Maybe I am missing something really important... > > Regards, > Andreas > >
