General Actions:
| Adds ability to write scripts in PHP in wiki pages |
| Type | JAR |
| Developed by | |
| License | GNU Lesser General Public License 2.1 |
Table of contents
Unlike the other scripting languages available for XWiki, PHP is a semi-templating scripting language, which means that it must explicitly wrap code sections inside <?php ?> markers:
See the Script Macro for details.
Result:
Hello World!
A current limitation of the Quercus library is that variables and class definitions are only valid inside the same macro block.
Put the jar file into WEB-INF/lib folder and restart XWiki.
To use the php macro, you need to install the following three libraries inside WEB-INF/lib directory of your XE installation:
Once these libraries are in place, you need to restart your XE installation for the changes to take effect.
Unfortunately, the quercus library does not contain all the PHP libraries, so at startup you will get some exceptions in the logs, like:
The missing modules are: bam, dom, pdf, and resin. If you want to use them, they are found in the main Resin jar.