1
votes

I am currently working on migrating a non-Composer TYPO3 project to Composer.

From what I have seen and read, the autoloading changes and the file structure changes. You cannot import extensions via the extension manager anymore. Also, some extensions can only be installed via composer (unless you do ugly tweaking).

Also, from a security point of view, at least one attack vector is shut down because you can no longer install extensions via the backend.

The documentation and others state that using TYPO3 with Composer is recommended but what exactly are the advantages, do these apply in all cases?

For example, in my case, I maintain one site, updating both TYPO3 and extensions is easy. In practice there probably will be no huge improvement. I think working with a package manager is cool but I also have to "sell" why I am doing this now and other tasks are not getting done.

2

2 Answers

5
votes

The advantages of running TYPO3 v8/v9/v10+ in composer-based mode:

  • Speed improvements for PHP, as the autoloader includes the requested extensions (and used system extensions)
  • Only the system extensions you use are using are available in your production site
  • If you are using Git, you do not need to add your typo3/ folder and your vendor folder with composer-based extensions, which makes your Git repository much smaller
  • You can add more PHP libraries via composer that you need in your site, and can fine-grain your dependencies based on your PHP environment

The differences:

  • You cannot use the Extension Manager to download extensions from TER anymore, you have to use the CLI tool for fetching third-party or system extensions
  • You still need to activate these extensions in Extension Manager or via TYPO3 Console to update your PackageStates.php file.
  • All your local extensions need to either be added via a) autoload sections in your root composer.json or b) include their own composer.json and include the autoload section in there.

The statements about the folder structure is wrong, in fact, Composer allows to configure having your vendor folder OUTSIDE of your document root, which makes your website more secure IMHO, but you do not have to.

In general, if you're not used to use CLI, or using Git or a deployment strategy, composer is actually not a practical solution for TYPO3 users.

1
votes

I totally get your point in that you have to get it sell it.

Getting your project running with composer isn't that hard, but does come with some pitfalls. But once you get familiar with some basic commands, you will notice that it will lower your work time. Not in all, but in many cases, managing your project with command line tools line https://github.com/TYPO3-Console/TYPO3-Console give your more powerful and faster tools to work with. And be honest, typing in a console always look cool.

So yes, even for a 'small site', learning a new tech always rewards in the long run. You don't sell time, you sell expertice. The learning price, you do have to pay for that yourself, but you get to keep the joy that you feel when you get it to work. win-win