composer.json Params

{
     "name": "username/project",
     "description": "PHP function and libraries Wapper",
     "keywords": ["libraries", "php","component"],
     "type": "library",
     "license": "MIT",
     "homepage": "https://github.com/username/project",
     "authors": [
         {
            "name": "Cloudflying",
            "email": "oss@live.hk",
            "homepage": "http://www.xxx.com",
            "role": "Developer"
         }
     ],
     "require": {
         "php": "^7.0.*"    # Minimum Require  PHP 7.0 
     },

    "autoload-dev": {
        "files": [
            "path/to/file.php"
        ],
        "psr-4": {
            "Illuminate\\Tests\\": "tests/"
        }
    },
     "autoload": {
        "files":["lib/OrderManager.php"], # Import as a function
         "psr-4": {
             "Xie\\Component\\": "src/"
         },
        "classmap": [
            "path/to"
        ]
     },
    "suggest": {
        "ext-pcntl": "Required to use all features of the queue worker.",
        "ext-posix": "Required to use all features of the queue worker."
    },
    "config": {
        "sort-packages": true,
        "process-timeout": 300,
    }
 }

安装命令: composer require username/project @dev

More: https://docs.phpcomposer.com/04-schema.html

Leave a Reply

Your email address will not be published. Required fields are marked *