Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagephp
$rootContainer = \Innomatic\Core\RootContainer::instance('\Innomatic\Core\RootContainer');

$container = $rootContainer->getServiceContainer();
$logger = $container->get('logger');

Running legacy scripts

Legacy scripts can be executed from the Symfony CLI, by using the innomatic:legacy:script command, specifying the script name without the path as argument.

The command will need to be executed from Innomatic Platform 7 root, and the the desired script must exist in the innomatic_legacy/innomatic/core/scripts folder. Here's a usage example:

Code Block
languagebash
php innomatic/console --env=prod innomatic:legacy:script maintenance.php

Here we made sure to specify --env=prod, this is needed for all legacy scripts that clear cache, otherwise they will will clear dev environment cache instead of prod for Symfony stack.

If you want to access the script's help please be aware that you will need to use the --legacy-help option, since --help is already reserved for the CLI help.

Composer integration

In Innomatic 6.5.0 we introduced an integration with Composer, a leading dependency manager for PHP that is similar to the Innomatic Legacy native dependencies support but more powerful and popular.

You can check inside the code if a valid Composer autoloader is available through the \Innomatic\Core\RootContainer->hasComposer() method. In that case, any package installed in the vendor directory using Composer is available to Innomatic Legacy through the Composer autoloader.

Including a legacy application via Composer

...

Legacy applications can be referenced both by new Innomatic Platform based applications and legacy applications that have been updated with a composer.json file.

Referencing external packages via Composer inside a legacy application

Once a legacy application has been updated to support Composer as described in the previous paragraph, you can use the application composer.json file to reference external packages as you would do in any other Composer package by just adding your dependencies to the "require" section.

See the next paragraph to learn about installing Innomatic applications at run time and still obtaining Composer dependencies support.

Installing legacy applications with Composer dependencies at runtime

...

Since Composer doesn't still natively support recursive dependencies, we have added this sort of support in Innomatic using the the Wikimedia Composer merge plugin so that new applications with a composer.json file can be added at run time without changing the root composer.json file.

To avoid timeouts we recommend installing applications with Composer dependencies using the applications.php CLI script in place of the applications web control panel.

You can check inside the code if a valid Composer autoloader is available through the \Innomatic\Core\RootContainer->hasComposer() method. In that case, any package installed in the vendor directory using Composer is available to Innomatic Legacy through the Composer autoloader.

Running legacy scripts

Legacy scripts can be executed from the Symfony CLI, by using the innomatic:legacy:script command, specifying the script name without the path as argument.

The command will need to be executed from Innomatic Platform 7 root, and the the desired script must exist in the innomatic_legacy/innomatic/core/scripts folder. Here's a usage example:

Code Block
languagebash
php innomatic/console --env=prod innomatic:legacy:script maintenance.php

Here we made sure to specify --env=prod, this is needed for all legacy scripts that clear cache, otherwise they will will clear dev environment cache instead of prod for Symfony stack.

If you want to access the script's help please be aware that you will need to use the --legacy-help option, since --help is already reserved for the CLI help.