How to use composer packages

Posted on January 11, 2020

Tutorials

From version 1.10.2 Gila will support composer packages. They are third party libraries that are really helpful to build faster and compiicated solutions.

Start using composer:

In the main folder run the command

composer install

Now composer has installed the autoloader.php inside vendor folder, and your web application will use it to read the composer packages.

Install dependecies via composer:

When a Gila package cannot be be activated because it depends on a composer package (has a name like vendor/name). You have to install it in the main folder like before:

composer require <vendor/name> --no-dev

Use composer packages as dependency:

If you want to use a package as dependecy for your Gila CMS package, it is better first include it as requirement in your package.json file:

...
  "required": {
    ...
    "vendor/name": "X.XX"
  }
...

Then you install it via composer like above.

 

Subscribe to our newsletter