Hi There!!
will be glad if you could help me with this issue
I am new to Kirby and trying to add .env file to the kirby repository.
Tried following steps
Install "bnomei/kirby3-dotenv": "^1.1"
Create .env file
Matomo Token is used to access the Matomo dashboard.
MATOMO_TOKEN= 334*******************************9
initialized plugin inside /config/config.php as bellow
<?php
Bnomei\DotEnv::load();
$matomo_token = getenv('MATOMO_TOKEN');
return [
'sylvainjule.matomo.url' => 'my/motomo/url',
'sylvainjule.matomo.id' => '1',
'sylvainjule.matomo.token' => $matomo_token
];
I am unable to use the token using .env and getting the following error
Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes)
bnomei
July 10, 2019, 12:48pm
2
you can not use a plugin in the config file without an closure.
return [
'sylvainjule.matomo.url' => 'my/motomo/url',
'sylvainjule.matomo.id' => '1',
'sylvainjule.matomo.token' => function () {
Bnomei\DotEnv::load();
return getenv('MATOMO_TOKEN');
}
];
i created a feature request for the matomo plugin by @sylvainjule to support this.
Thanks for the quick replay!!
will be great to see this working after the issue " allow token from closure "
bnomei
July 11, 2019, 9:55am
4
a little tip: if you type @ followed by any name of a forum member they will receive a notification unless they have already posted in the thread. so feel free to mention me with @bnomei if you need help with any of my plugins.
@bnomei Thanks for the solution!!
However, after updating the Matomo and config.php now I can see an empty dashboard Like bellow
still, there is a problem to update Token from .env the file. will be great if you could help me !!
bnomei
July 12, 2019, 9:41am
6
@sylvainjule has not yet responded or even implemented the possibility for the token to be a closure. unless you apply a hotfix yourself it will not work yet. please โwatchโ the issue to get notifications once its implmented.
Sure will wait until it gets resolved
v2 of my plugin now supports loading in config file and multi-environment setups. see examples