Hi,
i would like to install kirby and some plugins by composer to a custom directory ‘src’ with a public folder setup. i achive that by the following config in composer.json
{
"require": {
"php": ">=7.4.0 <8.2.0",
"getkirby/cms": "^3.6"
},
"config": {
"vendor-dir": "src/vendor",
"optimize-autoloader": true,
"allow-plugins": {
"getkirby/composer-installer": true
}
},
"extra": {
"kirby-cms-path": false,
"kirby-plugin-path": "src/site/plugins"
}
}
so far so good. kirby is running.
unfortenetly i get some really bad path-problems, after requiring plugins, which stops kirby
composer require beebmx/kirby-env
the plugin is installed correctly to src/site/plugins/…
but there are some issues with the pluginpath after reloading the site
in vendor/composer/autoload_classmap.php and co. (autoload_psr4.php, autoload_static.php…) is the path from kirby-plugin-path, that contains ‘src’ - but i am already in ‘src’ and so i need to have that a bit more relative - maybe relative to the vendor-dir…
return array(
'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Beebmx\\KirbyEnv' => $baseDir . '/src/site/plugins/kirby-env/src/KirbyEnv.php',
'Carbon\\AbstractTranslator' => $vendorDir . '/nesbot/carbon/src/Carbon/AbstractTranslator.php',
furthermore in the autoload_static.php also the basedir has one ‘/…’ to much
(i guess that is the path to the plugin from project-root / composer.json, but unfortenetly in my case, that’s one level to much
array (
'Beebmx\\' =>
array (
0 => __DIR__ . '/../../..' . '/src/site/plugins/kirby-env/src',
),
I was able to change some paths manually in ‘autoload_static.php’, so kirby runs again, also with Kirby-Env, but i would like to have that a bit more automaticly…
public static $classMap = array (
//'Beebmx\\KirbyEnv' => __DIR__ . '/../../..' . '/src/site/plugins/kirby-env/src/KirbyEnv.php',
'Beebmx\\KirbyEnv' => __DIR__ . '/../..' . '/site/plugins/kirby-env/src/KirbyEnv.php',
Unfortenetly i am not that experienced with composer… and also not with the PluginInstaller by @lukasbestle
So, does anyone knows how to fix that or set the pluginpath for the autoloader more relative to the vendor-dir? That would be very very nice!
Thanks in advance!