Le jeudi 26 février 2009 à 20:27 +0000, Robin Burchell a écrit :
> 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:

The best solution for you is to wait for PHP 5.3.0, then use:

function __autoload($class) {
        $path = CLASSES_DIR . '/' . str_replace($class, '\\', '/', $class) .
'.class.php';
        include($path);
}

Namespaces are probably the best way to achieve this (apart from using
_).


Mark


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to