首页 >开发工具 >composer >PHP Composer怎么加载本地扩展包

PHP Composer怎么加载本地扩展包

藏色散人
藏色散人转载
2021-05-26 16:26:553569浏览

下面由composer教程栏目给大家介绍PHP Composer怎么加载本地扩展包,希望对需要的朋友有所帮助!

目录结构:

 

 项目下的 HttpServerFrame/composer.json

{
  "name": "xxx/http-server-demo",
  "authors": [
    {
      "name": "xxx",
      "email": "xxx@xxx.com"
    }
  ],
  "autoload": {
    "psr-4": {
      "App\\": "app/"
    }
  },
  "repositories": {
    "0": {
      "type": "path",
      "url": "../packages/*/*",
      "options": {
        "symlink": true  //软链方式
      }
    }
  },
  "require": {
    "xxx/http-server-frame": "dev-release",
    "xxx/http-test": "dev-release"
  }
}


关注这块代码

"repositories": {
    "0": {
      "type": "path",
      "url": "../packages/*/*", //从 packages 目录下的*/* 安装此目录下必须要有composer.json
      "options": {
        "symlink": true  //软链方式
      }
    }
  },

直接composer update 即可导入,效果如下:

以上是PHP Composer怎么加载本地扩展包的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文转载于:csdn.net。如有侵权,请联系admin@php.cn删除