public static function prepGetList(&$pListHash) { if (!empty($pListHash['period'])) { $pListHash['period_format'] = BitDb::getPeriodFormat($pListHash['period']); } parent::prepGetList($pListHash); }
break 2; } $rs->MoveNext(); } $rs->Close(); } } $sqlArray = array(); //error_reporting( E_ALL ); // packages are sorted alphabetically. but we really need a /etc/rc.d/rc.3 style loading precidence! // We perform several loops through mPackages due to foreign keys, and some packages may insert // value into other packages tables - typically users_permissions, bit_preferences, etc... sort($_REQUEST['packages']); // Need to unquote constraints. but this need replacing with a datadict function require_once '../kernel/BitDbBase.php'; $gBitKernelDb = new BitDb(); $gBitKernelDb->mType = $gBitDbType; // ---------------------- 1. ---------------------- // let's generate all the tables's $gBitInstallDb->StartTrans(); $uninstalledPackages = array(); // get a list of packages to install maintained gScanOrder from mPackages foreach (array_keys($gBitInstaller->mPackages) as $p) { if (in_array($p, $_REQUEST['packages'])) { $uninstalledPackages[] = $p; } } $maxLoop = count($uninstalledPackages) * count($uninstalledPackages); $i = 0; $installedPackages = array(); foreach (array_keys($gBitInstaller->mPackages) as $key) {
function refresh_url($url_id) { $info = $this->get_url($url_id); if (strstr($info["url"], 'bit_') || strstr($info["url"], 'messages_')) { return false; } @($fp = fopen($info["url"], "r")); if (!$fp) { return; } $data = ''; while (!feof($fp)) { $data .= fread($fp, 4096); } fclose($fp); global $gBitSystem; $now = $gBitSystem->getUTCTime(); $query = "UPDATE `" . BIT_DB_PREFIX . "tidbits_bookmarks_urls` SET `last_updated`=?, `data`=? WHERE `url_id`=?"; $result = $this->mDb->query($query, array((int) $now, BitDb::dbByteEncode($data), $url_id)); return true; }
/** will activate ADODB's native debugging output * @param pLevel debugging level - FALSE is off, TRUE is on, 99 is verbose **/ function debug($pLevel = 99) { parent::debug($pLevel); if (is_object($this->mDb)) { $this->mDb->debug = $pLevel; } }
function queryComplete() { if (!empty($this->mDebug)) { print "<tt>\n" . vsprintf(str_replace('?', "'%s'", $this->mDb->last_query), $this->mDb->last_parameters) . "\n</tt><br/>"; if ($this->mDebug == 99) { bt(); } } parent::queryComplete(); }
} if (isset($_REQUEST['fSubmitDatabase']) || isset($_REQUEST['fUpdateTables'])) { global $gBitDbType, $gBitDbHost, $gBitDbUser, $gBitDbPassword, $gBitDbName; global $gDb_src, $prefix_src, $gDb_dst, $prefix_dst; // source database settings $gBitDbType = $_REQUEST['db_src']; $gBitDbHost = $_REQUEST['host_src']; $gBitDbUser = $_REQUEST['user_src']; $gBitDbPassword = $_REQUEST['pass_src']; $gBitDbName = $_REQUEST['name_src']; $prefix_src = $_REQUEST['prefix_src']; if (testDatabase()) { $gBitSmarty->assign('error_src', TRUE); return; } else { $gDb_src = new BitDb(); } $tables_src = $gDb_src->MetaTables(); if (isset($_REQUEST['fUpdateTables'])) { $gBitSmarty->assignByRef('skip_tables', $tables_src); return; } // destination database settings $gBitDbType = $_REQUEST['db_dst']; $gBitDbHost = $_REQUEST['host_dst']; $gBitDbUser = $_REQUEST['user_dst']; $gBitDbPassword = $_REQUEST['pass_dst']; $gBitDbName = $_REQUEST['name_dst']; $prefix_dst = $_REQUEST['prefix_dst']; if (testDatabase()) { $gBitSmarty->assign('error_dst', TRUE);