本文整理汇总了PHP中flush函数的典型用法代码示例。如果您正苦于以下问题:PHP flush函数的具体用法?PHP flush怎么用?PHP flush使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了flush函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: paintResult
/**
* Paint the result of a send operation
* @param string The email address that was tried
* @param boolean True if the message was successfully sent
*/
public function paintResult($address, $result)
{
$this->count++;
$color = $result ? "#51c45f" : "#d67d71";
$result_text = $result ? "PASS" : "FAIL";
?>
<div style="color: #ffffff; margin: 2px; padding: 3px;
font-weight: bold; background: <?php
echo $color;
?>
;">
<span style="float: right; text-decoration: underline;"> <?php
echo $result_text;
?>
</span> Recipient (
<?php
echo $this->count;
?>
):
<?php
echo $address;
?>
</div>
<?php
flush();
}
开发者ID:kjgarza,项目名称:ushahidi,代码行数:31,代码来源:DefaultView.php
示例2: allTests
function allTests($communicator)
{
global $NS;
echo "testing type names... ";
flush();
$a = $NS ? constant("_and\\_array::_as") : constant("and_array::_as");
$b = $NS ? eval("return new _and\\_xor();") : eval("return new and_xor();");
test($b->_abstract == 0);
test($b->_clone == 0);
test($b->_private == 0);
test($b->_protected == 0);
test($b->_public == 0);
test($b->_this == 0);
test($b->_throw == 0);
test($b->_use == 0);
test($b->_var == 0);
$p = $communicator->stringToProxy("test:tcp -p 10000");
$c = $NS ? eval("return _and\\functionPrxHelper::uncheckedCast(\$p);") :
eval("return and_functionPrxHelper::uncheckedCast(\$p);");
$d = $NS ? eval("return _and\\diePrxHelper::uncheckedCast(\$p);") :
eval("return and_diePrxHelper::uncheckedCast(\$p);");
$e = $NS ? eval("return _and\\echoPrxHelper::uncheckedCast(\$p);") :
eval("return and_echoPrxHelper::uncheckedCast(\$p);");
$e1 = new echoI();
$f = $NS ? eval("return _and\\enddeclarePrxHelper::uncheckedCast(\$p);") :
eval("return and_enddeclarePrxHelper::uncheckedCast(\$p);");
$f1 = new enddeclareI();
$g = $NS ? eval("return new _and\\_endif();") : eval("return new and_endif();");
$h = $NS ? eval("return new _and\\_endwhile();") : eval("return new and_endwhile();");
$i = $NS ? constant("_and\\_or") : constant("and_or");
$j = $NS ? constant("_and\\_print") : constant("and_print");
$j = $NS ? constant("_and\\_require_once") : constant("and_require_once");
echo "ok\n";
}
开发者ID:bholl,项目名称:zeroc-ice,代码行数:35,代码来源:Client.php
示例3: finishTurn
public function finishTurn()
{
echo "go\n";
$this->debug("Remaining Time: " . $this->timeRemaining() . "\n");
$this->debug("-------TURN-------\n");
flush();
}
开发者ID:noirsoldats,项目名称:AIChallenge-Ants-PHP,代码行数:7,代码来源:Ants.php
示例4: updateInfo
function updateInfo($percent, $infoText, $debug = true) {
global $command_line;
if ($debug) {
Debug::message($infoText, Debug::WARNING);
}
$percentageText = ($percent == 1)? '100': sprintf('%2.0f', $percent * 100);
if (isset($command_line) and $command_line) {
if ($percent < 0) {
$percentageText = ' * ';
} else {
$percentageText .= '%';
}
echo $percentageText, ' ', $infoText, "\n";
} else {
echo '<script>';
if ($percent >= 0) {
echo 'document.getElementById("progress-bar").style="width:' . ($percent * 100) . '%;";', "\n",
'document.getElementById("progress-bar").innerHTML ="' . $percentageText . '%";', "\n";
}
if ($percent == 1) {
echo 'document.getElementById("progress-bar").className = "progress-bar progress-bar-striped";';
}
echo 'document.getElementById("progressbar-info").innerHTML="' . addslashes($infoText) . '";</script>';
}
// This is for the buffer achieve the minimum size in order to flush data
// echo str_repeat(' ', 1024 * 64);
// Send output to browser immediately
flush();
}
开发者ID:nikosv,项目名称:openeclass,代码行数:32,代码来源:upgradeHelper.php
示例5: add_sites
function add_sites($array)
{
global $db, $spider;
foreach ($array as $value) {
$row = $db->get_one("select * from ve123_links where url='" . $value . "'");
if (empty($row)) {
echo $value . "<br>";
$spider->url($value);
$title = $spider->title;
$fulltxt = $spider->fulltxt(800);
$keywords = $spider->keywords;
$description = $spider->description;
$pagesize = $spider->pagesize;
$htmlcode = $spider->htmlcode;
$array = array('url' => $value, 'title' => $title, 'fulltxt' => $fulltxt, 'pagesize' => $pagesize, 'keywords' => $keywords, 'description' => $description, 'addtime' => time(), 'updatetime' => time());
//echo $fulltxt;
$db->insert("ve123_links", $array);
file_put_contents(PATH . "k/www/" . base64_encode($value), $htmlcode);
//echo $htmlcode;
} else {
echo "已存在:" . $value . "<br>";
}
ob_flush();
flush();
sleep(1);
}
}
开发者ID:tanny2015,项目名称:DataStructure,代码行数:27,代码来源:find_sites.php
示例6: testdb
function testdb(&$db, $createtab = "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
{
global $ADODB_version, $ADODB_FETCH_MODE;
adodb_backtrace();
$max = 100;
$sql = 'select * from ADOXYZ';
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
//print "<h3>ADODB Version: $ADODB_version Host: <i>$db->host</i> Database: <i>$db->database</i></h3>";
// perform query once to cache results so we are only testing throughput
$rs = $db->Execute($sql);
if (!$rs) {
print "Error in recordset<p>";
return;
}
$arr = $rs->GetArray();
//$db->debug = true;
global $ADODB_COUNTRECS;
$ADODB_COUNTRECS = false;
$start = microtime();
for ($i = 0; $i < $max; $i++) {
$rs =& $db->Execute($sql);
$arr =& $rs->GetArray();
// print $arr[0][1];
}
$end = microtime();
$start = explode(' ', $start);
$end = explode(' ', $end);
//print_r($start);
//print_r($end);
// print_r($arr);
$total = $end[0] + trim($end[1]) - $start[0] - trim($start[1]);
printf("<p>seconds = %8.2f for %d iterations each with %d records</p>", $total, $max, sizeof($arr));
flush();
//$db->Close();
}
开发者ID:prometheus-ev,项目名称:promdilps,代码行数:35,代码来源:benchmark.php
示例7: debug
function debug($texto)
{
file_put_contents(TEMPLATEPATH . '/log.log', date('d/m/Y H:i:s') . ' - ' . $texto . "\n", FILE_APPEND);
//echo date('d/m/Y H:i:s').' - '.$texto."<br>";
flush();
return;
}
开发者ID:ratjadi,项目名称:andreaszeitler.net,代码行数:7,代码来源:functions.php
示例8: exportCallback
/**
* @param ContextInterface $context
* @param StepExecutor $executor
*
* @return \Closure
*/
protected function exportCallback(ContextInterface $context, StepExecutor $executor)
{
return function () use($executor) {
flush();
$executor->execute();
};
}
开发者ID:ramunasd,项目名称:platform,代码行数:13,代码来源:ExportHandler.php
示例9: importFromRedshop
function importFromRedshop()
{
@ob_clean();
echo $this->getHtmlPage();
$this->token = hikashop_getFormToken();
flush();
if (isset($_GET['import']) && $_GET['import'] == '1') {
$time = microtime(true);
$processed = $this->doImport();
if ($processed) {
$elasped = microtime(true) - $time;
if (!$this->refreshPage) {
echo '<p></br><a' . $this->linkstyle . 'href="' . hikashop_completeLink('import&task=import&importfrom=redshop&' . $this->token . '=1&import=1&time=' . time()) . '">' . JText::_('HIKA_NEXT') . '</a></p>';
}
echo '<p style="font-size:0.85em; color:#605F5D;">Elasped time: ' . round($elasped * 1000, 2) . 'ms</p>';
} else {
echo '<a' . $this->linkstyle . 'href="' . hikashop_completeLink('import&task=show') . '">' . JText::_('HIKA_BACK') . '</a>';
}
} else {
echo $this->getStartPage();
}
if ($this->refreshPage) {
echo "<script type=\"text/javascript\">\r\nr = true;\r\n</script>";
}
echo '</body></html>';
exit;
}
开发者ID:rodhoff,项目名称:MNW,代码行数:27,代码来源:reds.php
示例10: flushPause
function flushPause($pause = 0)
{
echo ob_get_clean();
@ob_flush();
flush();
usleep($pause * 1000000);
}
开发者ID:sebmarkbage,项目名称:mootools-core,代码行数:7,代码来源:DOMReady.php
示例11: sMain
/**
* function sMain ()
* Khoi tao
**/
function sMain()
{
global $ttH;
$ttH->func->load_language($this->modules);
$fun = isset($ttH->post['f']) ? $ttH->post['f'] : '';
flush();
switch ($fun) {
case "load_country_op":
echo $this->do_load_country_op();
exit;
break;
case "load_province_op":
echo $this->do_load_province_op();
exit;
break;
case "load_district_op":
echo $this->do_load_district_op();
exit;
break;
case "load_ward_op":
echo $this->do_load_ward_op();
exit;
break;
default:
echo '';
exit;
break;
}
exit;
}
开发者ID:duonghoaikhanh,项目名称:shophoa,代码行数:34,代码来源:ajax.php
示例12: GAL_getImageInfo
function GAL_getImageInfo($folder, $file)
{
$thumbFolder = $folder . $GLOBALS['GAL_thumbnail_folder'];
$fileName = $file . '.meta';
$ret = array();
$ret['dateLastModified'] = -1;
clearstatcache();
if (!file_exists($thumbFolder . $fileName)) {
$dateLastModified = @filemtime($folder . $file);
$f = @fopen($thumbFolder . $fileName, 'wb');
if (is_resource($f)) {
fwrite($f, $dateLastModified);
fclose($f);
}
$ret['dateLastModified'] = $dateLastModified;
} else {
$f = @fopen($thumbFolder . $fileName, 'rb');
if (is_resource($f)) {
$dateLastModified = trim(@fread($f, filesize($thumbFolder . $fileName)));
fclose($f);
}
$ret['dateLastModified'] = $dateLastModified;
}
flush();
return $ret;
}
开发者ID:rcardenass,项目名称:Escuela,代码行数:26,代码来源:gallery_functions.inc.php
示例13: CreateConfigFile
function CreateConfigFile()
{
global $dbUser, $dbPass, $dbHost, $dbName, $user, $md5pass;
$config = <<<DATA
<?php
define('MYSQL_HOST', '{$dbHost}');
define('MYSQL_LOGIN', '{$dbUser}');
define('MYSQL_PASSWORD', '{$dbPass}');
define('MYSQL_DB', '{$dbName}');
define('USER', '{$user}');
define('PASS', '{$md5pass}');
//define('DEBUG', true);
//define('MYSQL_DEBUG', true);
//define('TIME_DEBUG', true);
DATA;
$fh = @fopen('config.php', 'wb');
if (false === $fh) {
echo "Can't create config.php. Create it manually with next content:\n<hr><pre>";
echo htmlspecialchars($config);
flush();
exit;
}
fwrite($fh, $config);
}
开发者ID:azizjonm,项目名称:kins,代码行数:28,代码来源:install.php
示例14: postNote
/**
* post Note Action
*
* @param string $httpData->appUid (optional, if it is not passed try use $_SESSION['APPLICATION'])
* @return array containg the case notes
*/
function postNote($httpData)
{
require_once "classes/model/AppNotes.php";
//extract(getExtJSParams());
if (isset($httpData->appUid) && trim($httpData->appUid) != "") {
$appUid = $httpData->appUid;
} else {
$appUid = $_SESSION['APPLICATION'];
}
if (!isset($appUid)) {
throw new Exception('Can\'t resolve the Apllication ID for this request.');
}
$usrUid = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : "";
$noteContent = addslashes($httpData->noteText);
//Disabling the controller response because we handle a special behavior
$this->setSendResponse(false);
//Add note case
$appNote = new AppNotes();
$response = $appNote->addCaseNote($appUid, $usrUid, $noteContent, intval($httpData->swSendMail));
//Send the response to client
@ini_set("implicit_flush", 1);
ob_start();
echo G::json_encode($response);
@ob_flush();
@flush();
@ob_end_flush();
ob_implicit_flush(1);
}
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:34,代码来源:appProxy.php
示例15: send
function send($newsletter_id)
{
global $db;
$audience_select = get_audience_sql_query($this->query_name, 'newsletters');
$audience = $db->Execute($audience_select['query_string']);
$records = $audience->RecordCount();
if ($records == 0) {
return 0;
}
$i = 0;
while (!$audience->EOF) {
$i++;
$html_msg['EMAIL_FIRST_NAME'] = $audience->fields['customers_firstname'];
$html_msg['EMAIL_LAST_NAME'] = $audience->fields['customers_lastname'];
$html_msg['EMAIL_GREET'] = EMAIL_GREET;
$html_msg['EMAIL_MESSAGE_HTML'] = $this->content_html;
zen_mail($audience->fields['customers_firstname'] . ' ' . $audience->fields['customers_lastname'], $audience->fields['customers_email_address'], $this->title, $this->content, STORE_NAME, EMAIL_FROM, $html_msg, 'newsletters');
echo zen_image(DIR_WS_ICONS . 'tick.gif', $audience->fields['customers_email_address']);
//force output to the screen to show status indicator each time a message is sent...
if (function_exists('ob_flush')) {
@ob_flush();
}
@flush();
$audience->MoveNext();
}
$newsletter_id = zen_db_prepare_input($newsletter_id);
$db->Execute("update " . TABLE_NEWSLETTERS . "\r\n set date_sent = now(), status = '1'\r\n where newsletters_id = '" . zen_db_input($newsletter_id) . "'");
return $records;
//return number of records processed whether successful or not
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:30,代码来源:newsletter.php
示例16: download
public function download($filename = null)
{
if (empty($filename)) {
$this->redirect();
}
$local_file = './assets/materi/' . base64_decode($filename);
$download_file = base64_decode($filename);
// set the download rate limit (=> 20,5 kb/s)
$download_rate = 20.5;
if (file_exists($local_file) || is_file($local_file)) {
// ambil satu data berdasarkan nama file
$data = $this->model->m_materi()->ambilSatu(array('file' => $download_file));
// counting tiap download
$this->model->m_materi()->countDownload($data->materi_id);
header('Cache-control: private');
header('Content-Type: application/octet-stream');
header('Content-Length: ' . filesize($local_file));
header('Content-Disposition: filename=' . $download_file);
flush();
$file = fopen($local_file, "r");
while (!feof($file)) {
// send the current file part to the browser
print fread($file, round($download_rate * 1024));
// flush the content to the browser
flush();
// sleep one second
sleep(1);
}
fclose($file);
} else {
die('Error: The file ' . $local_file . ' does not exist!');
}
// $this->redirect($this->uri->baseUri.'assets/materi/'.base64_decode($filename));
}
开发者ID:ferdhika31,项目名称:catatan,代码行数:34,代码来源:Materi.php
示例17: action_messages
public function action_messages($route_id, &$data, $args)
{
$uimessages = $_MIDCOM->serviceloader->load('uimessages');
if (!$uimessages->supports('comet') || !$uimessages->can_view()) {
return;
}
$type = null;
$name = null;
if (isset($_MIDCOM->dispatcher->get["cometType"])) {
$type = $_MIDCOM->dispatcher->get["cometType"];
}
if (isset($_MIDCOM->dispatcher->get["cometName"])) {
$name = $_MIDCOM->dispatcher->get["cometName"];
}
if ($type == null && $name == null) {
throw new midcom_exception_notfound("No comet name or type defined");
}
if (ob_get_level() == 0) {
ob_start();
}
while (true) {
$messages = '';
if ($uimessages->has_messages()) {
$messages = $uimessages->render_as('comet');
} else {
$uimessages->add(array('title' => 'Otsikko from comet', 'message' => 'viesti from comet...'));
}
midcom_core_helpers_comet::pushdata($messages, $type, $name);
ob_flush();
flush();
sleep(5);
}
// $data['messages'] = $messages;
}
开发者ID:abbra,项目名称:midcom,代码行数:34,代码来源:comet.php
示例18: output
/**
* send the PDF to the browser.
* @return boolean true if it's ok
*/
public function output()
{
if (!$this->html2pdf instanceof jHtml2Pdf) {
throw new jException('jtcpdf~errors.reptcpdf.not_a_jtcpdf');
}
$pdf_data = $this->html2pdf->Output('', 'S');
// headers to disable cache
$this->addHttpHeader('Cache-Control', 'public, must-revalidate, max-age=0', false);
// HTTP/1.1
$this->addHttpHeader('Pragma', 'public', false);
$this->addHttpHeader('Expires', 'Sat, 26 Jul 1997 05:00:00 GMT', false);
// Date in the past
$this->addHttpHeader('Last-Modified', gmdate("D, d M Y H:i:s") . " GMT", false);
$this->addHttpHeader('Content-Length', strlen($pdf_data));
if ($this->doDownload) {
$this->addHttpHeader("Content-Type", "application/force-download");
$this->addHttpHeader("Content-Type", "application/octet-stream", -1);
$this->addHttpHeader("Content-Transfer-Encoding", "binary");
$this->addHttpHeader('Content-Disposition', 'attachment; filename="' . str_replace('"', '\\"', $this->outputFileName) . '";');
} else {
$this->addHttpHeader('Content-Type', 'application/pdf');
$this->addHttpHeader('Content-Disposition', 'inline; filename="' . str_replace('"', '\\"', $this->outputFileName) . '";');
}
$this->sendHttpHeaders();
echo $pdf_data;
flush();
return true;
}
开发者ID:aurellemeless,项目名称:favoris,代码行数:32,代码来源:jResponseHtml2Pdf.class.php
示例19: output
/**
* send the content or the file to the browser.
* @return boolean true it it's ok
*/
public function output()
{
if ($this->doDownload) {
$this->mimeType = 'application/forcedownload';
if (!strlen($this->outputFileName)) {
$f = explode('/', str_replace('\\', '/', $this->fileName));
$this->outputFileName = $f[count($f) - 1];
}
}
if ($this->hasErrors()) {
return false;
}
$this->addHttpHeader("Content-Type", $this->mimeType, $this->doDownload);
if ($this->doDownload) {
$this->_downloadHeader();
}
if ($this->content === null) {
if (is_readable($this->fileName) && is_file($this->fileName)) {
$this->_httpHeaders['Content-Length'] = filesize($this->fileName);
$this->sendHttpHeaders();
readfile($this->fileName);
flush();
return true;
} else {
throw new jException('jelix~errors.repbin.unknow.file', $this->fileName);
return false;
}
} else {
$this->_httpHeaders['Content-Length'] = strlen($this->content);
$this->sendHttpHeaders();
echo $this->content;
flush();
return true;
}
}
开发者ID:alienpham,项目名称:helenekling,代码行数:39,代码来源:jResponseBinary.class.php
示例20: getMessage
function getMessage($currentTime, $currentLineCount)
{
$filename = 'log.txt';
$fileTime = filemtime($filename);
$counter = 0;
$contents = '';
$lineCount = 0;
$text = '';
if ($fileTime != $currentTime) {
$contents = file_get_contents($filename);
}
if ($contents != '') {
$lines = explode("\n", trim($contents));
$lineCount = count($lines);
for ($index = $currentLineCount; $index < $lineCount; $index++) {
$text = $text . $lines[$index] . "\n";
}
}
$response = array();
$response['text'] = $text;
$response['fileTime'] = $fileTime;
$response['lineCount'] = $lineCount;
echo json_encode($response);
flush();
}
开发者ID:noshbar,项目名称:SimpleAjaxChat,代码行数:25,代码来源:file.php
注:本文中的flush函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论