一个存储库我的composer.json现在为空或私有我仍然想使用这个composer.json我如何添加新的存储库

时间:2017-05-02 13:33:29

标签: json git composer-php sonata-media-bundle

这是我的composer.json

{
"name": "mountain-code/symfony-sonata-media-admin",
"license": "proprietary",
"type": "project",
"autoload": {
    "psr-4": {
        "": "src/"
    },
    "classmap": [
        "app/AppKernel.php",
        "app/AppCache.php"
    ]
},

"repositories": [
    {
    "type": "vcs",
        "url": "https://github.com/sidz/SonataMediaBundle.git",
        "no-api": true
    }
],

"require": {
    "php": ">=5.3.9",
    "symfony/symfony": "2.8.*",
    "doctrine/orm": "^2.4.8",
    "doctrine/doctrine-bundle": "~1.4",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~5.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "incenteev/composer-parameter-handler": "~2.0",
    "sensio/generator-bundle": "~2.3",
    "sonata-project/admin-bundle": "~2.3",
    "sonata-project/doctrine-orm-admin-bundle": "~2.3",
    "sonata-project/user-bundle": "^2.2",
    "doctrine/doctrine-fixtures-bundle": "^2.3",
    "sonata-project/media-bundle": "2.3.x-dev",
    "tilleuls/ckeditor-sonata-media-bundle": "^1.0",
    "egeloen/ckeditor-bundle": "^4.0",
    "knplabs/knp-menu-bundle": "~1.1",
    "payum/payum-bundle": "^2.1",
    "php-http/guzzle6-adapter": "^1.1",
    "payum/paypal-express-checkout-nvp": "^1.3",
    "payum/offline": "^1.3",
    "hwi/oauth-bundle": "^0.5.1"
},
"require-dev": {
    "symfony/phpunit-bridge": "~2.7"
},
"scripts": {
    "post-install-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
    ],
    "post-update-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
    ]
},
"config": {
    "bin-dir": "bin",
    "platform": {
        "php": "5.5.9"
    }
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "symfony-assets-install": "relative",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    }
}

}

现在

  "repositories": [
    {
    "type": "vcs",
        "url": "https://github.com/sidz/SonataMediaBundle.git",
它是空的 但我仍然希望通过添加另一个adcalendar存储库来使用这个composer.json 但是,当我要求adesigns / calendar-bundle没有下载空或私有存储库(https://github.com/sidz/SonataMediaBundle.git)时,我可以做,谢谢

1 个答案:

答案 0 :(得分:0)

你运气不好。你引用了其他人的东西,专门围绕他们决定不公布他们的工作供一般公众消费。你没有以任何其他方式分配他们的仓库或将他们的工作存储为备份。现在它消失了。

唯一可以留下的是vendor/sidz/SonataMediaBundle目录的当前状态,其中包含您在删除之前可以下载的最新版本。您可以启动一个新的存储库并将此状态提交到该存储库并使用相同的版本对其进行标记,然后将引用切换到此新存储库。 Composer只能按包名运行 - 如果名称没有改变(它在你已经拥有的composer.json文件中定义),并且版本没有改变,Composer认为这个包是相同的,即使源代码也是如此网址不同。

您还可以将您的依赖关系恢复为仍然维护的原始包:https://packagist.org/packages/sonata-project/media-bundle我不知道您的代码需要更改多少才能使其工作,但我&# 39; d强烈建议走那条路,因为否则你必须自己维护那个非官方的包裹。