本文整理汇总了PHP中Sqlite类的典型用法代码示例。如果您正苦于以下问题:PHP Sqlite类的具体用法?PHP Sqlite怎么用?PHP Sqlite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Sqlite类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: createExtraVariables
function createExtraVariables()
{
global $gbl, $sgbl, $login, $ghtml;
$revc = $login->getObject('general')->reversedns_b;
if (!$revc->dns_slave_list) {
throw new lxexception("dns_params_not_configured", '', "");
}
$this->syncserver = implode(",", $revc->dns_slave_list);
$rdrlist = $this->getList('rdnsrange');
$rdrange = null;
foreach ($rdrlist as $k => $v) {
list($base, $first) = self::getBaseEnd($v->firstip);
list($base, $last) = self::getBaseEnd($v->lastip);
$rdrange[] = array($base, $first, $last);
}
$this->__var_rdnsrange = $rdrange;
dprintr($this->__var_rdnsrange);
$sq = new Sqlite(null, 'reversedns');
$res = $sq->getTable();
foreach ($res as $r) {
list($base, $last) = self::getBaseEnd($r['nname'], $this->__var_rdnsrange);
$total[$base][] = array('nname' => $r['nname'], 'end' => $last, 'reversename' => $r['reversename']);
}
$this->__var_revdns1 = $revc->primarydns;
$this->__var_revdns2 = $revc->secondarydns;
$this->__var_reverse_list = $total;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:27,代码来源:reversednslib.php
示例2: security_blanket_main
function security_blanket_main()
{
global $argv;
//sleep(100);
$rem = unserialize(lfile_get_contents($argv[1]));
unlink($argv[1]);
if (!$rem) {
exit;
}
// Merged from 6.1.x/kloxo/bin/common/securityblanket.php (revision 472)
// workaround for the following php bug:
// http://bugs.php.net/bug.php?id=47948
// http://bugs.php.net/bug.php?id=51329
if (is_array($rem->func) && count($rem->func) > 0) {
$class = $rem->func[0];
class_exists($class);
}
// ---
call_user_func_array($rem->func, $rem->arglist);
$sq = new Sqlite(null, $rem->table);
$res = $sq->getRowsWhere("nname = '{$rem->nname}'", array($rem->flagvariable));
if ($res[0][$rem->flagvariable] === 'doing') {
$sq->rawQuery("update {$rem->table} set {$rem->flagvariable} = 'Program Got aborted in the midst. Please try again.' where nname = '{$rem->nname}'");
}
}
开发者ID:digideskio,项目名称:hypervm,代码行数:25,代码来源:securityblanket.php
示例3: createExtraVariables
function createExtraVariables()
{
// Not here. Two different extra variables are needed, so they are created in synctosystem.
// Brought back here, since the secondary server concept has been abolished in favor of multiple primary servers.
global $gbl, $sgbl, $login, $ghtml;
if ($sgbl->isHyperVm()) {
$this->createExtraVariablesHyperVM();
return;
}
$db = new Sqlite($this->__masterserver, "dns");
$gen = $login->getObject('general')->generalmisc_b;
$serverlist = explode(",", $this->syncserver);
$list = null;
foreach ($serverlist as $server) {
$string = "syncserver LIKE '%{$server}%'";
$nlist = $db->getRowsWhere($string, array('nname'));
$dlistv = "__var_domainlist_{$server}";
$this->{$dlistv} = $nlist;
}
//FIXME: We should only get the addon domains for the domains configured on that particular server. IN the case of single server system, it is not a problem, since that means we will have to get all the domains. but in the case of distributed setup, we need to properly get only the add domains under the domains loaded above.
$dbaddon = new Sqlite(null, "addondomain");
$addr = $dbaddon->getTable(array('nname'));
foreach ($serverlist as $server) {
$dlistv = "__var_domainlist_{$server}";
$this->{$dlistv} = lx_array_merge(array($this->{$dlistv}, $addr));
}
$this->fixDateSerial();
$this->__var_addonlist = $this->getParentO()->getList('addondomain');
$mydb = new Sqlite(null, "ipaddress");
$string = "syncserver = '{$this->syncserver}'";
$this->__var_ipssllist = $mydb->getRowsWhere($string, array('ipaddr', 'nname'));
}
开发者ID:soar-team,项目名称:kloxo,代码行数:32,代码来源:dnslib.php
示例4: loaddriverappInfo
function loaddriverappInfo($master)
{
$db = new Sqlite($master, 'driver');
$res = $db->getTable();
// Doing the setFromArray stuff here itself. Since that is the place from where we are called, and if we call setfromarray here, naturally it results in a loop.
$__t_ob = null;
foreach ((array) $res as $row) {
$nname = $row['nname'];
$obj = new driver($master, null, $nname);
foreach ($row as $key => $value) {
if (csb($key, "ser_")) {
$key = strfrom($key, "ser_");
$value = unserialize(base64_decode($value));
}
if (cse($key, "_b") && !is_object($value)) {
$value = new $key(null, null, $nname);
}
if (is_numeric($key)) {
continue;
}
$obj->{$key} = $value;
}
$__t_ob[$nname] = $obj;
}
if (!isset($this->driver)) {
$this->driver = array();
}
$this->driver[$master] = $__t_ob;
//dprintr($this->driver);
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:30,代码来源:gbllib.php
示例5: createExtraVariables
function createExtraVariables()
{
$parent = $this->getParentO();
$sq = new Sqlite(null, "lxguardwhitelist");
$res = $sq->getRowsWhere("syncserver = '{$parent->syncserver}'", array('nname', 'ipaddress'));
$this->__var_whitelist = $res;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:7,代码来源:lxguardwhitelistlib.php
示例6: updateform
function updateform($subaction, $param)
{
global $gbl, $sgbl, $login, $ghtml;
$sq = new Sqlite(null, 'web');
$list = $sq->getRowsWhere("syncserver = '{$this->syncserver}'", array('nname'));
$dlist = get_namelist_from_arraylist($list, 'nname');
if (!$login->isAdmin()) {
$sq = new Sqlite(null, 'domain');
$nlist = $sq->getRowsWhere("parent_clname = '{$login->getClName()}'", array('nname'));
$ndlist = get_namelist_from_arraylist($nlist);
foreach ($dlist as $k => $v) {
if (!array_search_bool($v, $ndlist)) {
unset($dlist[$k]);
}
}
}
if ($dlist) {
$dlist = add_disabled($dlist);
$vlist['domain'] = array('s', $dlist);
} else {
$vlist['domain'] = array('M', "No Domain");
$vlist['__v_button'] = array();
}
return $vlist;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:25,代码来源:domainipaddresslib.php
示例7: defaultValue
function defaultValue($var)
{
if ($var === 'ipaddr') {
$db = new Sqlite($this->__masterserver, 'ipaddress');
$res = $db->getRowsWhere("nname = '{$this->nname}'");
return $res[0]['ipaddr'];
}
return null;
}
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:9,代码来源:sslipaddresslib.php
示例8: createExtraVariables
function createExtraVariables()
{
$pserver = $this->getParentO();
$hdb = new Sqlite($this->__masterserver, 'hostdeny');
$string = "syncserver = '{$pserver->nname}' ";
$hlist = $hdb->getRowsWhere($string);
$this->__var_hostlist = $hlist;
dprintr($this->__var_hostlist);
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:9,代码来源:hostdenylib.php
示例9: createExtraVariables
function createExtraVariables()
{
$this->__var_system_username = $this->getParentO()->username;
$sq = new Sqlite(null, 'davuser');
$list = $sq->getRowsWhere("parent_clname = '{$this->parent_clname}'", array("username", "realpass"));
$this->__var_davuser = $list;
$sq = new Sqlite(null, 'web');
$list = $sq->getRowsWhere("syncserver = '{$this->getParentO()->syncserver}'", array('nname'));
$this->__var_domlist = get_namelist_from_arraylist($list);
}
开发者ID:soar-team,项目名称:kloxo,代码行数:10,代码来源:davuserlib.php
示例10: updateRemove
function updateRemove($param)
{
if_demo_throw_exception();
$server = $this->syncserver;
$sq = new Sqlite(null, "lxguardhit");
foreach ($param['_accountselect'] as $ip) {
$sq->rawQuery("delete from lxguardhit where syncserver = '{$server}' AND ipaddress = '{$ip}'");
}
self::save_current_hitlist($server);
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:10,代码来源:lxguardlib.php
示例11: initThisList
static function initThisList($parent, $class)
{
$db = new Sqlite($parent->__masterserver, "ipaddress");
if ($parent->isAdmin()) {
$result = $db->getTable();
} else {
$result = $db->getRowsWhere("clientname = '" . $parent->nname . "'");
}
return $result;
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:10,代码来源:exclusiveiplib.php
示例12: createExtraVariables
function createExtraVariables()
{
global $gbl, $sgbl, $login, $ghtml;
$this->__var_mailto = $this->getParentO()->cron_mailto;
$mydb = new Sqlite($this->__masterserver, "cron");
$parent = $this->getParentO();
$this->__var_cron_list = $mydb->getRowsWhere("username = '{$parent->username}'");
$mydb = new Sqlite($this->__masterserver, "uuser");
$userlist = $mydb->getRowsWhere("nname = '{$parent->username}'");
$this->__var_user_list = $userlist[0];
}
开发者ID:zseand,项目名称:kloxo,代码行数:11,代码来源:cronlib.php
示例13: getTotalPaid
function getTotalPaid()
{
$sq = new Sqlite(null, "paymentdetail");
$res = $sq->getRowsWhere("month = '{$this->month}' AND client = '{$this->client}'");
$total = 0;
if ($res) {
foreach ($res as $r) {
$total += $r['amount'];
}
}
return $total;
}
开发者ID:soar-team,项目名称:kloxo,代码行数:12,代码来源:invoicelib.php
示例14: createExtraVariables
function createExtraVariables()
{
$path = $this->getParentO()->getFullDocRoot();
$this->__var_htp = "{$path}/.htaccess";
$sq = new Sqlite(null, $this->get__table());
$res = $sq->getRowsWhere("parent_clname = '{$this->parent_clname}'");
$result = merge_array_object_not_deleted($res, $this);
foreach ($result as $r) {
$out[$r['mimehandler']] = $r['extension'];
}
$this->__var_mimehandler = $out;
}
开发者ID:zseand,项目名称:kloxo,代码行数:12,代码来源:mimehandler.php
示例15: driverload_main
function driverload_main()
{
global $argv, $gbl, $sgbl, $login, $ghtml;
initProgram('admin');
$p = parse_opt($argv);
if (isset($p['clear-existing'])) {
$sq = new Sqlite(null, "driver");
$sq->rawQuery("delete from driver");
}
$list = $login->getList('pserver');
foreach ($list as $l) {
$l->getandWriteModuleDriver();
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:14,代码来源:driverload.php
示例16: getDnsTemplateList
static function getDnsTemplateList($parent)
{
$res = $parent->dnstemplate_list;
dprintr($res);
if (!$res) {
$sq = new Sqlite(null, "dnstemplate");
$res = $sq->getTable();
$res = get_namelist_from_arraylist($res);
}
if (!$res) {
throw new lxException("err_no_dns_template", '', '');
}
return $res;
}
开发者ID:soar-team,项目名称:kloxo,代码行数:14,代码来源:domainbaselib.php
示例17: createUsed
function createUsed()
{
if (isset($this->used_f)) {
return $this->used_f;
}
$db = new Sqlite($this->__masterserver, 'domaintemplate');
$res = $db->getRowsWhere("dnstemplate = '{$this->nname}'");
if ($res) {
$this->used_f = 'on';
} else {
$this->used_f = 'off';
}
return $this->used_f;
}
开发者ID:soar-team,项目名称:kloxo,代码行数:14,代码来源:dnstemplatelib.php
示例18: columns
static function columns($table, $connection = 'default')
{
foreach (Sqlite::query("pragma table_info({$table});") as $c) {
$columns[] = $c['name'];
}
return @$columns ?: array();
}
开发者ID:xtiurti,项目名称:web-service-lavanderia-encoder,代码行数:7,代码来源:sqlite.php
示例19: update_all_slave
function update_all_slave()
{
$db = new Sqlite(null, "pserver");
$list = $db->getTable(array("nname"));
foreach ($list as $l) {
if ($l['nname'] === 'localhost') {
continue;
}
try {
print "Upgrading Slave {$l['nname']}...\n";
rl_exec_get(null, $l['nname'], 'remotetestfunc', null);
} catch (exception $e) {
print $e->getMessage();
print "\n";
}
}
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:17,代码来源:updatelib.php
示例20: database_main
function database_main()
{
global $argc, $argv;
global $gbl, $login, $ghtml;
initProgram('admin');
if ($argv[1] == 'exec') {
$db = new Sqlite(null, 'client');
$res = $db->rawQuery($argv[2]);
foreach ($res as &$r) {
foreach ($r as $k => &$__r) {
if (csb($k, "ser_")) {
$__r = unserialize(base64_decode($__r));
}
}
}
print_r($res);
exit;
}
}
开发者ID:soar-team,项目名称:kloxo,代码行数:19,代码来源:database.php
注:本文中的Sqlite类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论