Open wilon opened 7 years ago
以 https://github.com/wilon/simple-php-debug 为例
PHP源码 src/SimpleDebug.php
src/SimpleDebug.php
编写composer.json文件
{ // 包名 "name": "wilon/simple-php-debug", // 包描述 "description": "Simple PHP Debug, better output and write log.", // 许可证 "license": "MIT", // 主页 "homepage": "https://wilon.github.io", // 支持 "support": { // 提问 "issues": "https://github.com/wilon/simple-php-debug/issues", // 源码 "source": "https://github.com/wilon/simple-php-debug" }, // 关键字 "keywords": ["php", "debug", "dump"], // 作者 "authors": [ { "name": "Weilong Wang", "email": "wilonx@163.com" } ], // 包依赖 "require": { "php": ">=5.3" }, // 自动加载 "autoload": { // 按文件 "files": [ "src/SimpleDebug.php" ], // 按psr-4,即按命名空间自动引入 "psr-4": { "Illuminate\\Database\\": "" } }, // 配置 "config": { "sort-packages": true }, "minimum-stability": "dev" }
git tag 0.1.0 && git push origin --tags
测试下 composer require xxx/xxxx
以 https://github.com/wilon/simple-php-debug 为例
1. 提交源码
PHP源码
src/SimpleDebug.php
编写composer.json文件
git tag 0.1.0 && git push origin --tags
2. https://packagist.org/ 注册登录
3. 配置GitHub项目
测试下 composer require xxx/xxxx