J3.x

J3.x:Utilizar o "Composer" com o Joomla

From Joomla! Documentation

This page is a translated version of the page J3.x:Using Composer with Joomla and the translation is 45% complete.

Other languages:
English • ‎español • ‎français • ‎Nederlands • ‎português
Joomla! 
≥ 3.4
versão

Composer is a widely used tool for dependency management when utilizing third-party libraries. The Joomla! Project introduced Composer into Joomla 3.4 to easily manage library dependencies in both core and extensions. Composer now a stable product widely used in the PHP community to update libraries that are registered and listed at https://Packagist.org, which serves as a directory of available download packages including the Joomla! Framework packages. In this document you'll find out how the CMS is using Composer and how to update the libraries it loads. Learn more about Composer by visiting https://GetComposer.org.

Onde é que estão localizados os ficheiros do "Composer"?

Os ficheiros do "Composer" estão localizados em

JPATH_ROOT . '/libraries/vendor';

Can you edit files loaded with composer?

No! You should never directly edit any files imported with Composer (including the Joomla! Framework packages.) These are 3rd party libraries and, similar to all core files, should be enhanced by submitting pull requests on the respective project or extended and overridden in the same manner as any other core functionality.

Where are the Joomla! Framework files located?

Each are hosted in a separate repository. You can find them by going to https://github.com/joomla-framework and searching for the appropriate package.

Como é que eu posso atualizar as bibliotecas do Composer?

Transfira o "Composer" de https://GetComposer.org/download/ e execute

composer update --no-dev

This will update all Composer files to the latest versions as allowed in the composer.json file. If you feel that the versions located in the composer.json file are insufficient then update them by submitting a Pull Request. However, remember that Joomla promises backwards compatibility in the CMS through a major series. This includes the Joomla! Framework packages!

Are Composer files autoloading?

All classes loaded via Composer are automatically autoloaded by the CMS.

Can you install any extra libraries via Composer?

Not at the moment in Joomla! 3.4. In the longer term it is the CMS's aim that you can download extra packages. To emphasize this, we will not yet be releasing the composer.json file within the main Joomla! download.