本文整理汇总了PHP中Output::Flush方法的典型用法代码示例。如果您正苦于以下问题:PHP Output::Flush方法的具体用法?PHP Output::Flush怎么用?PHP Output::Flush使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Output
的用法示例。
在下文中一共展示了Output::Flush方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckBuffer
static function CheckBuffer()
{
if(Output::$_err_detected)
Output::Flush();
}
示例2: __construct
public function __construct()
{
// Enforce time limit, ignore aborts
set_time_limit(2);
ignore_user_abort();
// Load constants
require_once 'system/core/constants.php';
// Set error reporting (debuging mode)
if (debug) {
error_reporting(E_ALL ^ E_DEPRECATED);
}
// Load security
require_once 'system/core/security.php';
// Load dependencies
require_once 'system/core/dependencies.php';
// Session handling
date_default_timezone_set(local_timezone);
session_start();
// Initialize the stack (stack routing)
Stack::Push((isset($_REQUEST[route_key]) and trim($_REQUEST[route_key]) != '') ? $_REQUEST[route_key] : route_home);
// Initialize buffering
ob_start();
// Cycle the processes stack, run all the processors sucessively until the stack is empty.
while (Stack::Ahead() > 0) {
// Pre-init / re-init 'found' flag (in case the stack had multiple items)
$found = false;
// Catch anything that might happen
try {
foreach (route_repos as $rep => $types) {
if (!is_array($types)) {
$types = array($types);
}
foreach ($types as $t) {
$p = $rep . Stack::Top() . $t;
if (is_file($p)) {
$found = true;
// Update the output sequencer
Output::Path(Stack::Path());
if (!(include $p)) {
throw new SystemException(sprintf(err_include500, Stack::Top()));
}
break 2;
}
}
}
if (!$found) {
throw new SystemException(sprintf(err_include404, Stack::Top()));
}
// Processor completed; pop the stack
Stack::Pop();
} catch (Exception $e) {
throw new SystemException($e);
}
}
$this->buffer = ob_get_contents();
ob_end_clean();
// Pass the buffer to the output handler for final render
Output::Flush($this->buffer);
exit(1);
}
示例3: ob_get_contents
* Copyright (c) 2009-2010 ATBBS Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
$buffered_content = ob_get_contents();
ob_end_clean();
// require 'template.php';
Output::Assign('title', $page_title);
Output::Assign('onload', $onload_javascript);
Output::Assign('body', $buffered_content);
Output::Assign('head', $header);
Output::Assign('menu', $main_menu);
Output::Assign('User', $User);
Output::Flush();