Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-smush.../vendor/mixpanel/mixpanel.../examples
File: error_handling.php
<?php
[0] Fix | Delete
require_once("../lib/Mixpanel.php"); // import the Mixpanel class
[1] Fix | Delete
require_once("consumers/ObConsumer.php"); // import the Mixpanel class
[2] Fix | Delete
[3] Fix | Delete
// define a callback function to handle errors made in a consumer
[4] Fix | Delete
function handleError($code, $data) {
[5] Fix | Delete
echo "This is my customer error handler. I've received an error! code = " . $code . " : data = " . $data . "<br />";
[6] Fix | Delete
}
[7] Fix | Delete
[8] Fix | Delete
// instantiate Mixpanel with some different options including a custom consumer and a custom error callback
[9] Fix | Delete
$mp = new Mixpanel("MIXPANEL_PROJECT_TOKEN", array(
[10] Fix | Delete
"debug" => true,
[11] Fix | Delete
"max_batch_size" => 1,
[12] Fix | Delete
"consumers" => array("ob" => "ObConsumer"),
[13] Fix | Delete
"consumer" => "ob",
[14] Fix | Delete
"error_callback" => "handleError" // register the error callback
[15] Fix | Delete
));
[16] Fix | Delete
[17] Fix | Delete
$mp->track("test_event", array("color" => "blue"));
[18] Fix | Delete
$mp->track("test_event", array("color" => "red"));
[19] Fix | Delete
$mp->track("force_error"); // a magical event we've defined as an error in our custom "ObConsumer"
[20] Fix | Delete
[21] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function