Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to publish your own Composer package in Packagist

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to publish your own Composer package in Packagist. It is very detailed and has a certain reference value. Friends who are interested must read it!

The noun explains:

Summary: if you want to publish a project to packagist, you need to publish the project to github first (of course, there is more than one option), and then log in to packagist to publish.

It can be understood that Packagist is the index and Github is the content provider.

Steps:

Environmental requirements (downloaded from the official website): git, composer, php

2. Start packagist

Log in to https://packagist.org/ and click the address of the git warehouse submitted by the submit in the upper corner

Add GitHub Service Hook domain to the address of the packagist to update automatically (when the github changes, the packagist is updated).

The add packpackagist is as follows: User is the Packagist user name token is the ApiToken in Packagist. After the setting is completed, you can check whether the test is successful.

Third, use expansion packs

Composer require xxxx/xxx # will report an error at this time, Could not find package xxxx/xxx at any version for your minimum-stability (stable). Check the package . Guess that it is the domestic image used by my composer. It may be because there is no synchronization. It is still not possible to use this command to change the "source" back. Composer config repo.packagist composer https://packagist.org # continues to speculate that my component has not yet been officially released on Github. at this time, it is still a development version of dev-master. The dev-master version should be added. Composer require xxxx/xxx:dev-master # successful

For well-known reasons, even the code warehouse has to be walled. Wait a few hours and try again. Then your knowledge of the network is really poor. Fighting~.

The above is all the contents of the article "how to publish your own Composer package in Packagist". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report