I'm trying to include 'simple_html_dom.php' (see http://simplehtmldom.sourceforge.net) for use in one of my applications as a 'package'. It's only 1 class, which I've put in a package named 'domparser'
Compile Error - Cannot redeclare file_get_html() (previously declared in C:\Users\.. ..pathToFuel. ..\fuel\packages\domparser\classes\parser.php:70) in PKGPATH/domparser/classes/parser.php on line 85
Normally I'd just 'require_once' the file, but packages seem to be the done thing with libs in FuelPHP. Where am I going wrong?
it defines a couple of classes, simple_html_dom and _node, as well as a couple of helper functions outwith either class. I guess I should break these into 2 sep. classes and make the helper functions static?
If it contains multiple classes, you have to define those classes in the bootloader. If you don't, the autoloader will try to load it, causing this type of errors, since it's already loaded.
Look in the core bootstrap, where that is done as well (for example for exception classes that are defined in the same file as the core class itself).
That should work, you should not have to break it up in separate files.