pacKman/src/My.php

75 lines
1.4 KiB
PHP
Raw Normal View History

2023-03-11 17:46:23 +00:00
<?php
/**
* @brief pacKman, 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\pacKman;
use dcCore;
2023-05-08 08:43:31 +00:00
/**
* This module definitions.
*/
2023-03-11 17:46:23 +00:00
class My
{
2023-05-08 08:43:31 +00:00
/** @var array Excluded files */
2023-03-11 17:46:23 +00:00
public const EXCLUDED_FILES = [
'.',
'..',
'__MACOSX',
'.svn',
'.hg*',
'.git*',
'CVS',
'.DS_Store',
'Thumbs.db',
'_disabled',
];
2023-05-08 08:43:31 +00:00
/** @var string This module required php version */
public const PHP_MIN = '8.1';
2023-03-19 22:40:08 +00:00
/**
2023-05-08 08:43:31 +00:00
* This module id.
2023-03-19 22:40:08 +00:00
*/
2023-03-16 23:00:34 +00:00
public static function id(): string
2023-03-11 17:46:23 +00:00
{
return basename(dirname(__DIR__));
}
2023-03-19 22:40:08 +00:00
/**
2023-05-08 08:43:31 +00:00
* This module name.
2023-03-19 22:40:08 +00:00
*/
2023-03-16 23:00:34 +00:00
public static function name(): string
2023-03-11 17:46:23 +00:00
{
2023-05-08 08:43:31 +00:00
$name = dcCore::app()->plugins->moduleInfo(self::id(), 'name');
return __(is_string($name) ? $name : self::id());
}
/**
* This module path.
*/
public static function path(): string
{
return dirname(__DIR__);
2023-03-11 17:46:23 +00:00
}
2023-03-19 22:40:08 +00:00
/**
2023-05-08 08:43:31 +00:00
* Check this module PHP version compliant.
2023-03-19 22:40:08 +00:00
*/
public static function phpCompliant(): bool
{
return version_compare(phpversion(), self::PHP_MIN, '>=');
}
2023-03-11 17:46:23 +00:00
}