I'm having trouble autoloading a class I've written that extends SplEnum. I have successfully installed Spl_Types.
Strangely, the class autoloads fine when run via the CLI. I run into problems when running the scripts through apache, however.
The class is defined as follows:
<?php
namespace base\main\domain;
use SplEnum;
/**
* Represents a colour.
*
**/
class Colour extends SplEnum {
...
Running this:
spl_autoload_register(array($autoLoader, 'autoLoad'));
spl_autoload_register('spl_autoload');
$colour = new base\main\domain\Colour(base\main\domain\Colour::BLACK);
Gives:
Fatal error: Class 'SplEnum' not found in [...] Colour.php on line 8
I've run phpinfo()
through apache and checked that the php.ini file listed includes the spl_types extension, but still no joy.
I'd greatly appreciate any help you could offer with this.
Thanks,
Ross