Installing Packages for Flow


This morning I read about a frustrated Flow user that did not manage to install the FormBuilder package. While my first reaction was somewhat tongue-in-cheek (sorry!), it can indeed be confusing to install packages if you do not know enough about TYPO3 Flow and Composer.

That is because there are basically two ways to install a package: with  Composer or without Composer. And both ways have their own variations. Let's see.

With Composer

Installing via Composer can be very easy, if a package is available on Packagist. Then a simple

composer require typo3/formbuilder

would be enough. This is what our frustrated user tried, but it didn't work. That is because FormBuilder is not registered (yet) on Packagist. It can still be installed via Composer, but the Composer manifest (composer.json) needs to be told about a repository  for that package:

"repositories": [
  {
    "type": "git",
    "url": "git://git.typo3.org/FLOW3/Packages/TYPO3.FormBuilder.git"
  }
]

Now Composer can check that repository for compatible packages and install them as usual.

Without Composer

Packages can still be installed without using Composer. There are basically two ways.

You can simply go into Packages/Application and clone the package from its repository (the more ad-hoc variant) or properly add it as a git submodule to your "root project" (the distribution you use to pull everything together).

For your own packages it can be a shortcut  way to version custom packages directly in the root project. This can be the easiest way if you do not  plan to use the code as a reusable package.

TL;DR

The Flow documentation describes this as well.


Comments

  1. Gravatar

    Thank you, this is very helpful.

    If you're coming from TYPO3, installing extensions in FLOW seems very 1960s.

    Simon

  2. Gravatar

    @simon no, this is actually more advance; a user graphical interface would defeat the purpose of TYPO3 Flow.

    Neos should have a graphical package manager and I am pretty sure that there will be one before final release ;)

  3. Gravatar

    Must say, would like to see this as built-in supported fromewark instead, that may read the appropiate values from `help commandName` and such.
    Anyway
    - If you use Linux you can omit the $PhpExecutable$-variable, because the composer.phar contains a shebang-line and is therefore directly invokable.
    If you use Linux, renamed `composer.phar` to `composer` and place it somewhere in $PATH you _must_ set a different alias, because otherwise the CLI-console use always `composer` found in $PATH.
    - You can append the CLI-option ` ansi` to make it look pretty by default

Leave a reply

Karsten Dambekalns

Creative Code Engineer

Contact / Impressum