[prev in list] [next in list] [prev in thread] [next in thread]
List: php-internals
Subject: Re: [PHP-DEV] Class names (with regard to autoload)
From: "M." =?ISO-8859-1?Q?Karpel=E8s?= <karpeles () ookoo ! org>
Date: 2009-02-27 6:08:11
Message-ID: 1235714891.4443.134.camel () localhost
[Download RAW message or body]
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic