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


PHP DupUtil::fcgi_flush方法代碼示例

本文整理匯總了PHP中DupUtil::fcgi_flush方法的典型用法代碼示例。如果您正苦於以下問題:PHP DupUtil::fcgi_flush方法的具體用法?PHP DupUtil::fcgi_flush怎麽用?PHP DupUtil::fcgi_flush使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DupUtil的用法示例。


在下文中一共展示了DupUtil::fcgi_flush方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: mysqli_close

        //Check to make sure the connection is alive
        if (!empty($err)) {
            if (!mysqli_ping($dbh)) {
                mysqli_close($dbh);
                $dbh = DupUtil::db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname'], $_POST['dbport']);
                // Reset session setup
                @mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
                DupUtil::mysql_set_charset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
            }
            DUPX_Log::Info("**ERROR** database error write '{$err}' - [sql=" . substr($sql_result_file_data[$counter], 0, 75) . "...]");
            $dbquery_errs++;
            //Buffer data to browser to keep connection open
        } else {
            if ($fcgi_buffer_count++ > $fcgi_buffer_pool) {
                $fcgi_buffer_count = 0;
                DupUtil::fcgi_flush();
            }
            $dbquery_rows++;
        }
    }
    $counter++;
}
@mysqli_commit($dbh);
@mysqli_autocommit($dbh, true);
DUPX_Log::Info("ERRORS FOUND:\t{$dbquery_errs}");
DUPX_Log::Info("DROP TABLE:\t{$drop_log}");
DUPX_Log::Info("QUERIES RAN:\t{$dbquery_rows}\n");
$dbtable_count = 0;
if ($result = mysqli_query($dbh, "SHOW TABLES")) {
    while ($row = mysqli_fetch_array($result, MYSQLI_NUM)) {
        $table_rows = DupUtil::table_row_count($dbh, $row[0]);
開發者ID:DIESELOK,項目名稱:GH-Frontend-5,代碼行數:31,代碼來源:ajax.step1.php

示例2: load


//.........這裏部分代碼省略.........
             @mysqli_free_result($row_count);
             $row_count = $rows_result[0];
             if ($row_count == 0) {
                 continue;
             }
             $page_size = 25000;
             $pages = ceil($row_count / $page_size);
             for ($page = 0; $page < $pages; $page++) {
                 $current_row = 0;
                 $start = $page * $page_size;
                 $end = $start + $page_size;
                 // Grab the content of the table
                 $data = mysqli_query($conn, sprintf('SELECT * FROM %s LIMIT %d, %d', $table, $start, $end));
                 if (!$data) {
                     $report['errsql'][] = mysqli_error($conn);
                 }
                 //Loops every row
                 while ($row = mysqli_fetch_array($data)) {
                     $report['scan_rows']++;
                     $current_row++;
                     $upd_col = array();
                     $upd_sql = array();
                     $where_sql = array();
                     $upd = false;
                     $serial_err = 0;
                     //Loops every cell
                     foreach ($columns as $column => $primary_key) {
                         if (in_array($column, $exclude_cols)) {
                             continue;
                         }
                         $report['scan_cells']++;
                         $edited_data = $data_to_fix = $row[$column];
                         $base64coverted = false;
                         //Only replacing string values
                         if (!is_numeric($row[$column])) {
                             //Base 64 detection
                             if (base64_decode($row[$column], true)) {
                                 $decoded = base64_decode($row[$column], true);
                                 if (self::is_serialized($decoded)) {
                                     $edited_data = $decoded;
                                     $base64coverted = true;
                                 }
                             }
                             //Replace logic - level 1: simple check on basic serilized strings
                             foreach ($list as $item) {
                                 $edited_data = self::recursive_unserialize_replace($item['search'], $item['replace'], $edited_data);
                             }
                             //Replace logic - level 2: repair larger/complex serilized strings
                             $serial_check = self::fix_serial_string($edited_data);
                             if ($serial_check['fixed']) {
                                 $edited_data = $serial_check['data'];
                             } elseif ($serial_check['tried'] && !$serial_check['fixed']) {
                                 $serial_err++;
                             }
                         }
                         //Change was made
                         if ($edited_data != $data_to_fix || $serial_err > 0) {
                             $report['updt_cells']++;
                             //Base 64 encode
                             if ($base64coverted) {
                                 $edited_data = base64_encode($edited_data);
                             }
                             $upd_col[] = $column;
                             $upd_sql[] = $column . ' = "' . mysqli_real_escape_string($conn, $edited_data) . '"';
                             $upd = true;
                         }
                         if ($primary_key) {
                             $where_sql[] = $column . ' = "' . mysqli_real_escape_string($conn, $data_to_fix) . '"';
                         }
                     }
                     //PERFORM ROW UPDATE
                     if ($upd && !empty($where_sql)) {
                         $sql = "UPDATE `{$table}` SET " . implode(', ', $upd_sql) . ' WHERE ' . implode(' AND ', array_filter($where_sql));
                         $result = mysqli_query($conn, $sql) or $report['errsql'][] = mysqli_error($conn);
                         if ($result) {
                             if ($serial_err > 0) {
                                 $report['errser'][] = "SELECT " . implode(', ', $upd_col) . " FROM `{$table}`  WHERE " . implode(' AND ', array_filter($where_sql)) . ';';
                             }
                             $report['updt_rows']++;
                         }
                     } elseif ($upd) {
                         $report['errkey'][] = sprintf("Row [%s] on Table [%s] requires a manual update.", $current_row, $table);
                     }
                     DupUtil::fcgi_flush();
                 }
                 @mysqli_free_result($data);
             }
             if ($upd) {
                 $report['updt_tables']++;
             }
         }
     }
     $profile_end = DupUtil::get_microtime();
     $report['time'] = DupUtil::elapsed_time($profile_end, $profile_start);
     $report['errsql_sum'] = empty($report['errsql']) ? 0 : count($report['errsql']);
     $report['errser_sum'] = empty($report['errser']) ? 0 : count($report['errser']);
     $report['errkey_sum'] = empty($report['errkey']) ? 0 : count($report['errkey']);
     $report['err_all'] = $report['errsql_sum'] + $report['errser_sum'] + $report['errkey_sum'];
     return $report;
 }
開發者ID:batruji,項目名稱:metareading,代碼行數:101,代碼來源:ajax.step2.php

示例3: load


//.........這裏部分代碼省略.........
             //Paged Records
             for ($page = 0; $page < $pages; $page++) {
                 $current_row = 0;
                 $start = $page * $page_size;
                 $end = $start + $page_size;
                 $sql = sprintf("SELECT {$colList} FROM `%s` LIMIT %d, %d", $table, $start, $offset);
                 $data = mysqli_query($conn, $sql);
                 if (!$data) {
                     $report['errsql'][] = mysqli_error($conn);
                 }
                 $scan_count = $row_count < $end ? $row_count : $end;
                 DUPX_Log::Info("\tScan => {$start} of {$scan_count}", 2);
                 //DEBUG ONLY:
                 //DUPX_Log::Info("\t{$sql}", 3);
                 //Loops every row
                 while ($row = mysqli_fetch_array($data)) {
                     $report['scan_rows']++;
                     $current_row++;
                     $upd_col = array();
                     $upd_sql = array();
                     $where_sql = array();
                     $upd = false;
                     $serial_err = 0;
                     //Loops every cell
                     foreach ($columns as $column => $primary_key) {
                         if (in_array($column, $exclude_cols)) {
                             continue;
                         }
                         $report['scan_cells']++;
                         $edited_data = $data_to_fix = $row[$column];
                         $base64coverted = false;
                         //Only replacing string values
                         if (!empty($row[$column]) && !is_numeric($row[$column])) {
                             //Base 64 detection
                             if (base64_decode($row[$column], true)) {
                                 $decoded = base64_decode($row[$column], true);
                                 if (self::is_serialized($decoded)) {
                                     $edited_data = $decoded;
                                     $base64coverted = true;
                                 }
                             }
                             //Replace logic - level 1: simple check on basic serilized strings
                             foreach ($list as $item) {
                                 $edited_data = self::recursive_unserialize_replace($item['search'], $item['replace'], $edited_data);
                             }
                             //Replace logic - level 2: repair larger/complex serilized strings
                             $serial_check = self::fix_serial_string($edited_data);
                             if ($serial_check['fixed']) {
                                 $edited_data = $serial_check['data'];
                             } elseif ($serial_check['tried'] && !$serial_check['fixed']) {
                                 $serial_err++;
                             }
                         }
                         //Change was made
                         if ($edited_data != $data_to_fix || $serial_err > 0) {
                             $report['updt_cells']++;
                             //Base 64 encode
                             if ($base64coverted) {
                                 $edited_data = base64_encode($edited_data);
                             }
                             $upd_col[] = $column;
                             $upd_sql[] = $column . ' = "' . mysqli_real_escape_string($conn, $edited_data) . '"';
                             $upd = true;
                         }
                         if ($primary_key) {
                             $where_sql[] = $column . ' = "' . mysqli_real_escape_string($conn, $data_to_fix) . '"';
                         }
                     }
                     //PERFORM ROW UPDATE
                     if ($upd && !empty($where_sql)) {
                         $sql = "UPDATE `{$table}` SET " . implode(', ', $upd_sql) . ' WHERE ' . implode(' AND ', array_filter($where_sql));
                         $result = mysqli_query($conn, $sql) or $report['errsql'][] = mysqli_error($conn);
                         //DEBUG ONLY:
                         DUPX_Log::Info("\t{$sql}", 3);
                         if ($result) {
                             if ($serial_err > 0) {
                                 $report['errser'][] = "SELECT " . implode(', ', $upd_col) . " FROM `{$table}`  WHERE " . implode(' AND ', array_filter($where_sql)) . ';';
                             }
                             $report['updt_rows']++;
                         }
                     } elseif ($upd) {
                         $report['errkey'][] = sprintf("Row [%s] on Table [%s] requires a manual update.", $current_row, $table);
                     }
                 }
                 DupUtil::fcgi_flush();
                 @mysqli_free_result($data);
             }
             if ($upd) {
                 $report['updt_tables']++;
             }
         }
     }
     $profile_end = DupUtil::get_microtime();
     $report['time'] = DupUtil::elapsed_time($profile_end, $profile_start);
     $report['errsql_sum'] = empty($report['errsql']) ? 0 : count($report['errsql']);
     $report['errser_sum'] = empty($report['errser']) ? 0 : count($report['errser']);
     $report['errkey_sum'] = empty($report['errkey']) ? 0 : count($report['errkey']);
     $report['err_all'] = $report['errsql_sum'] + $report['errser_sum'] + $report['errkey_sum'];
     return $report;
 }
開發者ID:healthcommcore,項目名稱:osnap,代碼行數:101,代碼來源:class.serializer.php


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