使用来自私有bitbucket存储库的composer定制symfony2 bundle安装

时间:2014-01-10 14:28:35

标签: php composer-php bitbucket

我拼命想通过作曲家安装我的Symfony Bundle。我做了以下事情:

  • 在捆绑包的根文件夹中创建了一个bitbucket git repo(SymfonyProject / src / My / Bundle)
  • 创建了一个composer.json文件:

    {
        "name": "my/bundle",
        "description": "my desc",
        "type" : "symfony-bundle",
        "require": {
            "foreign/bundle": "dev-master"
        },
        "license": "proprietary",
        "authors": [
            {
                "name": "Me",
                "email": "me@mycompany.com"
            }
        ],
        "minimum-stability": "dev",
        "autoload": {
           "psr-0": { "My\\Bundle\\": "" }
        },
        "target-dir" : "My/Bundle"
    }
    
  • 然后我创建了一个testproject并将其添加到symfony root中的composer.json中:

    "require" : {
         "my/bundle" : "dev-master"
    },
    "repositories" : [
          "type" : "vcs",
          "url" : "https://myusername:password@bitbucket.org/mycompany/myrepo.git"
    ]
    
  • 我调用composer update my / bundle -vvv并得到以下输出(删除了无趣的东西):

     Loading composer repositories with package information
     Executing command (CWD): git clone --mirror 'https://username:****@bitbucket.org/mycompany/myrepo.git'
     '/home/myname/.composer/cache/vcs/https---repocachedir/'
     Executing command (/home/myname/.composer/cache/vcs/https---repocachedir/): git show-ref --tags
     Executing command (/home/myname/.composer/cache/vcs/https---repocachedir/): git branch --no-color --no-abbrev -v
     Executing command (/home/myname/.composer/cache/vcs/https---repocachedir/): git branch --no-color
     Executing command (/home/myname/.composer/cache/vcs/https---repocachedir/): git show 'master':composer.json
     Executing command (/home/myname/.composer/cache/vcs/https---repocachedir/): git log -1 --format=%at 'master'
     Reading composer.json of my/bundle (master)
     Reading /home/myname/.composer/cache/vcs/https---repocachedir/09esdfsdfdb74ce0998ddsdfsd59028969b8edef35f872 from cache
     **Importing branch master (dev-master)**
     Downloading https://packagist.org/packages.json
    

最后一个输出是“导入分支主”,这是对的,不是吗?之后,获取包装内容。 Composer安装也不会工作,不会安装包。我究竟做错了什么?

如果有人能够启发我,我会非常高兴!!!

1 个答案:

答案 0 :(得分:0)

我有类似的设置使用“git”类型。

它看起来像是使用缓存版本吗?

这可能是空的吗?

可以从(来自Composer文档)中找到并删除它:

“在Windows上默认为$ home / cache,在Windows上默认为C:\ Users \\ AppData \ Local \ Composer。”