當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Sqlite類代碼示例

本文整理匯總了PHP中Sqlite的典型用法代碼示例。如果您正苦於以下問題:PHP Sqlite類的具體用法?PHP Sqlite怎麽用?PHP Sqlite使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Sqlite類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的Sqlite類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。