Publish your own composer package

1. Create a project on git
Insert picture description here
2. Log in to the composer package release URL: https://packagist.org/packages/submit, fill in the above git address, check first, then submit
Insert picture description here

Insert picture description here

3. Use composer to download

unbutu@unbutu-System-Product-Name:~/桌面/composer$ composer require php-kevlin/composer_packagist:dev-master
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing php-kevlin/composer_packagist (dev-master 5bab06f): Cloning 5bab06f6fc
    Failed to download php-kevlin/composer_packagist from source: Failed to clone https://github.com/php-kevlin/composer_packagist.git, git was not found, check that it is installed and in your PATH env.

sh: git: not found

    Now trying to download from dist
  - Installing php-kevlin/composer_packagist (dev-master 5bab06f): Downloading (Downloading (100%)         
Writing lock file
Generating autoload files
unbutu@unbutu-System-Product-Name:~/桌面/composer$ ls
composer.json  composer.lock  vendor
unbutu@unbutu-System-Product-Name:~/桌面/composer$ cd vendor/
unbutu@unbutu-System-Product-Name:~/桌面/composer/vendor$ ls
autoload.php  composer  php-kevlin
unbutu@unbutu-System-Product-Name:~/桌面/composer/vendor$ cd php-kevlin/
unbutu@unbutu-System-Product-Name:~/桌面/composer/vendor/php-kevlin$ ls
composer_packagist
unbutu@unbutu-System-Product-Name:~/桌面/composer/vendor/php-kevlin$ cd composer_packagist/
unbutu@unbutu-System-Product-Name:~/桌面/composer/vendor/php-kevlin/composer_pacgist$ ls
unbutu@unbutu-System-Product-Name:~/桌面/composer/vendor/php-kevlin/composer_packagist$ ls
composer.json  License  readme.txt  test.txt
unbutu@unbutu-System-Product-Name:~/桌面/composer/vendor/php-kevlin/composer_packagist$ 

Guess you like

Origin blog.csdn.net/kevlin_V/article/details/105998017