On 04/05/2011 07:31 AM, Platonides wrote:
Having to create a reflection class and look for
exceptions just to
check for class existance is really ugly.
However, looking at
https://github.com/facebook/hiphop-php/issues/314 it
seems to be a declaration before use problem (even though class_exists
shouldn't be declaring it). I suppose that we could work around that by
including all classes at the beginning instead of using the AutoLoader,
which shouldn't be needed for compiled code.
You can't include the class files for compiled classes, they all exist
at startup and you get a redeclaration error if you try. I explained
this in the documentation page on
mediawiki.org which has now appeared.
http://www.mediawiki.org/wiki/HipHop
The autoloader is not used. It doesn't matter where the class_exists()
is. HipHop scans the entire codebase for class_exists() at compile
time, and breaks any classes it finds, whether the or not the
class_exists() is reachable.
These both really sound like bugs in HipHop. I've no idea how hard it
would be to fix them, but are we reporting them at least?
--
Ilmari Karonen