当前位置: 首页>>代码示例>>PHP>>正文


PHP flush函数代码示例

本文整理汇总了PHP中flush函数的典型用法代码示例。如果您正苦于以下问题:PHP flush函数的具体用法?PHP flush怎么用?PHP flush使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了flush函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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> &nbsp; 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


注:本文中的flush函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。