zoukankan      html  css  js  c++  java
  • composer(管理依赖关系的工具) 及配置信息

    Composer 
    是 PHP 用来管理依赖(dependency)关系的工具。你可以在自己的项目中声明所依赖的外部工具库(libraries),Composer 会帮你安装这些依赖的库文件。

    配置文件示例:

    修改全局配置:全局配置的文件一般放在

    C:UsersXXXAppDataRoamingComposerconfig.json; {
        "config": {},
        "repositories": [
            {
                "type": "composer",
                "url": "http://pkg.phpcomposer.com/repo/packagist/"
            },
            {
                "packagist": false
            }
        ] }
    

    修改当前配置:即项目当前的composer.json文件;

    以 laravel 项目的 composer.json 配置文件为例:

    {
        "name": "laravel/laravel",
        "description": "The Laravel Framework.",
        "keywords": [
            "framework",
            "laravel"
        ],
        "license": "MIT",
        "type": "project",
        "require": {
            "laravel/framework": "4.2.*"
        },
        "autoload": {
            "classmap": [
                "app/commands",
                "app/controllers",
                "app/models",
                "app/database/migrations",
                "app/database/seeds",
                "app/tests/TestCase.php"
            ]
        },
        "scripts": {
            "post-install-cmd": [
                "php artisan clear-compiled",
                "php artisan optimize""post-update-cmd": [
                    "php artisan clear-compiled",
                    "php artisan optimize"
                ],
                "post-create-project-cmd": [
                    "php artisan key:generate"
                ]
            },
            "config": {
                "preferred-install": "dist"
            },
            "minimum-stability": "stable",
            "repositories": [
                {
                    "type": "composer",
                    "url": "http://pkg.phpcomposer.com/repo/packagist/"
                },
                {
                    "packagist": false
                }
            ]
        }
    

      

  • 相关阅读:
    个人总结13
    构建之法阅读笔记一
    个人总结12
    个人总结11
    地铁时光机第一阶段冲刺十
    地铁时光机第一阶段冲刺九
    地铁时光机第一阶段冲刺八
    单词 统计续
    地铁时光机第一阶段冲刺七
    个人总结10
  • 原文地址:https://www.cnblogs.com/leedaily/p/8250056.html
Copyright © 2011-2022 走看看