3

我正在加载这个仓库:

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "ivantcholakov/gibberish-aes-php",
                "version": "master",
                "source": {
                    "url": "https://github.com/ivantcholakov/gibberish-aes-php.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        }
    ],
    "require": {
        "ivantcholakov/gibberish-aes-php": "*@dev"
    }
}

但是生成的classmap是空的,我不能使用repo:

<?php

// autoload_classmap.php generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
);

我的 composer.json 设置有什么问题?

PS:我跑了update

4

1 回答 1

6

您必须像这样为存储库配置自动加载选项:

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "ivantcholakov/gibberish-aes-php",
                "version": "master",
                "source": {
                    "url": "https://github.com/ivantcholakov/gibberish-aes-php.git",
                    "type": "git",
                    "reference": "master"
                },
                "autoload": {
                    "classmap": ["/"]
                }
            }
        }
    ],
    "require": {
        "ivantcholakov/gibberish-aes-php": "*@dev"
    }
}

如评论中所见,之后有时需要重新安装作曲家。

于 2013-06-21T09:49:45.930 回答