Setting up the framework
The XP framework is installed by a setup script bundled with each release.
It will check the dependendencies, create the directories, write the
configuration files and setup the runners. Prerequisites
You need to download and install the PHP language
to use the XP framework. PHP 5 >= 5.2.0 is required. The stock PHP
comes with a decent number of extensions enabled and will suffice for the
XP Framework's core functionality. To connect to different database servers
or use the imaging APIs, you'll need the respective extensions enabled. See
here for a complete list.
Installation
The installer works on any platform that PHP works on - but things do
differ just a little bit for Windows and Un*x platforms. We strongly
suggest to use Cygwin on Windows, although it
is not required, it does make things much easier (see
Installing on Windows without Cygwin if you don't
want to).
Getting started
You're ready to use the XP framework now. Instead of using the PHP runtime
directly, the XP framework comes with its own runners. For now, we'll focus
on the most simple one, the command line utility called xp. Basic usageTo run a class with a public static main() method, simply supply its classname as command line argument: $ xp {class.Name}
Any argument after the classname will be passed to the class' main method. Hello WorldWell, because a simple hello world is just too easy, and boring, we'll start with a slightly more complex example. Save the following sourcecode to a file called AgeInDays.class.php: <?php Now run it: $ xp AgeInDays 1977-12-14 Hey, you are 11363 days old
Where to go from hereTo learn about the framework's core concept - class loading, archives, the type system, annotations, but also on how to work with databases, XML, files, and more have a look at the documentation overview. | Table of contents |