コード例 #1
0
 /**
  * Constructor.
  *
  * @param  array $parameters
  * @access public
  */
 function phpOpenTracker_LoggingEngine_Plugin($parameters)
 {
     $this->config =& phpOpenTracker_Config::singleton(true);
     $this->container =& phpOpenTracker_Container::singleton();
     $this->db =& phpOpenTracker_DB::singleton();
     $this->parameters = $parameters;
 }
コード例 #2
0
ファイル: Plugin.php プロジェクト: span20/Kallay
 /**
  * Constructor.
  *
  * @param  array $parameters
  * @access public
  */
 function phpOpenTracker_LoggingEngine_Plugin($parameters)
 {
     $this->config =& phpOpenTracker_Config::getConfig();
     $this->container =& phpOpenTracker_Container::getInstance();
     $this->db =& phpOpenTracker_DB::getInstance();
     $this->parameters = $parameters;
 }
コード例 #3
0
ファイル: LoggingEngine.php プロジェクト: span20/Kallay
 /**
  * Constructor.
  *
  * @param  array $parameters
  * @access public
  */
 function phpOpenTracker_LoggingEngine($parameters = array())
 {
     $parameters['init'] = true;
     $this->config =& phpOpenTracker_Config::getConfig();
     $this->container =& phpOpenTracker_Container::getInstance($parameters);
     $this->db =& phpOpenTracker_DB::getInstance();
     $this->_loadPlugins($parameters);
 }
コード例 #4
0
ファイル: DB.php プロジェクト: span20/Kallay
 /**
  * Returns an instance of phpOpenTracker_DB.
  *
  * @access public
  * @return phpOpenTracker_DB
  * @static
  */
 function &getInstance()
 {
     static $db;
     if (!isset($db)) {
         $config =& phpOpenTracker_Config::getConfig();
         $dbClass = 'phpOpenTracker_DB_' . $config['db_type'];
         if (!@(include POT_INCLUDE_PATH . 'DB/' . $config['db_type'] . '.php')) {
             phpOpenTracker::handleError(sprintf('Unknown database handler "%s".', $config['db_type']), E_USER_ERROR);
         }
         $db = new $dbClass();
     }
     return $db;
 }
コード例 #5
0
ファイル: API.php プロジェクト: span20/Kallay
 /**
  * Constructor.
  *
  * @access public
  */
 function phpOpenTracker_API()
 {
     $this->config =& phpOpenTracker_Config::getConfig();
     if ($this->config['query_cache']) {
         @(include_once 'Cache/Lite.php');
         if (class_exists('Cache_Lite')) {
             $this->cache = new Cache_Lite(array('cacheDir' => $this->config['query_cache_dir'], 'lifeTime' => $this->config['query_cache_lifetime']));
         } else {
             phpOpenTracker::handleError('Could not find PEAR Cache_Lite package, Query Cache disabled.');
         }
     }
     $this->_loadPlugins();
 }
コード例 #6
0
 /**
  * Handles an error according to the debug_level setting.
  *
  * @param           string  $errorMessage
  * @param  optional integer $errorType
  * @return boolean
  * @access public
  * @static
  */
 function handleError($errorMessage, $errorType = E_USER_WARNING)
 {
     $config =& phpOpenTracker_Config::singleton();
     $prefix = 'phpOpenTracker ' . ($errorType == E_USER_ERROR ? 'Error' : 'Warning') . ': ';
     if ($config['debug_level'] > 0) {
         echo $prefix . $errorMessage;
     }
     if ($config['log_errors']) {
         @error_log(sprintf("%s: %s\n", date('d-m-Y H:i:s', time()), $errorMessage), 3, dirname(__FILE__) . '/' . 'error.log');
     }
     if ($config['exit_on_fatal_errors'] && $errorType == E_USER_ERROR) {
         exit;
     }
     return false;
 }
コード例 #7
0
ファイル: exit.php プロジェクト: BackupTheBerlios/nxwcms-svn
<?php

//
// +---------------------------------------------------------------------+
// | phpOpenTracker - The Website Traffic and Visitor Analysis Solution  |
// +---------------------------------------------------------------------+
// | Copyright (c) 2000-2003 Sebastian Bergmann. All rights reserved.    |
// +---------------------------------------------------------------------+
// | This source file is subject to the phpOpenTracker Software License, |
// | Version 1.0, that is bundled with this package in the file LICENSE. |
// | If you did not receive a copy of this file, you may either read the |
// | license online at http://phpOpenTracker.de/license/1_0.txt, or send |
// | a note to license@phpOpenTracker.de, so we can mail you a copy.     |
// +---------------------------------------------------------------------+
//
// $Id: exit.php,v 1.5 2004/10/11 18:29:15 sven_weih Exp $
//
require_once "../../cms/config.inc.php";
require_once $c["path"] . $cds->path . "modules/stats/phpOpenTracker.php";
if (isset($_GET['url'])) {
    $exitURL = str_replace('&amp;', '&', base64_decode($_GET['url']));
    $config =& phpOpenTracker_Config::singleton(true);
    $db =& phpOpenTracker_DB::singleton();
    $container =& phpOpenTracker_Container::singleton(array('initNoSetup' => true));
    $db->query(sprintf("UPDATE %s\r\n          SET exit_target_id = '%d'\r\n        WHERE accesslog_id   = '%d'\r\n          AND document_id    = '%d'\r\n          AND timestamp      = '%d'", $config['accesslog_table'], $db->storeIntoDataTable($config['exit_targets_table'], $exitURL), $container['accesslog_id'], $container['document_id'], $container['timestamp']));
    header('Location: http://' . $exitURL);
}
コード例 #8
0
ファイル: index.php プロジェクト: BackupTheBerlios/nxwcms-svn
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Content-Type: text/html; charset=iso-8859-1');
// Handle HTTP GET parameters
$clientID = isset($_GET['client_id']) ? $_GET['client_id'] : 1;
$page = isset($_GET['page']) ? $_GET['page'] : 'access_statistics';
$day = isset($_GET['day']) ? $_GET['day'] : date('j');
$month = isset($_GET['month']) ? $_GET['month'] : date('n');
$year = isset($_GET['year']) ? $_GET['year'] : date('Y');
// Get references to phpOpenTracker's configuration
// and database objects
$config =& phpOpenTracker_Config::singleton();
$db =& phpOpenTracker_DB::singleton();
if (isset($_REQUEST['debug'])) {
    phpOpenTracker_Config::set('debug_level', 2);
}
$layout = new MyTemplate('templates/layout.htm');
$buffer = '';
$time = time();
switch ($page) {
    case 'total':
        $start = false;
        $end = false;
        break;
    case 'month':
        $start = mktime(0, 0, 0, $month, 1, $year);
        $end = mktime(23, 59, 59, $month, date('t', $start), $year);
        break;
    case 'day':
        $start = mktime(0, 0, 0, $month, $day, $year);
コード例 #9
0
ファイル: stat.php プロジェクト: span20/Kallay
    $query = "\n\t\tCREATE TABLE IF NOT EXISTS iShark_Stat_Hostnames (\n\t\t\tdata_id INT(11) NOT NULL,\n\t\t\tstring VARCHAR(255) NOT NULL,\n\t\tPRIMARY KEY (data_id)\n\t\t)\n\t";
    $mdb2->exec($query);
    $query = "\n\t\tCREATE TABLE IF NOT EXISTS iShark_Stat_Operating_Systems (\n\t\t\tdata_id INT(11) NOT NULL,\n\t\t\tstring VARCHAR(255) NOT NULL,\n\t\tPRIMARY KEY (data_id)\n\t\t)\n\t";
    $mdb2->exec($query);
    $query = "\n\t\tCREATE TABLE IF NOT EXISTS iShark_Stat_Referers (\n\t\t\tdata_id INT(11) NOT NULL,\n\t\t\tstring VARCHAR(255) NOT NULL,\n\t\tPRIMARY KEY (data_id)\n\t\t)\n\t";
    $mdb2->exec($query);
    $query = "\n\t\tCREATE TABLE IF NOT EXISTS iShark_Stat_User_Agents (\n\t\t\tdata_id INT(11) NOT NULL,\n\t\t\tstring  VARCHAR(255) NOT NULL,\n\t\tPRIMARY KEY (data_id)\n\t\t)\n\t";
    $mdb2->exec($query);
    $query = "\n\t\tCREATE TABLE IF NOT EXISTS iShark_Stat_Visitors (\n\t\t\taccesslog_id INT(11) NOT NULL,\n\t\t\tvisitor_id INT(11) NOT NULL,\n\t\t\tclient_id INT(10) UNSIGNED NOT NULL,\n\t\t\toperating_system_id INT(11) NOT NULL,\n\t\t\tuser_agent_id INT(11) NOT NULL,\n\t\t\thost_id INT(11) NOT NULL,\n\t\t\treferer_id INT(11) NOT NULL,\n\t\t\ttimestamp INT(10) UNSIGNED NOT NULL,\n\t\t\tweekday TINYINT(1) UNSIGNED NOT NULL,\n\t\t\t`hour` TINYINT(2) UNSIGNED NOT NULL,\n\t\t\treturning_visitor TINYINT(1) UNSIGNED NOT NULL,\n\t\tPRIMARY KEY (accesslog_id),\n\t\tKEY client_time (client_id, timestamp)\n\t\t)\n\t";
    $mdb2->exec($query);
    $query = "\n\t\tCREATE TABLE IF NOT EXISTS iShark_Stat_Search_Engines (\n\t\t\taccesslog_id INT(11) NOT NULL,\n\t\t\tsearch_engine VARCHAR(255) NOT NULL,\n\t\t\tkeywords VARCHAR(255) NOT NULL,\n\t\tPRIMARY KEY (accesslog_id)\n\t\t)\n\t";
    $mdb2->exec($query);
    $query = "\n\t\tCREATE TABLE IF NOT EXISTS iShark_Stat_Localizer (\n\t\t\taccesslog_id  INT(11)      NOT NULL,\n\t\t\tclient_id     INT(10)      NOT NULL,\n\t\t\tip            VARCHAR(15)  NOT NULL,\n\t\t\tcountry       VARCHAR(100) NOT NULL,\n\t\t\tiso2          VARCHAR(2)   NOT NULL,\n\t\t\tiso3          VARCHAR(3)   NOT NULL,\n\t\t\tfips104       VARCHAR(2)   NOT NULL,\n\t\t\tiso_number    DECIMAL(5,2) NOT NULL,\n\t\t\tflag          VARCHAR(6)   NOT NULL,\n\t\t\tregion        VARCHAR(30)  NOT NULL,\n\t\t\tcapital       VARCHAR(50)  NOT NULL,\n\t\t\tcurrency      VARCHAR(30)  NOT NULL,\n\t\t\tcurrency_code VARCHAR(3)   NOT NULL,\n\t\tPRIMARY KEY (accesslog_id),\n\t\tINDEX client_id (client_id, iso2, capital)\n\t\t)\n\t";
    $mdb2->exec($query);
}
// Month Names
$monthNames = array(1 => $locale->get('month_january'), $locale->get('month_february'), $locale->get('month_march'), $locale->get('month_april'), $locale->get('month_may'), $locale->get('month_june'), $locale->get('month_july'), $locale->get('month_august'), $locale->get('month_september'), $locale->get('month_october'), $locale->get('month_november'), $locale->get('month_december'));
// Load phpOpenTracker
require_once 'phpOpenTracker.php';
// Handle HTTP GET parameters
$clientID = isset($_GET['client_id']) ? $_GET['client_id'] : 1;
$day = isset($_GET['day']) ? $_GET['day'] : date('j');
$month = isset($_GET['month']) ? $_GET['month'] : date('n');
$year = isset($_GET['year']) ? $_GET['year'] : date('Y');
$time = time();
// Get references to phpOpenTracker's configuration
// and database objects
$config =& phpOpenTracker_Config::getConfig();
$db =& phpOpenTracker_DB::getInstance();
// megfelelo ful programjanak betoltese
include_once $module_name . "_{$page}.php";
コード例 #10
0
 /**
  * Returns a reference to phpOpenTracker's session container.
  *
  * The first call to this method during a request triggers, if
  * $parameters['init'] is not set to false, the generation of
  * the session container array.
  *
  * @param  optional array $parameters
  * @return array
  * @access public
  * @static
  */
 function &singleton($parameters = array())
 {
     static $isInitialized;
     $init = isset($parameters['init']) ? $parameters['init'] : false;
     $initAPI = isset($parameters['initAPI']) ? $parameters['initAPI'] : false;
     $initNoSetup = isset($parameters['initNoSetup']) ? $parameters['initNoSetup'] : false;
     $isInitialized = isset($isInitialized) ? $isInitialized : false;
     if ($initAPI) {
         $init = true;
         $isInitialized = false;
     } else {
         if ($initNoSetup) {
             $init = true;
         }
     }
     if ($isInitialized && !$init) {
         return $_SESSION['_phpOpenTracker_Container'];
     }
     if ($init && !$initAPI) {
         session_register('_phpOpenTracker_Container');
         $container =& $_SESSION['_phpOpenTracker_Container'];
     }
     if ($init && !$isInitialized && !$initNoSetup) {
         $config =& phpOpenTracker_Config::singleton(true);
         $db =& phpOpenTracker_DB::singleton();
         $parameters['client_id'] = isset($parameters['client_id']) ? $parameters['client_id'] : 1;
         $container['first_request'] = isset($container['first_request']) ? false : true;
         if ($container['first_request']) {
             $client_id_switched = false;
         } else {
             if ($container['client_id'] != $parameters['client_id']) {
                 $container['first_request'] = true;
                 $client_id_switched = true;
             }
         }
         $container['client_id'] = $parameters['client_id'];
         if ($container['first_request']) {
             if (function_exists('posix_getpid')) {
                 $container['accesslog_id'] = crc32(microtime() . posix_getpid());
             } else {
                 $container['accesslog_id'] = crc32(microtime() . session_id());
             }
             if (!$client_id_switched) {
                 if (!isset($parameters['host']) && !isset($parameters['ip_address'])) {
                     if (isset($_SERVER['REMOTE_ADDR'])) {
                         $container['ip_address'] = $_SERVER['REMOTE_ADDR'];
                         if (isset($_SERVER['REMOTE_HOST'])) {
                             $container['host_orig'] = $_SERVER['REMOTE_HOST'];
                         } else {
                             if ($config['resolve_hostname']) {
                                 $container['host_orig'] = gethostbyaddr($container['ip_address']);
                             } else {
                                 $container['host_orig'] = $container['ip_address'];
                             }
                         }
                     } else {
                         $container['host_orig'] = '';
                         $container['ip_address'] = '';
                     }
                 } else {
                     $container['host_orig'] = isset($parameters['host']) ? $parameters['host'] : '';
                     $container['ip_address'] = isset($parameters['ip_address']) ? $parameters['ip_address'] : '';
                 }
                 $container['host'] = $container['host_orig'];
                 if ($config['group_hostnames']) {
                     $container['host'] = phpOpenTracker_Parser::hostname($container['host']);
                 }
                 if (isset($parameters['user_agent'])) {
                     $container['user_agent_orig'] = $parameters['user_agent'];
                 } else {
                     $container['user_agent_orig'] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
                 }
                 if ($config['group_user_agents']) {
                     $container = array_merge($container, phpOpenTracker_Parser::userAgent($container['user_agent_orig']));
                 } else {
                     $container['operating_system'] = 'Not identified';
                     $container['user_agent'] = $container['user_agent_orig'];
                 }
                 $container['host_id'] = $db->storeIntoDataTable($config['hostnames_table'], $container['host']);
                 $container['operating_system_id'] = $db->storeIntoDataTable($config['operating_systems_table'], $container['operating_system']);
                 $container['user_agent_id'] = $db->storeIntoDataTable($config['user_agents_table'], $container['user_agent']);
             }
             if (isset($parameters['referer'])) {
                 $container['referer_orig'] = $parameters['referer'];
             } else {
                 $container['referer_orig'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
             }
             $container['referer_orig'] = urldecode($container['referer_orig']);
             if ($config['clean_referer_string']) {
                 $container['referer'] = preg_replace('/(\\?.*)/', '', $container['referer_orig']);
             } else {
                 $container['referer'] = $container['referer_orig'];
             }
             if (!empty($container['referer'])) {
                 $container['referer'] = str_replace('http://', '', $container['referer']);
             }
             $container['referer_id'] = $db->storeIntoDataTable($config['referers_table'], $container['referer']);
         } else {
             $container['last_document'] = $container['document'];
         }
         $container['document_url'] = isset($parameters['document_url']) ? $parameters['document_url'] : urldecode($_SERVER[$config['document_env_var']]);
         if ($config['clean_query_string']) {
             $container['document_url'] = preg_replace('/(\\?.*)/', '', $container['document_url']);
         } else {
             $filters = array_merge($config['get_parameter_filter'], array(session_name()));
             foreach ($filters as $filter) {
                 $container['document_url'] = preg_replace('#\\?' . $filter . '=.*$|&' . $filter . '=.*$|' . $filter . '=.*&#msiU', '', $container['document_url']);
             }
         }
         $container['document'] = isset($parameters['document']) ? $parameters['document'] : $container['document_url'];
         $container['document_id'] = $db->storeIntoDataTable($config['documents_table'], $container['document'], $container['document_url']);
         $container['timestamp'] = isset($parameters['timestamp']) ? $parameters['timestamp'] : time();
         $isInitialized = true;
     }
     return $container;
 }
コード例 #11
0
ファイル: Config.php プロジェクト: span20/Kallay
 /**
  * Sets the value of a configuration directive.
  *
  * @param  string $directive
  * @param  mixed  $value
  * @access public
  * @static
  * @since  phpOpenTracker 1.2.0
  */
 function set($directive, $value)
 {
     $config =& phpOpenTracker_Config::getConfig();
     $config[$directive] = $value;
 }
コード例 #12
0
 /**
  * Constructor.
  *
  * @access public
  */
 function phpOpenTracker_API_Plugin()
 {
     $this->config =& phpOpenTracker_Config::singleton();
     $this->container =& phpOpenTracker_Container::singleton();
     $this->db =& phpOpenTracker_DB::singleton();
 }
コード例 #13
0
 /**
  * Sets the value of a configuration directive.
  *
  * @param  string $directive
  * @param  mixed  $value
  * @access public
  * @static
  * @since  phpOpenTracker 1.2.0
  */
 function set($directive, $value)
 {
     $config =& phpOpenTracker_Config::singleton();
     $config[$directive] = $value;
 }
コード例 #14
0
ファイル: Plugin.php プロジェクト: span20/Kallay
 /**
  * Constructor.
  *
  * @access public
  */
 function phpOpenTracker_API_Plugin()
 {
     $this->config =& phpOpenTracker_Config::getConfig();
     $this->container =& phpOpenTracker_Container::getInstance();
     $this->db =& phpOpenTracker_DB::getInstance();
 }
コード例 #15
0
ファイル: phpOpenTracker.php プロジェクト: span20/Kallay
// Copyright 2000 - 2005 Sebastian Bergmann. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
include_once 'includes/config_mdb2.php';
$PHPOPENTRACKER_CONFIGURATION =& phpOpenTracker_Config::getConfig();
/**
* phpOpenTracker Configuration File
*
* This file contains global configuration settings for phpOpenTracker.
* Values may be safely edited by hand.
* Uncomment only values that you intend to change.
*
* Strings should be enclosed in 'quotes'.
* Integers should be given literally (without quotes).
* Boolean values may be true or false (never quotes).
*/
// Database
$PHPOPENTRACKER_CONFIGURATION['db_type'] = $dsn['phptype'];
// Available values: 'mssql', 'mysql', 'mysql_merge', 'oci8', 'pgsql'
$PHPOPENTRACKER_CONFIGURATION['db_host'] = $dsn['hostspec'];