2016-09-20 30 views
0

我必須保留0.18 sylius/sylius如何用我自己的VCS存儲庫覆蓋作曲家中的sylius 0.18?

我已經fork了master並創建了一個新的分支0.18,合併到一些PR中。

現在我想使用這個倉庫,而不是sylius/sylius v0.18標籤

這裏我composer.json

{ 
"name":  "sylius/sylius-standard", 
"description": "Starting point for projects powered by Sylius eCommerce.", 
"keywords": ["symfony", "symfony2", "sylius", "distribution", "ecommerce", "cart", "shopping"], 
"type":  "project", 
"license":  "MIT", 
"homepage": "http://sylius.org", 
"authors": [ 
    { 
     "name":  "Paweł Jędrzejewski", 
     "homepage": "http://pjedrzejewski.com" 
    }, 
    { 
     "name":  "Sylius project", 
     "homepage": "http://sylius.org" 
    }, 
    { 
     "name":  "Community contributions", 
     "homepage": "http://github.com/Sylius/Sylius/contributors" 
    } 
], 
"repositories": [ 
    { 
     "type": "vcs", 
     "url": "https://github.com/ibasaw/DoctrineBehaviors" 
    }, 
    { 
     "type": "vcs", 
     "url": "https://github.com/ibasaw/sylius" 
    } 
], 
"require": { 
    "php": ">=5.6", 

    "sylius/sylius": "^[email protected]", 
    ...... 
}, 
"require-dev": { 
    "behat/behat": "^3.0", 
    "behat/symfony2-extension": "^2.0", 
    "behat/mink-extension": "^2.0", 
    "behat/mink-browserkit-driver": "^1.2", 
    "behat/mink-selenium2-driver": "^1.2", 
    "behat/mink": "^1.6", 
    "coduo/php-matcher": "^[email protected]", 
    "phpspec/phpspec": "^2.4", 
    "phpunit/phpunit": "^4.1", 
    "lakion/api-test-case": "^[email protected]" 
}, 
"minimum-stability": "dev", 
"prefer-stable": true, 
"scripts": { 
    "post-install-cmd": [ 
     "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 
     "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreateAndCkeditor", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" 
    ], 
    "post-update-cmd": [ 
     "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 
     "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreateAndCkeditor", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 
     "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" 
    ] 
}, 
"autoload": { 
    "psr-0": { 
     "": "src/", 
     "Context": "features/" 
    } 
}, 
"config": { 
    "bin-dir": "bin" 
}, 
"extra": { 
    "branch-alias": { 
     "dev-master": "0.18" 
    }, 
    "symfony-app-dir": "app", 
    "symfony-web-dir": "web", 
    "incenteev-parameters": { 
     "file": "app/config/parameters.yml" 
    } 
} 

}

當我做了作曲家更新,在供應商目錄需要sylius/sylius而不是ibasaw/sylius

爲什麼?

如何強制使用我的新分支0.18的VCS?

+0

我用「branch-alias」替換了「branch-alias」:{「dev-master」:「0.18」}:{「dev-master」:「0.18-dev」}它似乎採取了良好的存儲庫。但現在我得到了這個問題:致命的錯誤:類'Sylius \ Bundle \ CoreBundle \ Kernel \ Kernel'找不到在/var/www/sources/xxx/app/AppKernel.php在線9 – ibasaw

+1

大多數情況下,因爲'Sylius \ Bundle \ CoreBundle \ Kernel \ Kernel'在v0.18和v0.19之間被替換爲'Sylius \ Bundle \ CoreBundle \ Application \ Kernel'。你可以檢查它[這裏](https://github.com/Sylius/Sylius/blob/v0.19.0/app/AppKernel.php#L12) – lchrusciel

回答

0

添加您的分叉Sylius存儲庫這樣在你composer.json

"repositories": [ 
{ 
    "type": "git", 
    "url": "https://github.com/ylastapis/Sylius.git" 
}], 

你可以要求你的主人分行或創建一個自定義分支(合併代碼待定那Sylius團隊接受你的合併,礦山被稱爲主POC)

在需要部分,需要您的分支,由前綴「dev亡」。所以主成爲開發高手,所以我的分支主POC現在DEV-主POC

"require": { 
    "sylius/sylius": "dev-master-poc" 
    }, 

我也有一個分支別名,不記得,如果它仍然是有用的

"extra": { 
    "branch-alias": { 
     "dev-master": "1.0-dev" 
    } 
    } 

一些鏈接到doc:https://getcomposer.org/doc/05-repositories.md#loading-a-package-from-a-vcs-repository

+0

它重寫,但得到了錯誤致命錯誤:Class'Sylius \ Bundle在第9行的/var/www/sources/xxx/app/AppKernel.php中找不到\ CoreBundle \ Kernel \ Kernel – ibasaw

相關問題