@xtra,
thanks for explaining the vendor packages, unfortunately there are a few questions remaining.
Your _external is similiar with packagist.org, except bundles are loaded from the local repository, isn't it?
If I want to have more local bundles, could this be done with a packages.json in which all my bundles are declared? Assuming the following filestructure in _external
Code:
bundle1
.git
src
namespace.php (namespace declaration)
composer.json (bundle informations, like requirements and dependencies)
composer.json (composer install informations)
bundle2
.git
src
namespace.php
composer.json
composer.json
packages.json (for declaration of my bundles in my repository)
I have the following packages.json
PHP-Code:
{
"packages": {
"vendor/bundle1": {
"dev-master": {
"name": "vendor/bundle1",
"version": "1.0.0",
"dist": {
"type": "path",
"url": "D:\\_external\\bundle1"
}
}
},
"vendor/bundle2": {
"dev-master": {
"name": "vendor/bundle2",
"version": "1.0.0",
"dist": {
"type": "path",
"url": "D:\\_external\\bundle2"
}
}
}
}
}
and the the two Composer.json
PHP-Code:
{
"autoload": {
"psr-4": { "vendor\\bundle1": "src/" }
}
}
and
PHP-Code:
{
"name": "vendor/bundle1",
"description": "Contao Extension for testing purpose",
"keywords": ["contao", "Extension","test"],
"type": "contao-module",
"homepage": "",
"license": "GPL-3.0-or-later",
"authors":[
{
"name":"John Doe",
"homepage":"",
"role":"Developer"
}
],
"support":{
"email": "",
"issues":"",
"source":""
},
"require": {
"php": ">=5.3",
"contao/core-bundle": "~3.5 || ~4.1"
},
}
It is a little bit confusing with vendor/bundle in the different files. My goal is to reduce the given information in the json files to the absolutly neccesary minimum. My problem is, that composer gives me a failure:
Could not find package vendor\bundle1 with stability stable if I try to "composer create-project ", with composer require it seems that he is copying the src Folder.
Am I right that if I have a require contao/core-bundle in my bundle that contao should be installed, too, when I "composer create-project vendor/bundle1"?
Lesezeichen