simplyFavicon/src/Prepend.php

45 lines
824 B
PHP
Raw Normal View History

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
{
2023-03-21 20:37:06 +00:00
static::$init = true;
2021-08-16 20:36:26 +00:00
2023-03-21 20:37:06 +00:00
return static::$init;
2023-03-06 22:05:51 +00:00
}
2021-08-16 20:36:26 +00:00
2023-03-06 22:05:51 +00:00
public static function process(): bool
{
2023-03-21 20:37:06 +00:00
if (!static::$init) {
2023-03-06 22:05:51 +00:00
return false;
}
dcCore::app()->url->register(
'simplyFavicon',
'favicon',
'^favicon.(.*?)$',
[UrlHandler::class, 'simplyFaviconUrl']
);
return true;
}
}