[CORE][EXTENSIONS] Added extension (modules, plugins) loading and test plugin, which is able to handle events

This commit is contained in:
Hugo Sales
2020-03-20 22:10:01 +00:00
committed by Hugo Sales
parent cfc269aca4
commit 6df658a987
12 changed files with 274 additions and 42 deletions

View File

@@ -17,6 +17,34 @@ class Kernel extends BaseKernel
private const CONFIG_EXTS = '.{php,xml,yaml,yml}';
public function __construct(string $environment, bool $debug)
{
parent::__construct($environment, $debug);
if (!\defined('INSTALLDIR')) {
define('INSTALLDIR', dirname(__DIR__));
define('SRCDIR', INSTALLDIR . '/src');
define('PUBLICDIR', INSTALLDIR . '/public');
define('GNUSOCIAL_ENGINE', 'GNU social');
// MERGE Change to https://gnu.io/social/
define('GNUSOCIAL_ENGINE_URL', 'https://gnusocial.network/');
// MERGE Change to https://git.gnu.io/gnu/gnu-social
define('GNUSOCIAL_ENGINE_REPO_URL', 'https://notabug.org/diogo/gnu-social/');
// Current base version, major.minor.patch
define('GNUSOCIAL_BASE_VERSION', '3.0.0');
// 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
define('GNUSOCIAL_LIFECYCLE', 'dev');
define('GNUSOCIAL_VERSION', GNUSOCIAL_BASE_VERSION . '-' . GNUSOCIAL_LIFECYCLE);
define('GNUSOCIAL_CODENAME', 'Big bang');
// Work internally in UTC
date_default_timezone_set('UTC');
// Work internally with UTF-8
mb_internal_encoding('UTF-8');
}
}
public function registerBundles(): iterable
{
$contents = require $this->getProjectDir() . '/config/bundles.php';
@@ -37,6 +65,7 @@ class Kernel extends BaseKernel
$container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php'));
$container->setParameter('container.dumper.inline_class_loader', PHP_VERSION_ID < 70400 || $this->debug);
$container->setParameter('container.dumper.inline_factories', true);
$confDir = $this->getProjectDir() . '/config';
$loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob');