Server IP : 104.21.14.48 / Your IP : 3.145.44.179 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/plugins/defender-security/extra/wpmudev-analytics/vendor_prefixed/ConsumerStrategies/ |
Upload File : |
<?php namespace WPMUDEV_Analytics_Vendor; require_once \dirname(__FILE__) . "/../Base/MixpanelBase.php"; /** * Provides some base methods for use by a Consumer implementation */ abstract class ConsumerStrategies_AbstractConsumer extends Base_MixpanelBase { /** * Creates a new AbstractConsumer * @param array $options */ function __construct($options = array()) { parent::__construct($options); if ($this->_debug()) { $this->_log("Instantiated new Consumer"); } } /** * Encode an array to be persisted * @param array $params * @return string */ protected function _encode($params) { return \base64_encode(\json_encode($params)); } /** * Handles errors that occur in a consumer * @param $code * @param $msg */ protected function _handleError($code, $msg) { if (isset($this->_options['error_callback'])) { $handler = $this->_options['error_callback']; \call_user_func($handler, $code, $msg); } if ($this->_debug()) { $arr = \debug_backtrace(); $class = \get_class($arr[0]['object']); $line = $arr[0]['line']; \error_log("[ {$class} - line {$line} ] : " . \print_r($msg, \true)); } } /** * Number of requests/batches that will be processed in parallel. * @return int */ public function getNumThreads() { return 1; } /** * Persist a batch of messages in whatever way the implementer sees fit * @param array $batch an array of messages to consume * @return boolean success or fail */ abstract function persist($batch); }