Download the PHP package alexbonavila/learning-composer without Composer
On this page you can find all versions of the php package alexbonavila/learning-composer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alexbonavila/learning-composer
More information about alexbonavila/learning-composer
Files in alexbonavila/learning-composer
Package learning-composer
Short Description This is a project to learn how composer works
License
Informations about the package learning-composer
Table of Contents
- Introduction
- Objective
- Instructions and Concepts
- Basic Commands
- Package version control
- Packagist
- Autoload
- Bibliography
Introduction
This project is part of a set of roadmaps, where this is a small gear intended to collect a series of concepts, related to composer.
Specifically, the father of this project can be found here:
Objective
The objective of this project is to remember and record the knowledge that the autoe has about composer, following the parent roadmap.
- Basic Commands: require, install, update, ...
- Package version control
- Packagist
- Autoload
Instructions and Concepts
In this section, the commands and concepts used will be listed and explained in general terms.
Basic Commands
The init command is used to start a new project using the composer setup:
$ composer init
The require command is used to add new dependencies to a project:
$ composer require <pakage>
To add the nesbot/carbon package, use the following command:
$ composer require nesbot/carbon
The install command is used to install all the dependencies defined in composer.json file:
$ composer install
The update command updates the dependencies to their latest allowed versions within the limits are defined in composer.json:
$ composer update
Package version control
Packages have been installed in composer.json, just to learn the different forms of package version control.
Packagist
The package has been moved for better practices, composer.json has also been modified and a repository has been created in packagist.
Autoload
The section is finished using some autoload options, and completed with some basic code:
Command to try code:
$ php public/index.php
Bibliography
All versions of learning-composer with dependencies
nesbot/carbon Version ^2.71
symfony/symfony Version 5.1.*
guzzlehttp/guzzle Version ~6.3
monolog/monolog Version >=2.0