|
Server : Apache System : Linux s1230 5.15.0-139-generic #149~20.04.1 SMP Tue Jul 14 11:21:49 UTC 2026 x86_64 User : p141464 ( 418825) PHP Version : 7.4.33.12 Disable Function : NONE Directory : /html/KMU-CSR-PLANER/wp-content/plugins/matomo/app/plugins/Live/ |
Upload File : |
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\Live;
use Exception;
use Piwik\Piwik;
class VisitorFactory
{
/**
* Returns Visitor object.
* This method can be overwritten to use a different Visitor object
*
* @param array $visitorRawData
* @throws \Exception
* @return \Piwik\Plugins\Live\VisitorInterface
* @ignore
*/
public function create(array $visitorRawData = array())
{
$visitor = null;
/**
* Triggered while visit is filtering in live plugin. Subscribers to this
* event can force the use of a custom visitor object that extends from
* {@link \Piwik\Plugins\Live\VisitorInterface}.
*
* @param \Piwik\Plugins\Live\VisitorInterface &$visitor Initialized to null, but can be set to
* a new visitor object. If it isn't modified
* Piwik uses the default class.
* @param array $visitorRawData Raw data using in Visitor object constructor.
*/
Piwik::postEvent('Live.makeNewVisitorObject', array(&$visitor, $visitorRawData));
if (is_null($visitor)) {
$visitor = new \Piwik\Plugins\Live\Visitor($visitorRawData);
} elseif (!$visitor instanceof \Piwik\Plugins\Live\VisitorInterface) {
throw new Exception("The Visitor object set in the plugin must implement VisitorInterface");
}
return $visitor;
}
}