I have two private butbucket repositories, which involved into a conflict:
bigland/yii2-models-catalogue (currently 1.0.19)
bigland/yii2-models-conceptual-plan (currently 1.0.5)
bigland/yii2-models-catalogue Conmposer.json
{
"name": "bigland/yii2-models-catalogue",
"minimum-stability": "dev",
"license": "proprietary",
"require": {
"php": ">=5.4.0",
"fxp/composer-asset-plugin": ">=1.0.3",
"yiisoft/yii2": "~2.0.0",
"yiisoft/yii2-httpclient": "2.0.x-dev",
"league/geotools": "~0.7.0",
"voskobovich/yii2-many-many-behavior": "*",
"yandex/fotki": "dev-master",
"bigland/yii2-user": "*",
"bigland/yii2-base": "*",
"bigland/yii2-geo": "*",
"bigland/yii2-components-yandex-fotki-api-access": "~1.0.0",
"bigland/yii2-behaviors-yandex-fotki-album": "~1.0.0",
"bigland/yii2-models-conceptual-plan": "~1.0.0",
"fabpot/goutte": "~2.0.4"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/romka-chev/php-yandex-fotki"
},
{
"type": "vcs",
"url": "https://bitbucket.org/bigland/yii2-user"
},
{
"type": "vcs",
"url": "https://bitbucket.org/bigland/yii2-base"
},
{
"type": "vcs",
"url": "https://bitbucket.org/bigland/yii2-geo"
},
{
"type": "vcs",
"url": "https://bitbucket.org/bigland/yii2-components-yandex-fotki-api-access"
},
{
"type": "vcs",
"url": "https://bitbucket.org/bigland/yii2-behaviors-yandex-fotki-album"
},
{
"type": "vcs",
"url": "https://bitbucket.org/bigland/yii2-models-conceptual-plan"
}
],
"autoload": {
"psr-4": {
"bigland\\models\\catalogue\\": ""
}
},
"require-dev": {
"yiisoft/yii2-codeception": "^2.0"
}
}
bigland/yii2-models-conceptual-plan Composer.json
{
"name": "bigland/yii2-models-conceptual-plan",
"minimum-stability": "dev",
"license": "proprietary",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "~2.0.0",
"league/geotools": "~0.7.0",
"voskobovich/yii2-many-many-behavior": "*",
"bigland/yii2-user": "*",
"bigland/yii2-base": "*",
"bigland/yii2-geo": "*",
"bigland/yii2-components-yandex-fotki-api-access": "~1.0.0",
"bigland/yii2-behaviors-yandex-fotki-album": "~1.0.0",
"bigland/yii2-models-catalogue": "~1.0.0"
},
"repositories": [
{
"type": "vcs",
"url": "https://bitbucket.org/bigland/yii2-user"
},
{
"type": "vcs",
"url": "https://bitbucket.org/bigland/yii2-base"
},
{
"type": "vcs",
"url": "https://bitbucket.org/bigland/yii2-geo"
},
{
"type": "vcs",
"url": "https://bitbucket.org/bigland/yii2-components-yandex-fotki-api-access"
},
{
"type": "vcs",
"url": "https://bitbucket.org/bigland/yii2-behaviors-yandex-fotki-album"
},
{
"type": "vcs",
"url": "https://bitbucket.org/bigland/yii2-models-catalogue"
}
],
"autoload": {
"psr-4": {
"bigland\\models\\conceptualPlan\\": ""
}
}
}
If I run composer update into bigland/yii2-models-conceptual-plan repository - everything is fine.
If I run composer update into bigland/yii2-models-catalogue repository - I have the following error:
Problem 1
- bigland/yii2-models-conceptual-plan dev-master requires bigland/yii2-models-catalogue ~1.0.0 -> no matching package found.
- bigland/yii2-models-conceptual-plan 1.0.3 requires bigland/yii2-models-catalogue ~1.0.0 -> no matching package found.
- bigland/yii2-models-conceptual-plan 1.0.2 requires bigland/yii2-models-catalogue ~1.0.0 -> no matching package found.
- bigland/yii2-models-conceptual-plan 1.0.1 requires bigland/yii2-models-catalogue ~1.0.0 -> no matching package found.
- bigland/yii2-models-conceptual-plan 1.0.5 requires bigland/yii2-models-catalogue ~1.0.0 -> no matching package found.
- bigland/yii2-models-conceptual-plan 1.0.4 requires bigland/yii2-models-catalogue ~1.0.0 -> no matching package found.
- Installation request for bigland/yii2-models-conceptual-plan #dev -> satisfiable by bigland/yii2-models-conceptual-plan[1.0.4, 1.0.5, 1.0.1, 1.0.2, 1.0.3, dev-master].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Why is this happens?
Isn't it strange that you've a circulair dependency? A -> B -> A
The solution is following: replace circular dependency versions to dev-master instead of 1.0.x.
bigland/yii2-models-catalogue Conmposer.json
"bigland/yii2-models-conceptual-plan": "dev-master"
bigland/yii2-models-conceptual-plan Composer.json
"bigland/yii2-models-catalogue": "dev-master"
Related
For some reason I'm unable to install Predis package in my project via composer require predis/predis, I have manually downloaded Predis package from https://php-download.com and moved predis folder to the vendor and then updated files inside vendor/composer, it works fine.
However, the problem is when I run composer dump-autoload, this command removes all references of this package from vendor/composer/autoload_psr4.php and autoload_static.php files.
Can someone please help me how can I prevent composer dump-autoload to remove references of this package?
Instead of copying your package to the vendor directory, you can use "repositories" in install a local package:
{
"repositories": [
{
"type": "path",
"url": "../../packages/my-package"
}
],
"require": {
"my/package": "*"
}
}
I fixed it by adding following code in vendor/composer/installed.json , I forgot to add it.
{
"name": "predis/predis",
"version": "v1.1.1",
"version_normalized": "1.1.1.0",
"source": {
"type": "git",
"url": "https://github.com/nrk/predis.git",
"reference": "f0210e38881631afeafb56ab43405a92cafd9fd1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nrk/predis/zipball/f0210e38881631afeafb56ab43405a92cafd9fd1",
"reference": "f0210e38881631afeafb56ab43405a92cafd9fd1",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"require-dev": {
"phpunit/phpunit": "~4.8"
},
"suggest": {
"ext-curl": "Allows access to Webdis when paired with phpiredis",
"ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol"
},
"time": "2016-06-16T16:22:20+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Predis\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Daniele Alessandri",
"email": "suppakilla#gmail.com",
"homepage": "http://clorophilla.net"
}
],
"description": "Flexible and feature-complete Redis client for PHP and HHVM",
"homepage": "http://github.com/nrk/predis",
"keywords": [
"nosql",
"predis",
"redis"
]
}
I am trying to install Avalara for Magento 2 by following these documents- https://github.com/avadev/Avalara-AvaTax-for-Magento2/blob/master/docs/getting-started.md
Following what they have step by step for the composer install I end up with these errors-
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package avalara/avataxclient dev-integration/release-2.0.0 as 18.4.3.191 exists as avalara/avataxclient[17.12.0.147, 17.12.0.149, 17.5.0.67, 17.7.0.96, 17.8.1.120, 17.8.1.x-dev, 18.1.2.161, 18.1.2.x-dev, 18.1.x-dev, 18.10.5.260, 18.12.0, 18.2.0.167, 18.2.x-dev, 18.3.1.176, 18.4.3.191, 18.4.4.191, 18.5.1.208, 18.9.0.234, 19.1.1, 19.2.0, 19.3.0, 19.3.0.x-dev, 19.4.0, 19.4.0.x-dev, 2.17.1, 2.17.1.3, 2.17.2.43, 2.17.3.48, 2.17.4.58, dev-master, v19.1.1.x-dev, v19.2.0.x-dev] but these are rejected by your constraint.
Problem 2
- Installation request for classyllama/module-avatax 2.0.0-RC1 -> satisfiable by classyllama/module-avatax[2.0.0-RC1].
- classyllama/module-avatax 2.0.0-RC1 requires avalara/avataxclient ^18.4.3.191 -> satisfiable by avalara/avataxclient[18.10.5.260, 18.12.0, 18.4.3.191, 18.4.4.191, 18.5.1.208, 18.9.0.234] but these conflict with your requirements or minimum-stability.
Installation failed, reverting ./composer.json to its original content.
This is what my composer.json file looks like-
{
"name": "magento/project-enterprise-edition",
"description": "eCommerce Platform for Growth (Enterprise Edition)",
"type": "project",
"version": "2.3.1",
"license": [
"proprietary"
],
"require": {
"magento/product-enterprise-edition": "2.3.1",
"composer/composer": "#alpha",
"magento/extension-b2b": "^1.0",
"boldcommerce/magento2-ordercomments": "~1.5.0",
"amasty/orderattr": "^3.3",
"ebizmarts/mailchimp-lib": "^3.0",
"galacticlabs/customer-group-payment-filters": "^1.0",
"amasty/module-elastic-search": "^1.3",
"elasticsearch/elasticsearch": "~5.1",
"msp/devtools": "^1.2",
"zf1/zend-rest": "^1.12",
"avalara/avataxclient": "dev-integration/release-2.0.0 as 18.4.3.191"
},
"require-dev": {
"phpunit/phpunit": "~6.2.0",
"squizlabs/php_codesniffer": "3.2.2",
"phpmd/phpmd": "#stable",
"pdepend/pdepend": "2.5.2",
"friendsofphp/php-cs-fixer": "~2.10.1",
"lusitanian/oauth": "~0.8.10",
"sebastian/phpcpd": "~3.0.0"
},
"autoload": {
"psr-4": {
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/",
"Magento\\": "app/code/Magento/",
"Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
},
"psr-0": {
"": [
"app/code/"
]
},
"files": [
"app/etc/NonComposerComponentRegistration.php"
],
"exclude-from-classmap": [
"**/dev/**",
"**/update/**",
"**/Test/**"
]
},
"autoload-dev": {
"psr-4": {
"Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
"Magento\\Tools\\": "dev/tools/Magento/Tools/",
"Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
"Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/",
"Magento\\ToolkitFramework\\": "dev/tools/performance-toolkit/framework/Magento/ToolkitFramework/"
}
},
"minimum-stability": "stable",
"repositories": {
"0": {
"type": "composer",
"url": "https://repo.magento.com/"
},
"amasty": {
"type": "composer",
"url": "https://composer.amasty.com/enterprise/"
},
"xtento": {
"type": "composer",
"url": "https://repo.xtento.com"
}
},
"extra": {
"magento-force": "override"
},
"classyllama-avatax": {
"type": "git",
"url": "git#github.com:classyllama/AvaTax-REST-V2-PHP-SDK.git"
}
}
How can I get this to install properly?
There's an issue with the syntax of your composer.json. Try the following and let me know if you're still having issues.
{
"name":"magento/project-enterprise-edition",
"description":"eCommerce Platform for Growth (Enterprise Edition)",
"type":"project",
"version":"2.3.1",
"license":[
"proprietary"
],
"require":{
"magento/product-enterprise-edition":"2.3.1",
"composer/composer":"#alpha",
"magento/extension-b2b":"^1.0",
"boldcommerce/magento2-ordercomments":"~1.5.0",
"amasty/orderattr":"^3.3",
"ebizmarts/mailchimp-lib":"^3.0",
"galacticlabs/customer-group-payment-filters":"^1.0",
"amasty/module-elastic-search":"^1.3",
"elasticsearch/elasticsearch":"~5.1",
"msp/devtools":"^1.2",
"zf1/zend-rest":"^1.12",
"avalara/avataxclient":"dev-integration/release-2.0.0 as 18.4.3.191"
},
"require-dev":{
"phpunit/phpunit":"~6.2.0",
"squizlabs/php_codesniffer":"3.2.2",
"phpmd/phpmd":"#stable",
"pdepend/pdepend":"2.5.2",
"friendsofphp/php-cs-fixer":"~2.10.1",
"lusitanian/oauth":"~0.8.10",
"sebastian/phpcpd":"~3.0.0"
},
"autoload":{
"psr-4":{
"Magento\\Framework\\":"lib/internal/Magento/Framework/",
"Magento\\Setup\\":"setup/src/Magento/Setup/",
"Magento\\":"app/code/Magento/",
"Zend\\Mvc\\Controller\\":"setup/src/Zend/Mvc/Controller/"
},
"psr-0":{
"":[
"app/code/"
]
},
"files":[
"app/etc/NonComposerComponentRegistration.php"
],
"exclude-from-classmap":[
"**/dev/**",
"**/update/**",
"**/Test/**"
]
},
"autoload-dev":{
"psr-4":{
"Magento\\Sniffs\\":"dev/tests/static/framework/Magento/Sniffs/",
"Magento\\Tools\\":"dev/tools/Magento/Tools/",
"Magento\\Tools\\Sanity\\":"dev/build/publication/sanity/Magento/Tools/Sanity/",
"Magento\\TestFramework\\Inspection\\":"dev/tests/static/framework/Magento/TestFramework/Inspection/",
"Magento\\TestFramework\\Utility\\":"dev/tests/static/framework/Magento/TestFramework/Utility/",
"Magento\\ToolkitFramework\\":"dev/tools/performance-toolkit/framework/Magento/ToolkitFramework/"
}
},
"minimum-stability":"stable",
"repositories":{
"0":{
"type":"composer",
"url":"https://repo.magento.com/"
},
"amasty":{
"type":"composer",
"url":"https://composer.amasty.com/enterprise/"
},
"xtento":{
"type":"composer",
"url":"https://repo.xtento.com"
},
"classyllama-avatax":{
"type":"git",
"url":"git#github.com:classyllama/AvaTax-REST-V2-PHP-SDK.git"
}
},
"extra":{
"magento-force":"override"
}
}
I have two private repositories, let's call them RepoA and RepoB. RepoA is required by the RepoB and they are both private repos on gitlab with the port 620.
Here are the composer.json in both repo:
Repo A
{
"name": "namespace/repoA",
"description": "My repository A.",
"require": {
"php": ">=5.4"
}
}
Repo B
{
"name": "namespace/repoB",
"description": "My repository B.",
"repositories": [
{
"type": "vcs",
"url": "ssh://git#git.domain.com:620/namespace/repoA.git"
}
],
"require": {
"namespace/repoA": "dev-master"
}
}
Now let's say I have a project (ProjectA), which I want to install RepoB.
Project A
{
"repositories": [
{
"type": "vcs",
"url": "ssh://git#git.domain.com:620/namespace/repoB.git"
}
],
"require": {
"namespace/repoB": "dev-master"
}
}
However, when I run my composer install, I get the following error:
Problem 1
- Installation request for namespace/repoB dev-master -> satisfiable by namespace/repoB[dev-master].
- namespace/repoB dev-master requires namespace/repoA dev-master -> no matching package found.
I understand that it's unable to find the package since it's a private repository, but since it's inside the repositories of the repoB, why is it not fetching it?
I thought it would work if I added the repositories to the Project A:
{
"repositories": [
{
"type": "vcs",
"url": "ssh://git#git.domain.com:620/namespace/repoA.git"
},
{
"type": "vcs",
"url": "ssh://git#git.domain.com:620/namespace/repoB.git"
}
],
"require": {
"namespace/repoB": "dev-master"
}
}
But it still does not work until I add it into my require of my Project Aas well:
{
"repositories": [
{
"type": "vcs",
"url": "ssh://git#git.domain.com:620/namespace/repoA.git"
},
{
"type": "vcs",
"url": "ssh://git#git.domain.com:620/namespace/repoB.git"
}
],
"require": {
"namespace/repoB": "dev-master",
"namespace/repoA": "dev-master"
}
}
Now my question is... How can I make composer install my repoA by specifying only my repoB?
You cannot and here is an explanation: Why can't Composer load repositories recursively?
I forked a library on Github and now want to load my fork into the project without adding the forked library into packagist. I get the following error after adding the repository and require to my composer.json:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package cnizzardini/ssl-certificate could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Here is my full composer.json
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "http://cakephp.org",
"type": "project",
"license": "MIT",
"require": {
"php": ">=5.5.9",
"cakephp/cakephp": "~3.4",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/plugin-installer": "*",
"guzzlehttp/guzzle": "^6.2",
"donatj/phpuseragentparser": "^0.7.0",
"cnizzardini/ssl-certificate": "dev-master"
},
"require-dev": {
"psy/psysh": "#stable",
"cakephp/debug_kit": "~3.2",
"cakephp/bake": "~1.1",
"phpunit/phpunit": "^5.5"
},
"suggest": {
"phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
"cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
},
"autoload": {
"psr-4": {
"App\\": "src",
"Api\\": "./plugins/Api/src",
"Channel\\": "./plugins/Channel/src",
"System\\": "./plugins/System/src",
"Admin\\": "./plugins/Admin/src"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests",
"Cake\\Test\\": "./vendor/cakephp/cakephp/tests",
"Api\\Test\\": "./plugins/Api/tests",
"Channel\\Test\\": "./plugins/Channel/tests",
"System\\Test\\": "./plugins/System/tests",
"Admin\\Test\\": "./plugins/Admin/tests"
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall",
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/cnizzardini/ssl-certificate.git"
}
],
"minimum-stability": "stable",
"prefer-stable": true
}
I have tried adding https://github.com/cnizzardini/ssl-certificate with and without the .git. I have also tried setting minimum-stability to dev and prefer-stable to false.
Nothing works :-(
The composer.json file on your fork still calls the package "spatie/ssl-certificate", so that's the name of the package you need to require.
This should work:
{
...
"require": {
...
"spatie/ssl-certificate": "dev-master"
},
...
"repositories": [
{
"type": "vcs",
"url": "https://github.com/cnizzardini/ssl-certificate.git"
}
],
...
}
If it doesn't, you can rename the package on your own fork by changing the name property in its composer.json file:
{
"name": "cnizzardini/ssl-certificate",
"description": "A class to easily query the properties of an ssl certificate ",
...
}
I have a own TYPO3 extension hosted on bitbucket. Getting this via composer works (see here for input). The extension is downloaded into my vendor folder. Being there i cannot install the extension via extension-manager.
How can I getting my ext into typo3conf/ext (ensuring autoloading will work)?
The extensions coming via
{
"type": "composer",
"url": "http://composer.typo3.org/"
}
are going to (as expected):
web/typo3config/ext
here is my project composer.json:
{
"repositories": [
{
"type": "composer",
"url": "http://composer.typo3.org/"
},
{
"type": "package",
"package": {
"name": "metaxos/exaibbrplus",
"version": "dev-2016",
"source": {
"url": "https://metaxos#bitbucket.org/metaxos/exaibbrplus.git",
"type": "git",
"reference": "release/2016"
}
}
}
],
"name": "Metaxos/ibbrating2016",
"require": {
"typo3/cms": "7.6.2",
"bk2k/bootstrap-package" : "dev-master",
"typo3-ter/compatibility6" : "7.6.0",
"typo3-ter/extension-builder" : "7.6.0",
"metaxos/exaibbrplus": "dev-2016"
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": "web"
}
}
}
here is my extension composer.json:
{
"name": "metaxos/exaibbrplus",
"description": "custom ext for typo3",
"type": "typo3-cms-extension",
"version": "0.0.1",
"require": {
"typo3/cms-core": ">=7.6.0,<8.0"
},
"replace": {
"extkey": "self.version",
"typo3-ter/extkey": "self.version"
},
"autoload": {
"psr-4": {
"Metaxos\\Exaibbrplus\\": "Classes/"
}
},
"keywords": ["custom", "ext"],
"homepage": "http://www.blah.ch"
}
For Composer to install the package in web/typo3conf/ext, the package needs to have the type typo3-cms-extension. In your extension's composer.json this type is actually declared, however Composer will not respect it because you explicitly declare the package configuration in your project-level composer.json:
"repositories": [
# ...
{
"type": "package",
"package": {
"name": "metaxos/exaibbrplus",
"version": "dev-2016",
"source": {
"url": "https://metaxos#bitbucket.org/metaxos/exaibbrplus.git",
"type": "git",
"reference": "release/2016"
}
}
}
]
As you're using "type": "package" for your own repository, I suspect that Composer ignores the composer.json from that package. As you already have a Git repository that contains a composer.json, I'd suggest adding the repository using the vcs type instead:
"repositories": [
{
"type": "vcs",
"url": "https://metaxos#bitbucket.org/metaxos/exaibbrplus.git"
}
]
When doing that, Composer should use the composer.json from that repository, recognize the correct package type (typo3-cms-extension) and install the package in the correct directory.
You need to add the type key with the value typo3-cms-extension to the root composer.json. This will place your extension in web/typo3conf/ext instead of vendor/$vendor/$package which in turn will make it available to the cms.
It is important, to know that if you redefine the package in the root composer.json as repository type package, nothing from the extensions' composer.json file will be taken into account and you need to define any concerns about that package in the root composer.json.
So-applying the rules I mentioned above, your root composer.json will look like that:
{
"repositories": [
{
"type": "composer",
"url": "http://composer.typo3.org/"
},
{
"type": "package",
"package": {
"name": "metaxos/exaibbrplus",
"version": "dev-2016",
"type": "typo3-cms-extension",
"source": {
"url": "https://metaxos#bitbucket.org/metaxos/exaibbrplus.git",
"type": "git",
"reference": "release/2016"
},
"autoload": {
"psr-4": {
"Metaxos\\Exaibbrplus\\": "Classes/"
}
},
}
}
],
"name": "Metaxos/ibbrating2016",
"require": {
"typo3/cms": "7.6.2",
"bk2k/bootstrap-package" : "dev-master",
"typo3-ter/compatibility6" : "7.6.0",
"typo3-ter/extension-builder" : "7.6.0",
"metaxos/exaibbrplus": "dev-2016"
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": "web"
}
}
}
As mentioned above by #helmbert, you are either left with completely redefining the package or using another repository type. You may want to consider using satis or a URL repository.
try to add
"replace": {
"exaibbrplus": "self.version",
"typo3-ter/exaibbrplus": "self.version"
},
And use only "Metaxos\\Exaibbrplus\\": "Classes/" in the autoloader.