Installation

There are several ways to install Surf:

  1. Download phar archive

  2. Global composer installation

  3. Local composer installation

  4. Building a Surf phar from source

Download phar archive

To install Surf as phar archive, run the following commands:

mkdir /usr/local/surf
curl -L https://github.com/TYPO3/Surf/releases/download/3.4.6/surf.phar -o /usr/local/surf/surf.phar
chmod +x /usr/local/surf/surf.phar
ln -s /usr/local/surf/surf.phar /usr/local/bin/surf

You may need extended privileges e.g. sudo.

This way, you can add /usr/local/surf to PHP Include Paths in your IDE.

Upgrading Surf

Later, to upgrade Surf, run the command:

surf self-update

Global composer installation

To install Surf globally via composer, run the following command:

composer global require typo3/surf:^3.4

This way, you can add ~/.composer/vendor/typo3/surf to PHP Include Paths in your IDE.

Local composer installation

To install Surf within your project via composer, run the following command:

composer require typo3/surf:^3.4

The advantage of this method is that you can directly inspect the source files of surf without any further configuration in your IDE.

Note

Because of surf's dependencies it could be that you can't install surf in your project root. In that case you should install surf in a sub directory.

Building a Surf phar from source

Surf is built using humbug/box and the process is simple:

  • Install humbug/box as described in its documentation

  • Clone or download the desired branch of typo3/surf

  • cd your/surf/folder

  • composer install --no-dev

  • path/to/box compile

The generated surf.phar in the folder release should work as expected.