Install Composer Extension
First, the composer
extension needs to be installed. Go to the Extension manager and click on Install extension. Search
for composer and confirm the installation of version 0.16.6 with Continue (multiple times).
Composer Installation
After successfully installing the extension you will be redirected to the new Package management within the back end.
There you have to confirm the installation of Composer.
Skip Migration
Afterwards the Composer package management extension would propose to do a migration of all existing extensions from the
old Contao Extension Repository to the new package management. This step is not required for our purposes, so we can skip
it by clicking on skip migration (only if you know what you do).
Change settings
Within the package management, go to Settings in the upper right and change the Minimum stability setting to Stable.
Confirm with Save afterwards.
Expert Mode
Then go to the Expert mode in the top right, where you can edit the contents of the composer.json
directly. Here you
can make the necessary changes as described in Installation. Save your changes afterwards. The composer.json
should look like this:
{
"name": "local/website",
"description": "A local website project",
"type": "project",
"license": "proprietary",
"require": {
"contao-community-alliance/composer-client": "~0.14",
"inspiredminds/contao-news-sync": "^3.0"
},
"prefer-stable": true,
"minimum-stability": "stable",
"config": {
"preferred-install": "dist",
"cache-dir": "cache",
"component-dir": "../assets/components"
},
"repositories": [
{
"type": "composer",
"url": "https://legacy-packages-via.contao-community-alliance.org"
},
{
"type": "artifact",
"url": "packages"
},
{
"type": "composer",
"url": "https://token:<YOUR_TOKEN>@packdis.inspiredminds.at/r"
}
],
"extra": {
"contao": {
"migrated": "skipped"
}
}
}
Composer Settings
One of the next step is to execute a package update. If you want to execute this operation from within the back end, it
is recommended to configure the detached mode
under System » Settings » Composer settings.
The exact path for the PHP CLI vary and depend on the server environment and the used PHP version. Suggestions
for possible PHP paths can be found in the Wiki of the composer extension
and the Wiki of the Contao Manager. The memory_limit
parameter must be
adjsuted as well. Depending on the server environment it might be recommended to set it to -1
, 4G
or you need to remove
it completely.
Update Composer
The composer extension downloads the latest composer.phar
automatically. However, it downlaods a development version,
that will likely be incompatible. Thus it is necessary to manually replace the composer.phar
. You need to download the
newest 1.x
version of Composer from getcomposer.org/download/ and then replace the
existing composer/composer.phar
with that.
Execute Package Update
Now the package update can be executed, which will actually install the News Sync extension. This ist the most critical
part as it consumes a lot of working memory. The package update can be executed directly from the back end or from the
command line.
Back end
Assuming the correct composer settings have been done, the package update can be triggered with a
click on Update packages within the package management. During the first usage, the package update needs to be executed
three times.
The extension will be installed afterwards. The pcakage management will offer you to also execute the necessary database
updates. Alternatively these updates can also be done in the Contao Install Tool as usual.
Command line
In order to execute the package update on the command line, you need to navigate to the composer/
subdirectory of the
Contao installation. The command to be executed is
php composer.phar update --optimize-autoloader
The php
part of the command may need to be exchanged with the actual path to a suitable PHP CLI. This depends on the
server environment. See also the composer settings section.
During first use, the command needs to be executed three times in total:
$ php composer.phar update --optimize-autoloader
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 27 installs, 0 updates, 0 removals
- Installing contao-community-alliance/composer-plugin (2.4.3): Loading from cache
- Installing swiftmailer/swiftmailer (v5.4.12): Loading from cache
- Installing matthiasmullie/path-converter (1.1.3): Loading from cache
- Installing matthiasmullie/minify (1.3.63): Loading from cache
- Installing contao-components/compass (0.12.2.1): Loading from cache
- Installing true/punycode (1.1.0): Loading from cache
- Installing tecnick.com/tcpdf (6.3.5): Loading from cache
- Installing simplepie/simplepie (1.5.5): Loading from cache
- Installing phpspec/php-diff (v1.1.0): Loading from cache
- Installing oyejorge/less.php (v1.7.0.14): Loading from cache
- Installing michelf/php-markdown (1.9.0): Loading from cache
- Installing leafo/scssphp (v0.8.4): Loading from cache
[ContaoCommunityAlliance\Composer\Plugin\DuplicateContaoException]
Warning: Contao core 3.5.40 was about to get installed but 3.5.40 has been found in project root, to recover from this problem please restart the operation
$ php composer.phar update --optimize-autoloader
[ContaoCommunityAlliance\Composer\Plugin\ConfigUpdateException]
legacy packages repository was added to root composer.json
$ php composer.phar update --optimize-autoloader
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 14 installs, 0 updates, 11 removals
- Removing true/punycode (1.1.0)
- Removing tecnick.com/tcpdf (6.3.5)
- Removing swiftmailer/swiftmailer (v5.4.12)
- Removing simplepie/simplepie (1.5.5)
- Removing phpspec/php-diff (v1.1.0)
- Removing oyejorge/less.php (v1.7.0.14)
- Removing michelf/php-markdown (1.9.0)
- Removing matthiasmullie/path-converter (1.1.3)
- Removing matthiasmullie/minify (1.3.63)
- Removing leafo/scssphp (v0.8.4)
- Removing contao-components/compass (0.12.2.1)
- Installing contao-community-alliance/composer-client (0.17.0): Loading from cache
- removed 114 files
- created 1 links
- Installing symfony/polyfill-mbstring (v1.17.0): Loading from cache
- Installing paragonie/random_compat (v9.99.99): Loading from cache
- Installing symfony/polyfill-php70 (v1.17.0): Loading from cache
- Installing symfony/http-foundation (v3.4.40): Loading from cache
- Installing symfony/polyfill-ctype (v1.17.0): Loading from cache
- Installing symfony/event-dispatcher (v2.8.52): Loading from cache
- Installing ramsey/uuid (3.9.3): Loading from cache
- Installing pimple/pimple (v1.1.1): Loading from cache
- Installing contao-community-alliance/dependency-container (1.8.3): Loading from cache
- created 1 links
- Installing contao-community-alliance/event-dispatcher (1.3.0): Loading from cache
- created 1 links
- Installing richardhj/contao-simple-ajax (v1.2.1): Loading from cache
- removed 2 files
- created 3 links
- Installing codefog/contao-haste (4.24.6): Loading from cache
- created 1 links
- Installing inspiredminds/contao-news-sync (1.8.4): Loading from cache
- created 1 links
Package richardhj/contao-simple-ajax is abandoned, you should avoid using it. Use symfony/routing instead.
Writing lock file
Generating optimized autoload files
4 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Runonce created with 1 updates
Afterwards the Contao Install Tool needs to be opened as usual, in order to execute the necessary database updates.