How to load local extension package in PHP Composer

藏色散人
Release: 2021-05-26 18:32:41
forward
3543 people have browsed it

下面由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  //软链方式
      }
    }
  },
Copy after login

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

The above is the detailed content of How to load local extension package in PHP Composer. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template