Download plugins/ArchivingMetrics/Writer/DbWriter.php from Leon4gr45/matomo: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/spaces/Leon4gr45/matomo/resolve/main/plugins/ArchivingMetrics/Writer/DbWriter.php
- Command line
-
hf download hf://spaces/Leon4gr45/matomo/plugins/ArchivingMetrics/Writer/DbWriter.php
-
curl -L -o DbWriter.php https://huggingface.co/spaces/Leon4gr45/matomo/resolve/main/plugins/ArchivingMetrics/Writer/DbWriter.php
1.27 kB
| /** | |
| * Matomo - free/libre analytics platform | |
| * | |
| * @link https://matomo.org | |
| * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | |
| */ | |
| declare(strict_types=1); | |
| namespace Piwik\Plugins\ArchivingMetrics\Writer; | |
| use Piwik\Common; | |
| use Piwik\Db; | |
| use Piwik\Plugins\ArchivingMetrics\Context; | |
| final class DbWriter implements WriterInterface | |
| { | |
| public function write(Context $context, array $timing): void | |
| { | |
| Db::query( | |
| 'INSERT INTO ' . Common::prefixTable('archiving_metrics') . ' (idarchive, idsite, archive_name, date1, date2, period, ts_started, ts_finished, total_time, total_time_exclusive, is_temporary) | |
| VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', | |
| [ | |
| $timing['idarchive'], | |
| $context->idSite, | |
| $timing['archive_name'], | |
| $context->period->getDateTimeStart()->toString('Y-m-d'), | |
| $context->period->getDateTimeEnd()->toString('Y-m-d'), | |
| $context->period->getId(), | |
| $timing['ts_started'], | |
| $timing['ts_finished'], | |
| $timing['total_time'], | |
| $timing['total_time_exclusive'], | |
| $timing['is_temporary'], | |
| ] | |
| ); | |
| } | |
| } | |