Пример #1
0
function system_track()
{
    $system = PLATFORM_SANDBOX_SYSTEM_CACHES_PATH . DS . 'system.db';
    $db = db_create_sqlite($system);
    $ip = $_SERVER["REMOTE_ADDR"];
    $ua = detect_user_agent();
    $dt = system_device_detection();
    $uri = $_SERVER["REQUEST_URI"];
    $input = $_POST['input'];
    if ($ip == PLATFORM_WHOIS) {
        $ip = $_SERVER["HTTP_X_REAL_IP"];
    }
    if (count($_GET) > 0) {
        $get = print_r($_GET, true);
    }
    if (count($_POST) > 0) {
        $post = print_r($_POST, true);
    }
    $sql = "CREATE TABLE IF NOT EXISTS visits_" . date("Y_m_d") . " AS SELECT * FROM visits WHERE 0";
    db_query_sqlite($sql, $db);
    $sql = "INSERT INTO visits_" . date("Y_m_d") . " \n                 ( url, get, post, input, ua, dt, ip ) \n          VALUES \n                 ('" . sqlite_escape_string($uri) . "', \n                  '" . sqlite_escape_string($get) . "', \n                  '" . sqlite_escape_string($post) . "', \n                  '" . sqlite_escape_string($input) . "',\n                  '" . sqlite_escape_string($ua) . "', \n                  '" . sqlite_escape_string($dt) . "', \n                  '" . sqlite_escape_string($ip) . "')";
    db_query_sqlite($sql, $db);
    unset($db);
}
function benchmark_device_detect()
{
    return system_device_detection();
}
Пример #3
0
<?php

/**
 * Tests system detect device
 * @version     $Id: detect.php 40 2011-02-09 14:10:00Z biyi $
 * @package     Platform
 * @category    Tests
 * @author      The Platform Authors
 * @link        mailto:platform@entilda.com
 * @copyright   Copyright (C) 2011 - 2012 The Platform Authors. All rights reserved.
 * @license     GNU Public Licence, see LICENSE.php
 * Platform is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */
platform_launch_initialize();
system_device_detection(true);