Re: Class names (with regard to autoload)
| From: | Guilherme Blanco | Date: | Thu, 26 Feb 2009 20:48:40 +0000 |
| Subject: | Re: Class names (with regard to autoload) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-43192@lists.php.net to get a copy of this message | ||
I doubt you'll find a patch to it.
Mainly, the patch will be against this principle:
<?php
define('Part', 'Foo');
define('SubPart', 'Bar');
class FooBar {
// ...
}
$fb = new Part.SubPart();
Regards,
On Thu, Feb 26, 2009 at 5:27 PM, Robin Burchell <viroteck@viroteck.net> wrote:
> Hi all,
>
> I've been playing around with autoload lately, and specifically using
> autoload to load classes which may be in subdirectories. I came up
> with the following test script:
>
> <?php
>
> function __autoload($sName)
> {
> echo "autoloading " . $sName . "\n";
> }
>
> $s = "Foo.Bar";
>
> $a = new $s();
> $b = new Foo.Bar();
> ?>
>
> The first line demonstrates what I'm after ("autoloading Foo.Bar"),
> and the second seems to give a bit of an odd/incorrect (in these
> circumstances) result(__autoload is invoked with "Foo").
>
> Is it possible to reconcile this behaviour to be a bit more
> consistant, and provide the behaviour I'm after?
>
> I'm willing to try provide a patch, if someone would be kind enough to
> direct me to the part(s) of the engine I'd need to look at.
>
> Thanks,
> Robin
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9215-8480
MSN: guilhermeblanco@hotmail.com
URL: http://blog.bisna.com
São Paulo - SP/Brazil