قرینه از
https://github.com/matomo-org/matomo.git
synced 2025-08-22 15:07:44 +00:00

* [Coding Style] Enable rule PSR12.Files.FileHeader * Apply CS * Replace Piwik with Matomo in file headers * Unify file headers (position, no. of lines, https links) * Rebuild dist files * Apply CS * Fix system test that relies on line numbers in a file that had the file header updated --------- Co-authored-by: Stefan Giehl <stefan@matomo.org>
71 خطوط
1.8 KiB
PHP
71 خطوط
1.8 KiB
PHP
<?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\Tests\Framework\Mock\Tracker;
|
|
|
|
use Exception;
|
|
use Piwik\Tracker;
|
|
use Piwik\Tracker\RequestSet as TrackerRequestSet;
|
|
|
|
class Handler extends \Piwik\Tracker\Handler
|
|
{
|
|
public $isInit = false;
|
|
public $isInitTrackingRequests = false;
|
|
public $isOnStartTrackRequests = false;
|
|
public $isProcessed = false;
|
|
public $isOnAllRequestsTracked = false;
|
|
public $isOnException = false;
|
|
public $isFinished = false;
|
|
public $output = 'My Rendered Content';
|
|
|
|
private $doTriggerExceptionInProcess = false;
|
|
|
|
public function init(Tracker $tracker, TrackerRequestSet $TrackerRequestSet)
|
|
{
|
|
$this->isInit = true;
|
|
}
|
|
|
|
public function enableTriggerExceptionInProcess()
|
|
{
|
|
$this->doTriggerExceptionInProcess = true;
|
|
}
|
|
|
|
public function onStartTrackRequests(Tracker $tracker, TrackerRequestSet $TrackerRequestSet)
|
|
{
|
|
$this->isOnStartTrackRequests = true;
|
|
}
|
|
|
|
public function process(Tracker $tracker, TrackerRequestSet $TrackerRequestSet)
|
|
{
|
|
if ($this->doTriggerExceptionInProcess) {
|
|
throw new Exception('My Exception During Process');
|
|
}
|
|
|
|
$this->isProcessed = true;
|
|
}
|
|
|
|
public function onAllRequestsTracked(Tracker $tracker, TrackerRequestSet $TrackerRequestSet)
|
|
{
|
|
$this->isOnAllRequestsTracked = true;
|
|
}
|
|
|
|
public function onException(Tracker $tracker, TrackerRequestSet $TrackerRequestSet, Exception $e)
|
|
{
|
|
$this->isOnException = true;
|
|
$this->output = $e->getMessage();
|
|
}
|
|
|
|
public function finish(Tracker $tracker, TrackerRequestSet $TrackerRequestSet)
|
|
{
|
|
$this->isFinished = true;
|
|
|
|
return $this->output;
|
|
}
|
|
}
|