本文整理汇总了PHP中sys::db_queries方法的典型用法代码示例。如果您正苦于以下问题:PHP sys::db_queries方法的具体用法?PHP sys::db_queries怎么用?PHP sys::db_queries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sys
的用法示例。
在下文中一共展示了sys::db_queries方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function process_row($row, $line)
{
$data = array("folder" => $this->_folder);
if (DEBUG) {
print_r(array($line, $row));
}
foreach ($row as $key => $val) {
if (isset($this->_fields[$this->_headers[$key]])) {
$data[$this->_fields[$this->_headers[$key]]] = $val;
}
}
if (DEBUG) {
print_r($data);
}
$id = !empty($data["id"]) ? $data["id"] : -1;
if ($this->_validate_only) {
$result = $this->_sgsml->validate($data, $id);
} else {
$result = $this->_sgsml->update($data, $id);
}
sys::$db_queries = array();
// reduce memory usage
if (empty($result)) {
// validate
$this->out(".");
} else {
if (is_array($result)) {
$message = sprintf("{t}line{/t} %s: %s", $line, self::err_to_str($result));
$this->_errors[] = $message;
$this->out("<span style='color:red; font-weight:bold;'>{t}Error{/t}:</span> " . q($message) . ", ");
} else {
$this->out("#" . $line . ": " . q($result) . ", ");
}
}
}
示例2: array
static function rebuild_schema($rebuild_search = false)
{
if ($rebuild_search) {
self::_out(sprintf("{t}Processing %s ...{/t}", "schema, search index"));
} else {
self::_out(sprintf("{t}Processing %s ...{/t}", "schema"));
}
if (sgsml_parser::table_exists("simple_sys_search") and $rebuild_search) {
db_delete("simple_sys_search", array(), array());
}
$files = array();
$folders = array("modules/schema/", "modules/schema_sys/", SIMPLE_EXT . "/modules/schema/", SIMPLE_EXT . "/modules/schema_sys/", SIMPLE_CUSTOM . "/modules/schema/", SIMPLE_CUSTOM . "/modules/schema_sys/");
foreach ($folders as $folder) {
if (!is_dir($folder)) {
continue;
}
foreach (scandir($folder) as $file) {
if (!strpos($file, ".xml")) {
continue;
}
$files[$file] = $folder . $file;
}
}
@set_time_limit(60 * count($files));
foreach ($files as $file) {
self::_out(basename($file) . " ", false);
$schema = db_get_schema($file, "", "", false);
sys::$db_queries = array();
// reduce memory usage
if (!$rebuild_search or sys_strbegins(basename($file), "nodb_") or empty($schema["views"]["display"])) {
continue;
}
if (!empty($schema["att"]["SQL_HANDLER"]) or !empty($schema["att"]["NO_SEARCH_INDEX"])) {
continue;
}
$table = $schema["att"]["NAME"];
$fields = $schema["fields"];
$rows = db_select($table, array("id", "folder"), array(), "", "");
if (!is_array($rows) or count($rows) == 0) {
continue;
}
self::_out("... ", false);
foreach ($rows as $row) {
if (folder_in_trash($row["folder"])) {
continue;
}
db_search_update($table, $row["id"], $fields);
}
}
self::_out("<br>", false);
}
示例3: _create_default_folder_xml_data
private static function _create_default_folder_xml_data($xml, $folder)
{
$assets = sys_array_shift(get_object_vars($xml));
if (is_object($assets)) {
$assets = array($assets);
}
if (!is_array($assets) or count($assets) == 0) {
return;
}
@set_time_limit(60);
$sgsml = new sgsml($folder, "new");
$sgsml->notification = false;
foreach ($assets as $asset) {
$data = get_object_vars($asset);
if (isset($data["@attributes"])) {
unset($data["@attributes"]);
}
$result = $sgsml->insert($data);
if (DEBUG and !is_int($result)) {
print_r($result);
}
if (DEBUG) {
echo " @" . memory_get_usage(true);
}
sys::$cache = array();
sys::$db_queries = array();
}
}