From: Reini U. <ru...@x-...> - 2004-08-11 21:25:58
|
Mario Salzer schrieb: > Hope this is interesting to anyone... I'm from a concurrent > Wiki project (http://ewiki.berlios.de/) and currently into > hacking a JavaScript "interpreter" in PHP: > > http://phpjs.berlios.de/ Thanks, I have looked at this before, but I will do again, since it is quite interesting. The reason why I looked at this before is to disallow unsafe user-side code. I added a similar project to phpwiki core then. a "sandbox" htmlparser, which skips unsafe html parts, for our RawHtml plugin. I doubt that "safe" javascript will be of much use to us, because our philosophy is to disallow complicated rendering markup, make it simple and uniform. Besides the obvious to disable any abusable user-side code. normally admins can easily extend their templates with javascript. But we will see, if it makes sense for users also. > Most people now will ask, what JavaScript could have to do > with PHP - but this thing is running server-side, it is an > interpreter itself run inside of the PHP interpreter. This > is only useful, because this way you get a safe runtime for > user-supplied scripts. > For a Wiki this means that users could inject small scripts > into pages and extend the site that way (see also MetaBall: > CommunityProgrammableWiki) - you would be mad if you allowed > users to feed bare PHP code on your server through eval(). > > Before you look at it: that phpjs interpreter isn't finished > yet, misses OO-features and a few language constructs - just > a toy currently (though it could be configured to emulate > PHP quite well). > > The idea I had some time ago, was to allow ALL users to write > (limited) "plugins" that would run in different WikiEngines, > without having to code for its native/internal functions. This > is partially discussed on: > http://wikifeatures.wiki.taoriver.net/moin.cgi/AutomaticFeatureInstall > > Now to really get cross-wiki compatible plugins, you not only > need to have the scripting language which should look the same > for all implementations, but you also have the API - which of > course needs to provide similar features here and there. As today > everybody knows, JavaScript in browsers failed somewhat at this, > because of the many non-compatible extensions MS and Netscape > introduced. > > So before I'm going to start an example implementation of > what I think could be called "WikiScript" or so ;) I'd like > to ask you PhpWiki folks what you think about, and if you're > interested at all. The other PHP-based Wikis currently look > too small or unprofessional, so I'm asking here first. hmm, a cross-wiki scriptable language? I'm not really convinced. similar to the unification of wikisyntax. why not using php for all php-based wiki's (similar for the perl-based wikis), and just unify the API for the plugins? > What really matters most is the API, it needs negotiation to > later get scripts working in different WikiEngines. I also > had no problems of just starting my own version and simply > design an API tailored to what I need, but the compatibility > idea is even more interesting than the user driven injection > of new features. But technically I would have no problem to support your "WikiScript" plugin idea, and users can play with it then. If it will be fast enough... Do you want a detailed description of our plugin API? Or should I just code it for you as an example? mediawiki is similar, others not that much. I believe that our plugin syntax is the most advanced, but we should make a wikipage to list the differences and decide then. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |