Generic Development Instructions

Static analysis for PHP
This page describes how you can set up your development environment for PHP-Sat/PHP-Front. Most of the information is located elsewhere, if a link is dead please let us know.
This configuration is the same configuration as the one that I am personally using.

Installing Nix

Information about installing NIX is available here.
Note that the manual installation of nix-packages goes more smoothly if you set the permissions in the right way.

Installing Stratego

The simplest way to install everything you need is to use this and this nix-channel.

$ nix-channel --add http://hydra.nixos.org/jobset/nixpkgs/trunk/channel/latest
$ nix-channel --add http://hydra.nixos.org/project/strategoxt/channel/latest
$ nix-channel --update

You can use this command to install all dependencies:

$ nix-env -i aterm-2.5 sdf2-bundle strategoxt strategoxt-utils stratego-shell
Note that the stratego-libraries are not installed, they are for other platforms. And this one to update everything:
$ nix-channel --update 
$ nix-env -u '*'

Installing Autoconf and Libtool

In order to build from source you need to have both the Autoconf and libtool tools installed. If you do not have a copy of them available, you can either install these from the release page of these tools, or through nix:
$ nix-env -i autoconf libtool 

Installing the repositories

The 'php-*' stands for both 'php-front and php-sat'

The first thing that has to be done is the correct setting of the PKG_CONFIG_PATH-variable.

$ export PKG_CONFIG_PATH=~/.nix-profile/lib/pkgconfig
When this is not done the configure script will not find the ATerm, SDF or StrategoXT-files.

The rest of the repository installation is straight-forward, just use the following sequence of commands in the location of your choice.
(The <repository> is https://svn.strategoxt.org/repos)

$ svn checkout <repository>/psat/php-*/trunk ./php-*/
$ cd php-*
$ ./bootstrap
$ ./configure --enable-bootstrap 
$ make
$ make check
$ make install
This sequence gets the latests source-code, configures (the --enable-bootstrap is required!) and builds, checks and installs everything.

Setting up your editor

There are several editor plug-ins for stratego, you can find them here.

There are also highlighters available for Context. There is one for SDF and one for testsuites.

Have fun

Your development environment is ready. If you make anything useful please let us know, happy coding!