本文整理汇总了PHP中print_time函数的典型用法代码示例。如果您正苦于以下问题:PHP print_time函数的具体用法?PHP print_time怎么用?PHP print_time使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_time函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_index
function print_index()
{
global $gbl, $sgbl, $ghtml, $login;
ob_start();
print_time('index');
$cgi_clientname = $ghtml->frm_clientname;
Htmllib::checkForScript($cgi_clientname);
$cgi_class = $ghtml->frm_class;
if (!$cgi_class) {
$cgi_class = getClassFromName($cgi_clientname);
}
$cgi_password = $ghtml->frm_password;
$cgi_forgotpwd = $ghtml->frm_forgotpwd;
$cgi_email = $ghtml->frm_email;
$cgi_key = $ghtml->frm_login_key;
if (!$cgi_password || !$cgi_clientname) {
$ghtml->print_redirect("/login/?frm_emessage=login_error");
}
$cgi_classname = 'client';
if ($cgi_class) {
$cgi_classname = $cgi_class;
}
if ($cgi_clientname == "" || $cgi_password == "" && $cgi_key == "") {
$cgi_forgotpwd = $ghtml->frm_forgotpwd;
return;
}
$ip = $_SERVER['REMOTE_ADDR'];
if (!check_login_success($cgi_classname, $cgi_clientname, $cgi_password, $cgi_key)) {
return;
}
log_log("login_success", "Successful Login to {$cgi_clientname} from " . $_SERVER['REMOTE_ADDR']);
/*
try {
$att = $gbl->g->getFromList("loginattempt", $ip);
$att->delete();
} catch (Exception $e) {
}
*/
if (check_disable_admin($cgi_clientname)) {
$ghtml->print_redirect("/login/?frm_emessage=login_error");
exit;
}
if (get_login($cgi_classname, $cgi_clientname)) {
do_login($cgi_classname, $cgi_clientname);
$login->was();
check_blocked_ip();
$ghtml->print_redirect("/");
} else {
$ghtml->cgiset("frm_emessage", "login_error");
}
$cgi_forgotpwd = $ghtml->frm_forgotpwd;
}
示例2: collectquota_main
function collectquota_main()
{
global $gbl, $sgbl, $login, $ghtml;
//ob_end_flush();
try {
print_time('collect');
$login->collectQuota();
$login->metadbaction = 'writeonly';
$login->was();
print_time('collect', 'Time Taken To Collect Quota');
} catch (Exception $e) {
print "Caught Execption\n";
print $e->getMessage();
print "\n";
print "\n";
print "\n";
}
}
示例3: checkPort
function checkPort()
{
global $gbl, $sgbl, $login, $ghtml;
$num = $this->portnumber;
$sname = $this->getParentO()->servername;
dprint("Checking Port {$sname}: {$num}\n");
print_time("checkprot");
$sip = gethostbyname($sname);
if (validate_ipaddress($sip)) {
$res = fsockopen($sip, $num, $erno, $erstr, 10);
} else {
$res = null;
$erno = 1;
$erstr = "Dns failed";
}
print_time("checkprot", "Fsockopen");
$name = $sgbl->thisserver . "___" . $this->nname;
$obj = new PortStatus(null, "localhost", $name);
$obj->initThisDef();
if (!$res) {
$obj->portstatus = 'off';
$obj->errornumber = $erno;
$obj->errorstring = $erstr;
} else {
fclose($res);
$obj->portstatus = 'on';
}
$obj->portnname = $this->nname;
$obj->servername = $sgbl->thisserver;
$obj->updatetime = time();
$obj->setUpdateSubaction();
return $obj;
}
示例4: updateform
function updateform($subaction, $param)
{
global $gbl, $sgbl, $login, $ghtml;
$progname = $sgbl->__var_program_name;
$parent = $this->getParentO();
$tree = createTreeObject('name', null, null, null, null, null, null);
$gbl->__var_restore_tree = $tree;
if ($this->rm_username) {
$this->rm_username = fix_meta_character($this->rm_username);
}
switch ($subaction) {
case "backup":
if (trim($this->ftp_server)) {
$vlist['ftp_server'] = array('M', null);
$vlist['rm_username'] = array('M', null);
$vlist['rm_password'] = array('M', '***');
$vlist['upload_to_ftp'] = array('M', null);
} else {
$vlist['upload_to_ftp'] = array('M', "Ftp Server Not Set");
}
if (!$this->getParentO()->checkIfLockedForAction('backup')) {
if ($this->backupstage === 'doing') {
$this->backupstage = 'program_interrupted';
}
}
$this->backupstage = fix_nname_to_be_variable($this->backupstage);
$vlist['backupstage'] = array('M', null);
$vlist['backup_to_file_f'] = null;
$parent->backupExtraVar($vlist);
$vlist['__v_button'] = 'Backup Now';
return $vlist;
case "restore_confirm":
$gbl->__var_tmp_disabled_flag = false;
if ($param) {
$this->backupcheckForConsistency($tree, $param);
}
$vlist['__v_childheir'] = '__var_backup';
$vlist['__v_showcheckboxflag'] = true;
if ($sgbl->isDebug()) {
$vlist['__v_resourcefunc'] = "getBackupChildList";
} else {
$vlist['__v_resourcefunc'] = "getDisplayBackupChildList";
}
$vlist['__v_param'] = $param;
$vlist['__v_button'] = 'Restore Now';
print_time("restore_process", "Restore Processing Took");
return $vlist;
case "restore_confirm_confirm":
$gbl->__var_tmp_disabled_flag = true;
print_time("restore_process");
if ($param) {
$this->backupcheckForConsistency($tree, $param);
}
$vlist['__v_childheir'] = '__var_backup';
if ($sgbl->isDebug()) {
$vlist['__v_resourcefunc'] = "getBackupChildList";
} else {
$vlist['__v_resourcefunc'] = "getDisplayBackupChildList";
}
$vlist['__v_showcheckboxflag'] = true;
$vlist['__v_param'] = $param;
$vlist['__v_button'] = 'Restore Now';
print_time("restore_process", "Restore Processing Took");
return $vlist;
case "schedule_conf":
if ($parent->isSimpleBackup()) {
$sched = array('disabled', 'weekly', 'monthly');
} else {
$sched = array('disabled', 'daily', 'weekly', 'monthly');
}
if (!$this->backupschedule_type) {
$this->backupschedule_type = 'disabled';
}
if ($this->priv->isOn('backupschedule_flag')) {
$vlist['backupschedule_type'] = array('s', $sched);
} else {
$vlist['backupschedule_type'] = array('M', 'Disabled');
}
$vlist['rm_last_number'] = null;
$vlist['__v_updateall_button'] = array();
break;
case "ftp_conf":
$vlist['ftp_server'] = null;
$vlist['rm_username'] = null;
$vlist['rm_password'] = array('m', get_star_password());
$vlist['rm_directory'] = null;
$vlist['upload_to_ftp'] = null;
$vlist['upload_type'] = array('M', 'ftp');
$vlist['no_local_copy_flag'] = null;
$vlist['dont_verify_ftp_f'] = null;
$vlist['__v_updateall_button'] = array();
break;
case "restore_from_ftp":
if (!$this->ftp_server) {
$vlist['ftp_server'] = array("M", "Ftp Server is Not Set");
break;
}
$vlist['ftp_server'] = array('M', null);
$vlist['rm_username'] = array('M', null);
$vlist['rm_password'] = array('M', "****");
//.........这里部分代码省略.........
示例5: function
$result = Co::wait([curl('/rest', ['id' => 1, 'sleep' => 7]), function () {
// Wait 4 sec
print_r((yield [curl('/rest', ['id' => 2, 'sleep' => 3]), curl('/rest', ['id' => 3, 'sleep' => 4])]));
print_time();
// Wait 2 sec
print_r((yield [function () {
// Wait 1 sec
echo (yield curl('/rest', ['id' => 4, 'sleep' => 1])), "\n";
print_time();
return curl('/rest', ['id' => 5, 'sleep' => 1]);
}, function () {
// Wait 0 sec
echo unwrap((yield CO::SAFE => curl('/invalid'))), "\n";
print_time();
try {
// Wait 0 sec
(yield curl('/invalid'));
} catch (CURLException $e) {
echo unwrap($e), "\n";
print_time();
}
return ['x' => ['y' => function () {
return (yield curl('/rest', ['id' => 6, 'sleep' => 2]));
}]];
}]));
print_time();
return curl('/rest', ['id' => 7, 'sleep' => 1]);
}]);
print_r($result);
print_time();
示例6: printSelectObjectTable
function printSelectObjectTable($name_list, $parent, $class, $blist = array(), $display = null)
{
global $gbl, $sgbl, $login, $ghtml;
print_time("{$class}.objecttable");
if ($this->frm_accountselect !== null) {
$sellist = explode(',', $this->frm_accountselect);
} else {
$sellist = null;
}
$classdesc = $this->get_class_description($class, $display);
$unique_name = trim($parent->nname) . trim($class) . trim($display) . trim($classdesc[2]);
$unique_name = fix_nname_to_be_variable($unique_name);
$filtername = $parent->getFilterVariableForThis($class);
$fil = $this->frm_hpfilter;
$sortdir = null;
$sortby = null;
if (isset($fil[$filtername]['sortby'])) {
$sortby = $fil[$filtername]['sortby'];
}
if (isset($fil[$filtername]['sortdir'])) {
$sortdir = $fil[$filtername]['sortdir'];
}
$pagesize = '99999';
$iconpath = get_image_path() . "/button";
$nlcount = count($name_list) + 1;
$imgheadleft = $login->getSkinDir() . "/top_lt.gif";
$imgheadleft2 = $login->getSkinDir() . "/top_lt.gif";
$imgheadright = $login->getSkinDir() . "/top_rt.gif";
$imgheadbg = $login->getSkinDir() . "/top_bg.gif";
$imgbtnbg = $login->getSkinDir() . "/btn_bg.gif";
$imgtablerowhead = $login->getSkinDir() . "/tablerow_head.gif";
$imgtablerowheadselect = $login->getSkinDir() . "/top_line_medium.gif";
$imgbtncrv = $login->getSkinDir() . "/btn_crv.gif";
$imgtopline = $login->getSkinDir() . "/top_line.gif";
$classdesc = $this->get_class_description($class);
$unique_name = trim($parent->nname) . trim($class) . trim($classdesc[2]);
$unique_name = fix_nname_to_be_variable($unique_name);
//dprint("-- ".$unique_name. " --", 2);
?>
<br />
<script> var ckcount<?php
echo $unique_name;
?>
; </script>
<?php
$tsortby = $sortby;
if (!$sortby) {
$tsortby = exec_class_method($class, "defaultSort");
}
if (!$sortdir) {
$sortdir = exec_class_method($class, "defaultSortDir");
}
//print_time("objecttable");
$obj_list = $parent->getVirtualList($class, $total_num, $tsortby, $sortdir);
//print_time("objecttable", 'objecttable');
if (!$sellist) {
//$total_num = $this->display_count($obj_list, $display) ;
}
?>
<table width=100%> <tr> <td align=center>
<table cellspacing=2 cellpadding=2 width=97% align=center>
<tr><td class=rowpoint></td><td colspan= <?php
echo $nlcount;
?>
>
<table cellpadding=0 cellspacing=0 border=0 width=100%>
<tr><td valign=bottom ></td>
<td>
<?php
if (isset($ghtml->__http_vars['frm_hpfilter'][$filtername]['pagenum'])) {
$cgi_pagenum = $ghtml->__http_vars['frm_hpfilter'][$filtername]['pagenum'];
} else {
$cgi_pagenum = 1;
}
if (!$sellist) {
$this->print_next_previous($parent, $class, "top", $cgi_pagenum, $total_num, $pagesize);
}
?>
</td>
<td align=right valign=bottom >
<?php
if (!$sellist) {
?>
<table cellpadding="0" cellspacing="0" border="0" height="27" >
<tr><td><img src="<?php
echo $imgheadleft;
?>
"></td><td nowrap valign=middle background="<?php
echo $imgheadbg;
?>
"><b><font color="#ffffff"><?php
echo get_plural($classdesc[2]);
?>
under <?php
echo $parent->display("nname");
?>
</b> <?php
//.........这里部分代码省略.........
示例7: round
return;
}
$diff = round($now - $last[$var], 7);
$now = round($now, 7);
$last[$var] = $now;
if (!$mess) {
return;
}
$diff = round($diff, 2);
if ($dbg <= -1) {
} else {
dprint("{$mess}: {$diff} <br> \n", $dbg);
}
return "{$mess}: {$diff} seconds";
}
print_time('full');
function windowsOs()
{
if (getOs() == "Windows") {
return true;
}
return false;
}
function getOs()
{
return substr(php_uname(), 0, 7) == "Windows" ? "Windows" : "Linux";
}
if (!isset($_SERVER['DOCUMENT_ROOT'])) {
if (isset($_SERVER['SCRIPT_NAME'])) {
$n = $_SERVER['SCRIPT_NAME'];
$f = ereg_replace('\\\\', '/', $_SERVER['SCRIPT_FILENAME']);
示例8: COUNT
if (check_port_status($result['address'], $result['port'], 2) == TRUE) {
// res image is the up arrow pretty much
$res_img = 'Online';
// Get the server population
$population = $CDB_EXTRA->count("SELECT COUNT(*) FROM `characters` WHERE online=1");
// Get the server uptime
$start_time = $DB->selectCell("SELECT `starttime` FROM `uptime` WHERE `realmid`='" . $realm_num . "' ORDER BY `starttime` DESC LIMIT 1");
$uptime = time() - $start_time;
} else {
// Get the result image arrow
$res_img = 'Offline';
$population = 0;
$uptime = 0;
}
// Convert uptime into a days / hours / minutes format
if ($uptime != 0) {
$uptime = print_time(parse_time($uptime));
} else {
$uptime = "N/A";
}
// Setup this realm in the array
$Realm[$i]['res_color'] = $res_color;
$Realm[$i]['status'] = $res_img;
$Realm[$i]['name'] = $result['name'];
$Realm[$i]['type'] = $realm_type;
$Realm[$i]['population'] = $population;
$Realm[$i]['uptime'] = $uptime;
// Unset the realms DB Connections
unset($WDB_EXTRA);
unset($CDB_EXTRA);
}
示例9: remote_main
function remote_main()
{
global $gbl, $sgbl, $login, $ghtml, $g_dbf;
global $argv;
ob_start();
$args = parse_opt($argv);
$gbl->is_master = false;
$gbl->is_slave = false;
if (isset($args['install-type']) && $args['install-type'] === 'master') {
$login = new Client(null, null, 'master');
$gbl->is_master = true;
$login->get();
} else {
$login = new Client(null, null, 'slave');
//$login->initThisDef();
$gbl->is_slave = true;
$rmt = unserialize(lfile_get_contents("__path_slave_db"));
$login->password = $rmt->password;
}
$login->cttype = 'admin';
// This is to prevent the socket already used error. If use a strict single interface, the socket operations happen through our own functions, and we can set the reuse option.
$rmt = unserialize(base64_decode($ghtml->frm_rmt));
$res = do_remote($rmt);
print_time('full', 'timing');
$res->message = ob_get_contents();
$val = base64_encode(serialize($res));
while (@ob_end_clean()) {
}
print $val;
exit;
}
示例10: GetFromAnyExternal
$toFill[] = $key;
}
}
$rez = GetFromAnyExternal($toFill, $users);
foreach ($toFill as $key) {
//$slot->addTag(Cacher_Tag::create('SmplTag', $User)); // Создаем и сразуже добавляем новый тег к слоту перед сохрананеием в кеш
//$slot->addTag(Cacher_Tag::create('SmplTag1', $User)); // Создаем и сразуже добавляем новый тег к слоту перед сохрананеием в кеш
//echo "<hr>setTag: ", Cacher_Tag::create('SmplTag', $key)->getKey();
//$slots[$key]->addTag( Cacher_Tag::create('SmplTag', $key) );
//sleep(1);// hard data
$val = $rez[$key];
echo "<br><font color=blue>to cache({$key})</font><br>";
$slots[$key]->set($val);
$CacheData[$key] = $val;
}
//Cacher_Tag::create('SmplTag', 50)->clear();
//$slots[10]->del();
echo "<hr><pre>";
var_export($slots);
echo '</pre><hr>';
//$slot->del();
//Cacher_Tag::create('SmplTag',$User)->clear();
//Cacher::newTag('SmplTag1',$User)->clear();
//Cacher::newTag('AniTagData2',AniTagDataObj1)->clear() // Очищаем кеш тега
//echo '<hr>Cached data:<pre>';var_export($CacheData);echo '</pre><hr>';
################################################################################
echo '<br>';
echo '<hr>memory usage: ' . (memory_get_usage() / 1024 - $memory_get_usage_start) . 'Kb<br>';
echo '<hr>memory peak_usage: ' . (memory_get_peak_usage() / 1024 - $memory_get_usage_start) . 'Kb<br>';
print_time('end script work');
示例11: send_to_some_http_server
function send_to_some_http_server($raddress, $socket_type, $port, $var)
{
global $gbl, $sgbl, $login, $ghtml;
print_time('server');
$ch = curl_init("http://{$raddress}:{$port}/lbin/remote.php");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, "frm_rmt={$var}&");
$totalout = curl_exec($ch);
dprint(curl_error($ch));
$totalout = trim($totalout);
return $totalout;
}
示例12: do_updateform
function do_updateform($object, $subaction)
{
global $gbl, $sgbl, $login, $ghtml;
$class = lget_class($object);
$parent = $object->getParentO();
$qparent = $parent;
$_tsubaction = null;
if ($subaction) {
$_tsubaction = "_" . $subaction;
}
$udesc = get_classvar_description($class, "__acdesc_update" . $_tsubaction);
$title = null;
if ($udesc) {
$title = $udesc[2];
}
$gbl->setSessionV("lx_update_return_url", "/display.php?" . $ghtml->get_get_from_current_post(null));
$param = $ghtml->createCurrentParam($class);
if ($ghtml->frm_accountselect) {
$list = explode(",", $ghtml->frm_accountselect);
$param['_accountselect'] = $list;
}
$vlist = $object->updateform($subaction, $param);
$tparam = null;
if (isset($vlist['__v_param'])) {
$tparam = $vlist['__v_param'];
}
if (isset($vlist['__v_childheir'])) {
if ($vlist['__v_childheir']) {
$var = $vlist['__v_childheir'];
$o = $object->{$var};
} else {
$o = $object;
}
/// Hack mega hack.. Adding tparam to the http_vars variable so that do_resource will get them.
if ($tparam) {
foreach ($tparam as $k => $v) {
$param["frm_" . $class . "_c_" . $k] = $v;
$ghtml->__http_vars["frm_{$class}_c_{$k}"] = $v;
}
}
$ghtml->do_resource($gbl->__var_restore_tree, $o, 0, false, $vlist['__v_resourcefunc'], true, false);
if ($vlist['__v_showcheckboxflag']) {
print_time('full', "Page Generation Took");
return;
}
}
// Hack Hack Hack... Cannot handle file permissions neatly now... Just calling the whole thing..
if (isset($vlist['file_permission_f'])) {
$ghtml->print_file_permissions($object);
return;
}
$string[] = $ghtml->object_variable_startblock($object, null, $title);
$string[] = $ghtml->object_inherit_classpath();
$ret['variable'] = $vlist;
if (isset($vlist['__v_next'])) {
$ret['action'] = 'updateform';
$ret['subaction'] = $vlist['__v_next'];
} else {
$ret['action'] = "update";
$ret['subaction'] = $subaction;
}
$param = null;
if ($tparam) {
foreach ($tparam as $k => $v) {
$param["frm_{$class}_c_{$k}"] = $v;
}
$string[] = $ghtml->object_variable_hiddenlist($param);
}
$string[] = create_xml($qparent, $object, $ret);
$pre = $post = null;
if (isset($vlist['__m_message_pre'])) {
$pre = $vlist['__m_message_pre'];
}
if (isset($vlist['__m_message_post'])) {
$post = $vlist['__m_message_post'];
}
$ghtml->print_information('pre', 'updateform', $class, $subaction, $pre);
$ghtml->xml_print_page($string);
$ghtml->print_information('post', 'updateform', $class, $subaction, $post);
}
示例13: print_time2
function print_time2($date_string, $date_format, $date_format_2)
{
global $user;
$data = '';
$date_string = trim($date_string);
if (preg_match("/UT\$/", $date_string)) {
$date_string .= 'C';
}
if (!$date_format) {
$data .= '<span title="' . $user->htmlsafe(date('r', strtotime($date_string))) . '">';
$data .= print_time(strtotime($user->htmlsafe($date_string)), $date_string) . '</span>';
} else {
$data .= '<span title="' . print_time(strtotime($user->htmlsafe($date_string)), $date_string) . '">';
$data .= $user->htmlsafe(date($date_format, strtotime($date_string)));
if ($date_format_2) {
$data .= ' ' . $user->htmlsafe(date($date_format_2, strtotime($date_string)));
}
$data .= '</span>';
}
return $data;
}
示例14: sleep
<?php
$v = 0;
include_once 'htmllib/coredisplaylib.php';
sleep($v);
//setcookie("XDEBUG_SESSION", "sess", time () + 36000);
//setcookie("XDEBUG_SESSION", "sess");
print_time("start");
display_init();
print_time("start", "Start");
//dprint($gbl->__c_object->username);
//$list = $gbl->__c_object->getList('domaintemplate');
//$gbl->__c_object->__parent_o = null;
//dprintr($gbl->__c_object->ls);
//dprintr($gbl->__c_object->priv);
display_exec();
echo '<br />';
示例15: SMR_PLANET
$planet = new SMR_PLANET($db->f("sector_id"), SmrSession::$game_id);
$planet_sector = new SMR_SECTOR($db->f("sector_id"), SmrSession::$game_id, SmrSession::$old_account_id);
$planet_owner = new SMR_PLAYER($planet->owner_id, SmrSession::$game_id);
$planet->build();
print "<tr>";
print "<td>{$planet->planet_name}</td>";
print "<td>{$planet_owner->player_name}</td>";
print "<td align=\"center\">{$planet->sector_id}</td>";
print "<td align=\"center\">{$planet_sector->galaxy_name}</td>";
print "<td align=\"center\">" . $planet->construction[1] . "</td>";
print "<td align=\"center\">" . $planet->construction[2] . "</td>";
print "<td align=\"center\">" . $planet->construction[3] . "</td>";
print "<td align=\"center\">";
if ($planet->build()) {
print "{$planet->current_building_name}<br>";
print print_time($planet->time_left);
} else {
print "Nothing";
}
print "</td>";
print "<td align=\"center\">{$planet->shields}</td>";
print "<td align=\"center\">{$planet->drones}</td>";
print "<td align=\"left\">";
$supply = false;
foreach ($planet->stockpile as $id => $amount) {
if ($amount > 0) {
$db2->query("SELECT * FROM good WHERE good_id = {$id}");
if ($db2->next_record()) {
print $db2->f("good_name") . ": {$amount}<br>";
}
$supply = true;