XP Runners installation

at 2009-01-09 in ReleasesAnnouncements by friebe (0 comments)

On a short note: To install (or update) the XP runners without installing (or updating) the framework, you can now use the following:

  $ cd ~/bin
$ wget 'http://xp-framework.net/downloads/releases/bin/setup' -O - | php

Runners
Instead of using the PHP runtime directly to execute programs written using the XP framework we use one of the following runtimes:

  • xp - the most basic runner, runs classes with a public static function main(array $args)
  • xpcli - the runner for command line classes (util.cmd.Command)
  • unittest - for unittests (unittest.TestCase subclasses)

This has the advantage of not having to configure system-wide PHP with user include paths, being able to switch between differing installations and framework versions as well as PHP runtimes easily and saving boilerplate code (usually require('lang.base.php');).

There are two different implementations of the XP runners, one written in C# using the .NET framework, for use on Windows, and one written as shell scripts for use on any Linux or Unix system (or even on Cygwin).

Usage
Though the above command (if executed in the target directory) requires no arguments the default behaviour may be changed by using the following switches:

  setup [-d runner-dir] [-p proxy-url] [-e runner-env]
- runner-dir: Path to where XP runners should be installed (default: $CWD)
- proxy-url : HTTP proxy to use (default: none), e.g. http://proxy.example.com:3128/
- runner-env: Runner environment to use (windows | unix, default: auto-detect)

Because the sourcecode is piped to PHP and thus no filename is given we need to tell php where its own arguments end and the script's $argv starts. This is accomplished by using --. Here's an example:

  $ wget 'http://xp-framework.net/downloads/releases/bin/setup' -O - | php -- -d /usr/local/bin/xp



Subscribe

You can subscribe to the XP framework's news by using RSS syndication.


Categories

News
General
PHP5
Announcements
RFCs
Further reading
Examples
Editorial
EASC
Experiments
Unittests
Databases
5.8-SERIES

Related

Find related articles by a search for «XP».