tweakStores/inc/Prepend.php

51 lines
1018 B
PHP
Raw Normal View History

2021-08-26 22:38:34 +00:00
<?php
2021-09-27 22:46:41 +00:00
/**
* @brief tweakStores, a plugin for Dotclear 2
2021-11-04 23:43:37 +00:00
*
2021-09-27 22:46:41 +00:00
* @package Dotclear
* @subpackage Plugin
2021-11-04 23:43:37 +00:00
*
2021-09-27 22:46:41 +00:00
* @author Jean-Christian Denis and Contributors
2021-11-04 23:43:37 +00:00
*
2021-09-27 22:46:41 +00:00
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
2023-01-06 08:31:44 +00:00
declare(strict_types=1);
namespace Dotclear\Plugin\tweakStores;
/* clearbricks ns */
use Clearbricks;
class Prepend
{
private const LIBS = [
'Admin',
'Config',
'Core',
];
protected static $init = false;
public static function init(): bool
{
self::$init = defined('DC_RC_PATH');
2021-08-26 22:38:34 +00:00
2023-01-06 08:31:44 +00:00
return self::$init;
}
public static function process(): ?bool
{
if (!self::$init) {
return false;
}
foreach (self::LIBS as $lib) {
Clearbricks::lib()->autoload([
implode('\\', ['Dotclear','Plugin', basename(__NAMESPACE__), $lib]) => __DIR__ . DIRECTORY_SEPARATOR . $lib . '.php',
]);
}
return true;
}
}