simplyFavicon/src/Prepend.php

45 lines
824 B
PHP

<?php
/**
* @brief simplyFavicon, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
declare(strict_types=1);
namespace Dotclear\Plugin\simplyFavicon;
use dcCore;
use dcNsProcess;
class Prepend extends dcNsProcess
{
public static function init(): bool
{
static::$init = true;
return static::$init;
}
public static function process(): bool
{
if (!static::$init) {
return false;
}
dcCore::app()->url->register(
'simplyFavicon',
'favicon',
'^favicon.(.*?)$',
[UrlHandler::class, 'simplyFaviconUrl']
);
return true;
}
}