2023-04-20 12:22:43 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @brief activityReport, a plugin for Dotclear 2
|
|
|
|
*
|
|
|
|
* @package Dotclear
|
|
|
|
* @subpackage Plugin
|
|
|
|
*
|
|
|
|
* @author Jean-Christian Denis and contributors
|
|
|
|
*
|
|
|
|
* @copyright Jean-Christian Denis
|
|
|
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Dotclear\Plugin\activityReport;
|
|
|
|
|
|
|
|
use dcCore;
|
|
|
|
|
|
|
|
/**
|
2023-05-08 08:18:43 +00:00
|
|
|
* This module definitions.
|
2023-04-20 12:22:43 +00:00
|
|
|
*/
|
|
|
|
class My
|
|
|
|
{
|
|
|
|
/** @var string Activity database table name */
|
|
|
|
public const ACTIVITY_TABLE_NAME = 'activity';
|
|
|
|
|
|
|
|
/** @var string Cache sub directory name */
|
|
|
|
public const CACHE_DIR_NAME = 'activityreport';
|
|
|
|
|
|
|
|
/** @var int Incremental version by breaking changes */
|
|
|
|
public const COMPATIBILITY_VERSION = 3;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This module id.
|
|
|
|
*/
|
|
|
|
public static function id(): string
|
|
|
|
{
|
|
|
|
return basename(dirname(__DIR__));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This module name.
|
|
|
|
*/
|
|
|
|
public static function name(): string
|
|
|
|
{
|
2023-05-08 08:18:43 +00:00
|
|
|
$name = dcCore::app()->plugins->moduleInfo(self::id(), 'name');
|
|
|
|
|
|
|
|
return __(is_string($name) ? $name : self::id());
|
2023-04-20 12:22:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-05-08 08:18:43 +00:00
|
|
|
* This module path.
|
2023-04-20 12:22:43 +00:00
|
|
|
*/
|
2023-05-08 08:18:43 +00:00
|
|
|
public static function path(): string
|
2023-04-20 12:22:43 +00:00
|
|
|
{
|
|
|
|
return dirname(__DIR__);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-05-08 08:18:43 +00:00
|
|
|
* Check is module is trully installed.
|
|
|
|
*
|
|
|
|
* Required as table structrue has changed
|
2023-04-20 12:22:43 +00:00
|
|
|
*/
|
2023-05-08 08:18:43 +00:00
|
|
|
public static function isInstalled(): bool
|
2023-04-20 12:22:43 +00:00
|
|
|
{
|
2023-05-08 08:18:43 +00:00
|
|
|
return dcCore::app()->getVersion(self::id()) == dcCore::app()->plugins->moduleInfo(self::id(), 'version');
|
2023-04-20 12:22:43 +00:00
|
|
|
}
|
|
|
|
}
|