views:

40

answers:

1

Background

I'm porting markdown to HaXe.


Problem

HaXe's PHP generator is either totally borked, or I've done something wrong. When I try to include the generated php file containing main(), I get an error like this:

Fatal error: Cannot redeclare _hx_add() (previously declared in /home/owner/Projects/mdown/build/php/lib/php/Boot.class.php:13) in /home/owner/Projects/mdown/build/php/lib/php/Boot.class.php on line 842

Call Stack:
   26.8369      60580   1. {main}() php shell code:0
   26.8373     692944   2. include_once('/home/owner/Projects/mdown/build/php/mdown.php') php shell code:0
   26.8670    1713980   3. require_once('/home/owner/Projects/mdown/build/php/lib/php/Boot.class.php') /home/owner/Projects/mdown/build/php/mdown.php:0

It looks like everything loads through the SPL autoloader, which I've never really used much. I have no idea how to proceed, and google yields nothing. Any ideas?

I've put the entire source into a google code project here: http://code.google.com/p/mdown/

The PHP files in question can be found here.


Update: The error isn't happening in the autoloader callback. I can comment out the include ... line in the autoloader callback and I still get the same error.


Another update: The problem only seems to affect the interactive PHP shell. Guess it was a problem with the shell and not HaXe. I'm seeing some other weird issues now with regex and backreferences, but I think they'll have to wait until Monday.

+1  A: 

As the developer of haXe/php I find very stimulating finding comments that my product could be "borked". Considering that I don't even use it but I keep to maintain it for the sake of the community it really makes me move forward with pleasure ;) .... sure it is not perfect but it is by far from being useless, broken or "borked".

Anyway, if you post some more info I am sure an easy solution will be found.

Franco Ponticelli
@Franco Ponticelli: No disrespect intended. It may well be my understanding of HaXe that is borked -- I've only been using it for like 3 days now :) I'll try some more things and let you know what I find out. By the way I tried to create an account at the HaXe forums but I'm not having any luck... Is there some kind of trick to it?
no
Marking this correct... you were right, it wasn't borked. ;)
no
I don't use the forum very much; I find that the most useful info are dealed on the mailing list but I may be wrong.
Franco Ponticelli