Exemplo n.º 1
0
function page_end_time()
{
    global $ps_time, $db, $C;
    return 'Processed in ' . get_runtime('start', 'end') . ' second(s), ' . $db->querycount . ' queries, Gzip ' . $C['gz']['status'];
}
Exemplo n.º 2
0
Arquivo: index.php Projeto: RiceG/Dota
    $bio = $file_path . 'bio/';
    $json = $file_path . 'json/';
    $sb = $file_path . 'sb/';
    $lg = $file_path . 'lg/';
    $vert = $file_path . 'vert/';
    $icon = $file_path . 'icon/';
    //bio-img
    if ($img = file_get_contents($hero->bio_img)) {
        file_put_contents($bio . $hero_name . '_bio.jpg', $img);
    }
    //img-vert
    if ($img = file_get_contents($hero->img_vert)) {
        file_put_contents($vert . $hero_name . '_vert.jpg', $img);
    }
    //img-sb
    if ($img = file_get_contents($hero->img_sb)) {
        file_put_contents($sb . $hero_name . '_sb.png', $img);
    }
    //img-lg
    if ($img = file_get_contents($hero->img_lg)) {
        file_put_contents($lg . $hero_name . '_lg.png', $img);
    }
    //icon
    if ($img = file_get_contents($hero->icon)) {
        file_put_contents($icon . $hero_name . '.png', $img);
    }
    //json
    file_put_contents($json . $hero_name . '.json', $hero->to_json());
    echo 'get ' . $hero_name . '    state:OK!   runtime:' . get_runtime($stime) . '
';
}
Exemplo n.º 3
0
#
*/
function get_runtime($start, $end = '')
{
    static $_ps_time = array();
    if (!empty($end)) {
        if (!isset($_ps_time[$end])) {
            $mtime = explode(' ', microtime());
        }
        return number_format($mtime[1] + $mtime[0] - $_ps_time[$start], 6);
    } else {
        $mtime = explode(' ', microtime());
        $_ps_time[$start] = $mtime[1] + $mtime[0];
    }
}
get_runtime('start');
session_start();
$C = $L = $settings = $sysmsg = array();
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
    define('LF', "\r\n");
} else {
    define('LF', "\n");
}
define('NOW_YEAR', '2012');
define('PHPDISK_ROOT', substr(dirname(__FILE__), 0, -8));
define('PD_PLUGINS_DIR', PHPDISK_ROOT . 'plugins/');
define('IN_PHPDISK', TRUE);
define('SERVER_NAME', $_SERVER['SERVER_NAME']);
if (function_exists('date_default_timezone_set')) {
    @date_default_timezone_set('Asia/Shanghai');
}
Exemplo n.º 4
0
</div>
<div id="footer">
<p class="left">共执行 <?php 
echo get_sql_query_count();
?>
 次查询, 页面加载 <?php 
echo get_runtime();
?>
 秒。</p>
<p class="right">知行团队</p>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
</div>
<?php 
if (isset($GLOBALS['footer'])) {
    foreach ($GLOBALS['footer'] as $v) {
        echo $v, "\n";
    }
}
?>
</body>
</html>
<?php 
exit;