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


PHP Output::buffer方法代码示例

本文整理汇总了PHP中Output::buffer方法的典型用法代码示例。如果您正苦于以下问题:PHP Output::buffer方法的具体用法?PHP Output::buffer怎么用?PHP Output::buffer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Output的用法示例。


在下文中一共展示了Output::buffer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processRequest

function processRequest(&$db)
{
    ob_end_clean();
    include_once BASE_PATH . "/lib/output.php";
    Output::buffer();
    $link = "http://mywebsql.net/updates.php?j=1&" . "c=MyWebSQL&l=" . urlencode(LANGUAGE) . "&v=" . urlencode(APP_VERSION) . "&t=" . urlencode(THEME_PATH);
    // include compact edition in update if we are using one
    if (defined('MYWEBSQL_COMPACT_DIST')) {
        $link .= "&e=compact";
    }
    $output = "";
    if (ini_get("allow_url_fopen")) {
        $output = file_get_contents($link);
    } else {
        $output = curl_get($link);
    }
    Session::set('updates', 'check', '1');
    echo $output;
    $db->disconnect();
    Output::flush();
    die;
}
开发者ID:onyxnz,项目名称:quartzpos,代码行数:22,代码来源:updatecheck.php

示例2: define

 * @author     Samnan ur Rehman
 * @copyright  (c) 2008-2014 Samnan ur Rehman
 * @web        http://mywebsql.net
 * @license    http://mywebsql.net/license
 */
define('BASE_PATH', dirname(__FILE__));
header("Content-Type: text/html;charset=utf-8");
include_once BASE_PATH . "/lib/session.php";
Session::init();
date_default_timezone_set('UTC');
include BASE_PATH . '/modules/configuration.php';
initConfiguration();
// buffer unless we are in the download module (it will handle the buffering itself)
if (v($_REQUEST["type"]) != "dl") {
    include_once BASE_PATH . "/lib/output.php";
    Output::buffer();
} else {
    $_REQUEST["type"] = 'download';
}
if (defined("TRACE_FILEPATH") && TRACE_FILEPATH && defined("TRACE_MESSAGES") && TRACE_MESSAGES) {
    ini_set("error_log", TRACE_FILEPATH);
}
include_once BASE_PATH . "/lib/util.php";
require BASE_PATH . '/modules/auth.php';
$auth_module = new MyWebSQL_Authentication();
if (!$auth_module->authenticate()) {
    if (v($_REQUEST["q"]) == "wrkfrm") {
        echo view('session_expired');
    } else {
        include BASE_PATH . "/modules/splash.php";
        $form = view('auth', array('LOGINID' => htmlspecialchars($auth_module->getUserName()), 'SERVER_NAME' => htmlspecialchars($auth_module->getCustomServer()), 'SERVER_TYPE' => htmlspecialchars($auth_module->getCustomServerType())));
开发者ID:riki343,项目名称:MyPrivateDesktop,代码行数:31,代码来源:index.php

示例3: processRequest

/**
 * This file is a part of MyWebSQL package
 *
 * @file:      modules/viewblob.php
 * @author     Samnan ur Rehman
 * @copyright  (c) 2008-2012 Samnan ur Rehman
 * @web        http://mywebsql.net
 * @license    http://mywebsql.net/license
 */
function processRequest(&$db)
{
    // verify that the blob data is from the existing and valid query
    $queryCode = v($_REQUEST['query']);
    if (Session::get('select', 'query') == "" || md5(Session::get('select', 'query')) != $queryCode) {
        echo view('invalid_request');
        return;
    }
    $id = v($_REQUEST["id"]);
    $name = v($_REQUEST["name"]);
    $isEditable = isBlobEditable();
    $table = Session::get('select', 'unique_table');
    // Session::get('select', 'table')
    $message = '';
    if (v($_REQUEST['act']) == 'save' && $isEditable && count($_FILES) > 0 && isset($_FILES['blobdata'])) {
        $result = saveBlobData($db, $table, $id, $name);
        $message = $result ? '<div class="message ui-state-default">' . __('Blob data saved') . '</div>' : '<div class="message ui-state-error">' . __('Failed to save blob data') . '</div>';
        unset($_REQUEST["blobtype"]);
    }
    include BASE_PATH . "/config/blobs.php";
    $bType = v($_REQUEST["blobtype"]) && array_key_exists(v($_REQUEST["blobtype"]), $blobTypes) ? v($_REQUEST["blobtype"]) : "txt";
    // @todo: optimize. this should always fetch one row
    $blobOptions = '';
    $query = Session::get('select', 'query');
    if ($table == "") {
        $applyLimit = true;
    } else {
        $applyLimit = strpos($query, "limit ");
    }
    if ($applyLimit == false) {
        $query .= $db->getLimit(1, $id);
    }
    if (!$db->query($query) || $db->numRows() == 0) {
        echo view('error_page');
        return;
    }
    $row = $applyLimit == false ? $db->fetchRow() : $db->fetchSpecificRow($id);
    // show as image etc ...
    if ($bType && v($_REQUEST["show"]) && $blobTypes[$bType][2]) {
        ob_end_clean();
        include_once BASE_PATH . "/lib/output.php";
        Output::buffer();
        header($blobTypes[$bType][2]);
        print $row[$name];
        return true;
    }
    foreach ($blobTypes as $k => $v) {
        if ($bType == $k) {
            $blobOptions .= "<option value='{$k}' selected=\"selected\">{$v['0']}</option>\n";
        } else {
            $blobOptions .= "<option value='{$k}'>{$v['0']}</option>\n";
        }
    }
    // try to show the blob data as specified type
    if ($bType && $blobTypes[$bType] && v($blobTypes[$bType][3])) {
        if (strpos($blobTypes[$bType][3], "#link#") !== false) {
            $blobData = str_replace("#link#", "?q=wrkfrm&type=viewblob&show=1&id={$id}&name={$name}&blobtype={$bType}&query=" . urlencode($queryCode), $blobTypes[$bType][3]);
        } else {
            $blobData = htmlspecialchars($row[$name]);
        }
    } else {
        if ($bType && $blobTypes[$bType] && v($blobTypes[$bType][4])) {
            $func = $blobTypes[$bType][4];
            $blobData = htmlspecialchars(print_r($func($row[$name]), 1));
        } else {
            $blobData = htmlspecialchars($row[$name]);
        }
    }
    $toolbar = $isEditable ? view('viewblob_toolbar', array('BLOBOPTIONS' => $blobOptions)) : '<div class="message ui-state-default">' . __('Blob data is not editable') . '</div>';
    $replace = array('ID' => $id, 'NAME' => $name, 'BLOBOPTIONS' => $blobOptions, 'BLOBDATA' => $blobData, 'TABLE' => $table == "" ? "" : htmlspecialchars($table), 'QCODE' => md5(Session::get('select', 'query')), 'BLOB_TOOLBAR' => $toolbar, 'MESSAGE' => $message);
    echo view('viewblob', $replace);
}
开发者ID:onyxnz,项目名称:quartzpos,代码行数:81,代码来源:viewblob.php


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