Open Luehrsen opened 4 years ago
This seems related to: #17
Laravel does this with a config
helper function.
https://laravel.com/docs/5.3/configuration#accessing-configuration-values
If Berlin is intended to be used outside of WordPress, it might be prudent to make this work in a pattern that is consistent with systems like Laravel.
As mentioned in this Stack Overflow:
The Laravel way is using config files. Create my.php and put it in /config directory and then access constant values globally:
config('my.variable')
Here's an example of my.php:
<?php return [ 'variable' => 15, 'some-array' => [1, 2, 5], ];
Right now if you are using BerlinDB via composer you would have to set
$db_global
in every class that extendsBase
. This feels mighty redundant.It would be nice to be able to configure the variables in
Base
(db_global
,prefix
) from some outside method in the plugin.