Installation¶
There are several ways to install Surf:
- Download phar archive
- Global composer installation
- Local composer installation
- 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/2.3.0/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.
Global composer installation¶
To install Surf globally via composer, run the following command:
composer global require typo3/surf:^2.0
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:^2.0
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.