Modulinstallation und andere coole Composer Features
(auch) für den OXID eShop ... und ein bisschen Shopware ;)
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
getcomposer.org
"require": {
"shoptimax/custmod": "1.*",
"composer/installers": "~1.2"
},
"extra": {
"installer-paths": {
"modules/{$vendor}/{$name}/": ["type:oxid-module"]
}
}
"repositories": [
{
"type": "package",
"package": {
"name": "shoptimax/custmod",
"type": "oxid-module",
"version": "1.0.0",
"dist": {
"url": "http://oxid.dev.local/custmod.zip",
"type": "zip"
}
}
},
"require": {
"shoptimax/custmod": "1.*",
"shoptimax/custtheme": "1.*",
"composer/installers": "~1.2"
},
"extra": {
"installer-paths": {
"modules/{$vendor}/{$name}/": ["type:oxid-module"],
"application/views/{$name}/": ["type:oxid-theme"]
}
}
"name": "shoptimax/custtheme",
"type": "oxid-theme",
"version": "1.0.0",
"dist": {
"url": "http://oxid.dev.local/custtheme.zip",
"type": "zip"
}
"extra": {
"installer-types": ["library"],
"installer-paths": {
"special/package/": ["my/package"],
"path/to/libraries/{$name}/": ["type:library"]
}
}
Composer in OXID 6
Composer in OXID 6
composer create-project
oxid-esales/oxideshop-project project_name dev-b-6.0-ce
Composer in OXID 6
"type": "oxideshop-module",
...
"extra": {
"oxideshop": {
"target-directory": "{$vendor}/{$name}"
}
}
Composer in OXID 6
"require": {
"shoptimax/custmod": "1.*",
"wikimedia/composer-merge-plugin": "dev-master"
},
"extra": {
"merge-plugin": {
"include": [
"modules/**/*/composer.json"
],
"recurse": true,
"replace": true,
"merge-dev": true,
"merge-extra": false,
"merge-extra-deep": false
}
}
"extra": {
"name": "shoptimax/custmod",
"description": "a module",
"type": "oxid-module",
"version": "1.0.0",
"require": {
"composer/installers": "~1.2",
"symfony/yaml": "*"
}
}
"scripts": {
"post-autoload-dump": [
"ioly\\IolyInstaller::postAutoloadDump"
]
},
public static function postAutoloadDump(Event $event)
{
$vendorDir = $event->getComposer()
->getConfig()->get('vendor-dir');
...
Custom Composer Installers
Custom Composer Installers
"omc-composer-installer": {
"oxidversion": "4.10",
"cookbooks": {
"omc": "https://github.com/OXIDprojects/OXID-Modul-Connector/archive/recipes.zip"
},
"modules": {
"jkrug/ocbcleartmp": "1.0.0-v47",
"oxcom/oxcom-omc": "latest"
},
Vorteile / Unterschiede zu Composer