Exemplo n.º 1
0
require_once ClickTale_Root . "/ClickTale.Settings.php";
require_once ClickTale_Root . "/ClickTale.inc.php";
require_once ClickTale_Root . "/ClickTale.Logger.php";
?>

<?php 
if (empty(ClickTale_Settings::Instance()->AllowDebug)) {
    die("Debug mode is disabled.");
}
?>

<h1> ClickTale Debug </h1><br>

<?php 
try {
    $data = ClickTale_LoadScripts(ClickTale_Settings::Instance()->ScriptsFile);
    // Data contains data from the scripts file.
    foreach ($data as $var => $value) {
        echo "<b>{$var}</b><br>" . htmlspecialchars($value) . "<br>";
    }
} catch (Exception $ex) {
    echo $ex->getMessage() . "<br>";
    ClickTale_Logger::Write($ex->getMessage());
}
$settingsInstance = ClickTale_Settings::Instance();
foreach ($settingsInstance as $var => $value) {
    echo "<b>{$var}</b><br>{$value}<br>";
}
?>
<b>ClickTale_Logger::getFullPath()</b><br>
<?php 
Exemplo n.º 2
0
function ClickTale_ProcessOutput_inject($buffer)
{
    if (ClickTale_CheckCookieFlagForRecording()) {
        return $buffer;
    }
    try {
        // Data contains data from the scripts file.
        $data = ClickTale_LoadScripts(ClickTale_Settings::Instance()->ScriptsFile);
        // Filtering rules from XML file
        $rules = ClickTale_LoadRules(ClickTale_Settings::Instance()->FilterRulesFile);
    } catch (Exception $ex) {
        ClickTale_Logger::Write($ex->getMessage());
        return $buffer;
    }
    $settings = ClickTale_Settings::Instance();
    // Cache
    try {
        ClickTale_Logger::WriteDebug("Starting Caching: DisableCache (bool={$settings->DisableCache})");
        if (empty($settings->DisableCache)) {
            $hash = $settings->UseStaticHash ? $settings->StaticHash : ClickTale_RandHash(20);
            $cacheProvider = ClickTale_CacheFactory::DefaultCacheProvider();
            $config = ClickTale_Settings::Instance()->getCacheProviderConfig();
            $hashlen = strlen($hash);
            if ($hashlen <= 4) {
                $tok = "hash";
            } else {
                $tok = substr($hash, $hashlen - 4);
            }
            if (!empty($settings->LogCaching)) {
                ClickTale_Logger::Write("BeginCache '{$tok}' for " . $_SERVER["REQUEST_URI"]);
            }
            $savedbuffer = $buffer;
            // Filter rules applied before cache pages
            foreach ($rules as $rule) {
                $regnorm = $rule["Pattern"];
                $regrep = $rule["ReplaceWith"];
                $savedbuffer = preg_replace($regnorm, $regrep, $savedbuffer, 1);
            }
            $cacheProvider->store($hash, $savedbuffer, $config);
            if (!empty($settings->LogCaching)) {
                ClickTale_Logger::Write("EndCache '{$tok}' for " . $_SERVER["REQUEST_URI"]);
            }
        }
    } catch (Exception $ex) {
        ClickTale_Logger::Write($ex->getMessage());
        return $buffer;
    }
    // Filter
    ClickTale_Logger::WriteDebug("Filtering: disabled (bool={$settings->DisableFilter})");
    if (empty($settings->DisableFilter)) {
        $buffer = ClickTale_Filter($buffer, $data, $hash);
    }
    return $buffer;
}
Exemplo n.º 3
0
function ClickTale_ProcessOutput_inject($buffer)
{
    if (ClickTale_CheckCookieFlagForRecording()) {
        return $buffer;
    }
    try {
        // Data contains data from the scripts file.
        $data = ClickTale_LoadScripts(ClickTale_Settings::Instance()->ScriptsFile);
    } catch (Exception $ex) {
        ClickTale_Logger::Write($ex->getMessage());
        return $buffer;
    }
    $settings = ClickTale_Settings::Instance();
    // Cache
    try {
        if (empty($settings->DisableCache)) {
            $hash = $settings->UseStaticHash ? $settings->StaticHash : ClickTale_RandHash(20);
            $cacheProvider = ClickTale_CacheFactory::DefaultCacheProvider();
            $config = ClickTale_Settings::Instance()->getCacheProviderConfig();
            $hashlen = strlen($hash);
            if ($hashlen <= 4) {
                $tok = "hash";
            } else {
                $tok = substr($hash, $hashlen - 4);
            }
            if (!empty($settings->LogCaching)) {
                ClickTale_Logger::Write("BeginCache '{$tok}' for " . $_SERVER["REQUEST_URI"]);
            }
            $cacheProvider->store($hash, $buffer, $config);
            if (!empty($settings->LogCaching)) {
                ClickTale_Logger::Write("EndCache '{$tok}' for " . $_SERVER["REQUEST_URI"]);
            }
        }
    } catch (Exception $ex) {
        ClickTale_Logger::Write($ex->getMessage());
        return $buffer;
    }
    // Filter
    if (empty(ClickTale_Settings::Instance()->DisableFilter)) {
        $buffer = ClickTale_Filter($buffer, $data, $hash);
    }
    return $buffer;
}