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 nix-channel. This channel provides the latests build of all the packages you need and ensures that they work together. Please do not pay attention to the subversion path is was build on.
Note that the following command does not work:
$ nix-env -i strategoxt-packages-305503

You can use this one to install everything:

$ nix-env -i 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 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!