I compiled it yesterday and played around with it a little today.
HTML Purifier doesn't quite seem to compile out of the box, the
error trace I got was:
[448, {
"BadPHPIncludeFile":
[{"c1":["HTMLPurifier/Bootstrap.php",0,0,40,50],"d":"require HTMLPURIFIER_PREFIX . '\/' . $file","s":0,}
,{"c1":["HTMLPurifier/LanguageFactory.php",0,0,156,30],"d":"include $filename","s":0,}
]
,"UseEvaluation":
[{"c1":["HTMLPurifier/VarParser/Native.php",0,0,17,40],"d":"eval('$var = ' . $expr . ';')","s":0,}
]
,"UnknownClass":
[{"c1":["HTMLPurifier/Generator.php",0,0,88,29],"d":"new tidy()","s":0,}
,{"c1":["HTMLPurifier/Lexer.php",0,0,121,57],"d":"new htmlpurifier_lexer_ph5p()","s":0,}
,{"c1":["HTMLPurifier/StringHash.php",0,0,20,40],"d":"arrayobject::offsetget($index)","s":0,}
]
,"UnknownBaseClass":
[{"c1":["HTMLPurifier/StringHash.php",0,0,11,29],"d":"arrayobject","s":0,}
]
,"UnknownFunction":
[{"c1":["HTMLPurifier/Bootstrap.php",0,0,65,47],"d":"spl_autoload_functions()","s":0,}
,{"c1":["HTMLPurifier/Bootstrap.php",0,0,66,44],"d":"spl_autoload_register($autoload)","s":0,}
,{"c1":["HTMLPurifier/PropertyListIterator.php",0,0,17,38],"d":"filteriterator::__construct($iterator)","s":0,}
]
}]
So it looks like HipHop doesn't have support for SPL, which is kind
of a shame. It'll be kind of interesting getting everything to compile,
including SimpleTest, which has the potential to make me HipHop very sad
due to its reflection trickery.
Cheers,
Edward
Hi Edward,
Do you expect a big performance gain ?
AFAIR, HTMLPurifier is mainly CPU and memory intensive so it should be
a good candidate for HipHop isn't it ?
Even for non-hiphop application, calling a HTMLPurifier/HipHop as a
webservice might still be interesting for large purification
operations.
Cheers,
Manuel
Yes! My dream for the longest time was to rewrite HTML Purifier in
C++, and now Facebook has gone and done most of the work for me. :-)
> Even for non-hiphop application, calling a HTMLPurifier/HipHop as a
> webservice might still be interesting for large purification
> operations.
Possibly. I haven't thought that far ahead yet. ;-)
Cheers,
Edward
Edward
On Mar 8, 2:04 pm, "Edward Z. Yang" <ezy...@MIT.EDU> wrote:
> Yes! My dream for the longest time was to rewrite HTML Purifier in
> C++, and now Facebook has gone and done most of the work for me. :-)
I think that would be awesome, as I think bindings could be made for
other languages. I'd like to convert a project from php to ruby on
rails, but I can't do it without htmlpurifier!
ezyang@ezyang:~/Dev/htmlpurifier/hphp-out$ ./program --file library/HTMLPurifier.stub.php
foo
bar
Destructor threw an exception: 1125137:11252a7:112fc2a:bf15f2:cb5c9e:d95536:d951bd:dc7394:dc4882:d94fd7:dbaf81:b3e97d:a27040:a2ac1d:b68b68:b336ea:b36372:b68b68:b29f5a:b4e319:bd6f8c:bd82ed:bd9822:7fe79b935abd:7949b9 t___destruct is not implemented yet.
Unhandled error: t___construct is not implemented yet.
If anyone wants to take a look at this, I've published a hiphop branch
with the necessary changes to make this compile. I'm probably not going
to look too much more closely at this.
http://repo.or.cz/w/htmlpurifier.git/shortlog/refs/heads/hiphop
Compile using compile.sh
Cheers,
Edward
ezyang@ezyang:~/Dev/htmlpurifier$ time cat Main_Page | hphp-out/program -f library/HTMLPurifier.stub.php > /dev/null
real 0m0.237s
user 0m0.210s
sys 0m0.020s
ezyang@ezyang:~/Dev/htmlpurifier$ time cat Main_Page | php library/HTMLPurifier.stub.php > /dev/null
real 0m0.550s
user 0m0.510s
sys 0m0.040s
Over half reduction in runtime; not bad! I haven't checked change in memory
usage.
Cheers,
Edward
--
You received this message because you are subscribed to the Google Groups "htmlpurifier" group.
To unsubscribe from this group and stop receiving emails from it, send an email to htmlpurifier...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to a topic in the Google Groups "htmlpurifier" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/htmlpurifier/Zhql5lYW5dw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to htmlpurifier...@googlegroups.com.
> > ezyang@ezyang:~/Dev/ htmlpurifier$ time cat Main_Page | hphp-out/program -f
> > library/HTMLPurifier.stub.php > /dev/null
> > real 0m0.237s
> > user 0m0.210s
> > sys 0m0.020s
> >
> > ezyang@ezyang:~/Dev/ htmlpurifier$ time cat Main_Page | php
> > library/HTMLPurifier.stub.php > /dev/null
> > real 0m0.550s
> > user 0m0.510s
> > sys 0m0.040s
> >
> > Over half reduction in runtime; not bad! I haven't checked change in
> > memory
> > usage.
> >
> > Cheers,
> > Edward
> >
> >