[CONFIG] Various fixes to use new configuration format

This commit is contained in:
Hugo Sales
2020-09-30 22:57:25 +00:00
committed by Hugo Sales
parent a9944592c4
commit 06e92344cc
7 changed files with 75 additions and 16 deletions

View File

@@ -126,6 +126,7 @@ abstract class DB
public static function __callStatic(string $name, array $args)
{
foreach (['find', 'getReference', 'getPartialReference', 'getRepository'] as $m) {
// TODO Plugins
$pref = '\App\Entity\\';
if ($name == $m && Formatting::startsWith($name, $pref) === false) {
$args[0] = $pref . ucfirst(Formatting::snakeCaseToCamelCase($args[0]));

View File

@@ -130,7 +130,7 @@ class GNUsocial implements EventSubscriberInterface
public function initialize(): void
{
if (!$this->initialized) {
Common::setConfigBag($this->config);
Common::setupConfig($this->config);
Log::setLogger($this->logger);
Event::setDispatcher($this->event_dispatcher);
I18n::setTranslator($this->translator);

View File

@@ -89,7 +89,6 @@ class ModuleManager
$module_manager = new self();
$entity_paths = [];
foreach ($module_paths as $path) {
// 'modules' and 'plugins' have the same length
$type = ucfirst(preg_replace('%' . INSTALLDIR . '/(component|plugin)s/.*%', '\1', $path));
$dir = dirname($path);
$module = basename($dir);