本文整理汇总了PHP中Sqlite::getRowswhere方法的典型用法代码示例。如果您正苦于以下问题:PHP Sqlite::getRowswhere方法的具体用法?PHP Sqlite::getRowswhere怎么用?PHP Sqlite::getRowswhere使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sqlite
的用法示例。
在下文中一共展示了Sqlite::getRowswhere方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trafficperslave
function trafficperslave($slave, $oldtime, $newtime)
{
global $gbl, $sgbl, $login, $ghtml;
$sq = new Sqlite(null, 'vps');
$res = $sq->getRowswhere("syncserver = '{$slave}'", array('nname'));
if (!$res) {
return;
}
foreach ($res as $r) {
$vps = new Vps(null, null, $r['nname']);
$vps->get();
$vpslist[] = $vps;
}
$list = null;
foreach ($vpslist as $d) {
$rt = new Remote();
if ($d->isXen()) {
$rt->viflist = $d->getViflist();
} else {
$rt->vpsid = $d->vpsid;
}
$rt->nname = $d->nname;
$list[$d->nname] = $rt;
}
$driverapp = $gbl->getSyncClass(null, $slave, 'vps');
try {
$vps_usage = rl_exec_get(null, $slave, array("vpstraffic__{$driverapp}", 'findTotaltrafficUsage'), array($list, $oldtime, $newtime));
} catch (exception $e) {
exit;
}
dprintr($vps_usage);
$res = "";
foreach ($vpslist as $d) {
$res['nname'] = "{$d->nname}:{$oldtime}:{$newtime}";
$domt = new Vpstraffic(null, null, $res['nname']);
$res['timestamp'] = @strftime("%c", $newtime);
$res['oldtimestamp'] = @strftime("%c", $oldtime);
$res['ddate'] = time();
$res['comment'] = null;
$res['parent_list'] = null;
$res['parent_clname'] = $d->getClName();
$res['traffic_usage'] = $vps_usage[$d->nname]['total'];
$res['incoming_usage'] = $vps_usage[$d->nname]['incoming'];
$res['outgoing_usage'] = $vps_usage[$d->nname]['outgoing'];
// print_r($res);
$domt->create($res);
$domt->was();
}
$firstofmonth = @mktime(00, 01, 00, @date("n"), 1, @date("Y"));
$today = time() + 2 * 24 * 60 * 60;
if ($vpslist) {
foreach ($vpslist as $vps) {
$vpst = $vps->getList("vpstraffic");
$list = get_namelist_from_objectlist($vpst);
$tu = trafficGetIndividualObjectTotal($vpst, $firstofmonth, $today, $vps->nname);
$sq->rawQuery("update vps set used_q_traffic_usage = '{$tu}' where nname = '{$vps->nname}'");
list($month, $year) = get_last_month_and_year();
$tlu = VpstrafficHistory::getMonthTotal($vpst, $month, $year, null);
$tlu = $tlu['traffic_usage'];
$sq->rawQuery("update vps set used_q_traffic_last_usage = '{$tlu}' where nname = '{$vps->nname}'");
/*
try {
$sgbl->__var_backupdisk_usage[$vps->getClName()] = rl_exec_get(null, $vps->syncserver, array("vps", "getBackupDiskSize"), array($vps->nname));
} catch (Exception $e) {
$sgbl->__var_backupdisk_usage[$vps->getClName()] = null;
}
*/
}
}
}