コード例 #1
0
 public static function getFullPath()
 {
     if (!self::Enabled()) {
         return false;
     }
     $logFileNameMask = ClickTale_Settings::Instance()->LogPathMask;
     return str_replace("{0}", date("Ymd"), $logFileNameMask);
 }
コード例 #2
0
 public static function Instance()
 {
     // If there is not already an instance of this class,
     //   instantiate one.
     if (self::$instanceSettings == null) {
         self::$instanceSettings = new ClickTale_Settings();
     }
     return self::$instanceSettings;
 }
コード例 #3
0
ファイル: api.inc.php プロジェクト: Telemedellin/tm
 function UsingLogging()
 {
     $config = ClickTale_Settings::Instance();
     return !empty($config->LogPathMask);
 }
コード例 #4
0
function ClickTale_DebugBuffers()
{
    // if we don't have the callback registered here, then we have a problem
    if (!in_array("ClickTale_callback", ob_list_handlers())) {
        ClickTale_Logger::Write("The output buffer callback does not exist in the buffers stack.");
    }
    if (!ClickTale_Settings::Instance()->AllowDebug) {
        return;
    }
    ClickTale_Logger::Write("Serialized Buffer Hanlders: " . join(", ", ob_list_handlers()));
    function clicktale_stringify_buffer_status($level, $stats)
    {
        $status = $stats['status'];
        switch ($stats['status']) {
            case 0:
                $status = "start";
                break;
            case 1:
                $status = "cont";
                break;
            case 2:
                $status = "end";
                break;
        }
        return "Buffer {$stats['name']} level: {$level} status: {$status} del: {$stats['del']} type: {$stats['type']}";
    }
    foreach (ob_get_status(true) as $level => $clicktale_buffer) {
        ClickTale_Logger::Write("Serialized Buffer Status: " . clicktale_stringify_buffer_status($level, $clicktale_buffer));
        if ($clicktale_buffer["name"] == "ob_gzhandler") {
            ClickTale_Logger::Write("Warning: You are using ob_gzhandler. ClickTale integration module will unzip and re-zip the page. This might slow down your site response.");
        }
    }
}
コード例 #5
0
foreach ($settingsInstance as $var => $value) {
    echo "<b>{$var}</b><br>{$value}<br>";
}
?>
<b>ClickTale_Logger::getFullPath()</b><br>
<?php 
echo ClickTale_Logger::getFullPath();
?>
<br>
<b>Latest log</b><br>
<div style="border: solid;"><?php 
echo nl2br(ClickTale_Logger::Read());
?>
</div>

<b>ClickTale_CheckCookieFlagForRecording()</b><br><?php 
echo ClickTale_CheckCookieFlagForRecording();
?>
<br>

<b>ClickTale_IsAllowedIp()</b><br><?php 
echo ClickTale_IsAllowedIp();
?>
<br>

<b>Default cache provider configuration</b><br>
<div style="border: solid;"><pre><?php 
print_r(ClickTale_Settings::Instance()->getCacheProviderConfig());
?>
</pre</div>
コード例 #6
0
 public static function &DefaultCacheProvider()
 {
     return ClickTale_CacheFactory::CacheProvider(ClickTale_Settings::Instance()->CacheProvider);
 }
コード例 #7
0
ファイル: cache_test_page.php プロジェクト: Telemedellin/tm
/**
 * ClickTale - PHP Integration Module
 *
 * LICENSE
 *
 * This source file is subject to the ClickTale(R) Integration Module License that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.clicktale.com/Integration/0.2/LICENSE.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@clicktale.com so we can send you a copy immediately.
 *
 */
require "../ClickTaleTop.php";
$config = ClickTale_Settings::Instance();
$config->UseStaticHash = true;
$config->StaticHash = "CacheTest";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>ClickTale integration :: Cache test</title>
	</head>
	<body>
		You should see this text in the right block<br />
		Some randomness: <?php 
echo rand(1, 5000);
?>
		<!-- No ClickTale -->
コード例 #8
0
ファイル: index.php プロジェクト: Telemedellin/tm
            $prefix = "USER ERROR";
            break;
        case E_USER_WARNING:
            $prefix = "USER WARNING";
            break;
        case E_USER_NOTICE:
            $prefix = "USER NOTICE";
            break;
        default:
            $prefix = "error({$errno})";
            break;
    }
    array_push($xmlErrors, "ERROR: {$errstr}");
}
set_error_handler("handle_xml_errors");
$scriptsFileValidate = ClickTale_ValidateScriptsXMLFile(ClickTale_Settings::Instance()->ScriptsFile);
if ($scriptsFileValidate !== true) {
    array_push($xmlErrors, $scriptsFileValidate);
}
restore_error_handler();
$validatorsValues['scriptsfile'] = array('validate' => true, 'isvalid' => empty($xmlErrors), 'title' => 'Scripts xml file', 'p_off' => "--", 'p_on_valid' => "The scripts file seems to be valid", 'p_on_invalid' => "The scripts file is invalid:<br />" . implode("<br />", $xmlErrors));
$someInvalid = false;
foreach ($validatorsValues as $ar) {
    $someInvalid = $someInvalid || $ar['validate'] && !$ar['isvalid'];
}
?>

		<div class="section">
      		<?php 
$phpversion = phpversion();
$validVersion = version_compare($phpversion, '5.2.1', ">=");
コード例 #9
0
ファイル: ClickTaleCache.php プロジェクト: Telemedellin/tm
                ClickTale_Logger::Write($message);
                header("HTTP/1.0 403 " . $message);
                header("X-ClickTale-Fetcher:no-store");
                die("Request from unauthorized source.");
            }
        }
    }
}
try {
    $cacheProvider = ClickTale_CacheFactory::DefaultCacheProvider();
} catch (Exception $ex) {
    ClickTale_Logger::Write($ex->getMessage());
    header("X-ClickTale-Fetcher:no-store");
    header("HTTP/1.0 500 " . $ex->getMessage());
    die($ex->getMessage());
}
$config = ClickTale_Settings::Instance()->getCacheProviderConfig();
if (!$cacheProvider->exists($token, $config)) {
    $message = "Request to '{$tok}' could not be retrieved";
    ClickTale_Logger::Write($message);
    header("X-ClickTale-Fetcher:no-store");
    header("HTTP/1.0 404 " . "Could not retrieve the cached page.");
    die("Could not retrieve the cached page.");
}
$settings = ClickTale_Settings::Instance();
if (!empty($settings->LogFetching)) {
    ClickTale_Logger::Write("Cache for '{$tok}' was retrieved");
}
$contents = $cacheProvider->Pull($token, $config);
$cacheProvider->refresh($token, $config);
print $contents;