| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/lemans/libraries/kunena/src/Log/ |
Upload File : |
<?php
/**
* Kunena Component
*
* @package Kunena.Libraries
* @subpackage Log
*
* @copyright Copyright (C) 2008 - @currentyear@ Kunena Team. All rights reserved.
* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
**/
namespace Kunena\Forum\Libraries\Log;
\defined('_JEXEC') or die();
use Exception;
use Joomla\CMS\Date\Date;
use Joomla\CMS\Factory;
use Kunena\Forum\Libraries\Forum\Category\KunenaCategory;
use Kunena\Forum\Libraries\Forum\Topic\KunenaTopic;
use Kunena\Forum\Libraries\User\KunenaUser;
use Kunena\Forum\Libraries\User\KunenaUserHelper;
/**
* implements \Kunena log entry.
*
* @since 5.0
*/
class KunenaEntry
{
/**
* @var array
* @since Kunena 5.0
*/
public $data;
/**
* @param mixed $type type
* @param mixed $operation operation
* @param mixed $data data
* @param KunenaCategory|null $category category
* @param KunenaTopic|null $topic topic
* @param KunenaUser|null $user user
*
* @since Kunena 5.0
*
* @throws Exception
*/
public function __construct(
$type,
$operation,
$data,
?KunenaCategory $category = null,
?KunenaTopic $topic = null,
?KunenaUser $user = null
) {
$now = new Date();
$this->data = [
'type' => (int) $type,
'user_id' => KunenaUserHelper::getMyself()->userid,
'category_id' => $category ? $category->id : 0,
'topic_id' => $topic ? $topic->id : 0,
'target_user' => $user ? $user->userid : 0,
'ip' => Factory::getApplication()->isClient('site') && KunenaUserHelper::getUserIp() !== null ? KunenaUserHelper::getUserIp() : '',
'time' => $now->toUnix(),
'operation' => $operation,
'data' => json_encode($data),
];
}
/**
* Get all the data.
*
* @return array
*
* @since Kunena 5.0
*/
public function getData(): array
{
return $this->data;
}
}