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/3.5.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/
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.5
This way, you can add ~/.
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.5
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.
in the folder release
should work as expected.