2021-08-16 20:36:26 +00:00
|
|
|
<?php
|
2021-09-02 21:01:31 +00:00
|
|
|
/**
|
|
|
|
* @brief simplyFavicon, a plugin for Dotclear 2
|
2021-11-06 01:23:40 +00:00
|
|
|
*
|
2021-09-02 21:01:31 +00:00
|
|
|
* @package Dotclear
|
|
|
|
* @subpackage Plugin
|
2021-11-06 01:23:40 +00:00
|
|
|
*
|
2021-09-02 21:01:31 +00:00
|
|
|
* @author Jean-Christian Denis
|
2021-11-06 01:23:40 +00:00
|
|
|
*
|
2021-09-02 21:01:31 +00:00
|
|
|
* @copyright Jean-Christian Denis
|
|
|
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
*/
|
2023-03-06 22:05:51 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Dotclear\Plugin\simplyFavicon;
|
|
|
|
|
|
|
|
use dcCore;
|
|
|
|
use dcNsProcess;
|
|
|
|
|
|
|
|
class Prepend extends dcNsProcess
|
|
|
|
{
|
|
|
|
public static function init(): bool
|
|
|
|
{
|
|
|
|
self::$init = true;
|
2021-08-16 20:36:26 +00:00
|
|
|
|
2023-03-06 22:05:51 +00:00
|
|
|
return self::$init;
|
|
|
|
}
|
2021-08-16 20:36:26 +00:00
|
|
|
|
2023-03-06 22:05:51 +00:00
|
|
|
public static function process(): bool
|
|
|
|
{
|
|
|
|
if (!self::$init) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
dcCore::app()->url->register(
|
|
|
|
'simplyFavicon',
|
|
|
|
'favicon',
|
|
|
|
'^favicon.(.*?)$',
|
|
|
|
[UrlHandler::class, 'simplyFaviconUrl']
|
|
|
|
);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|