示例#1
0
文件: output.php 项目: xcelaio/xcela
    public static function Flush($buffer)
    {
        // Output default headers
        foreach (header_defaults as $header) {
            header($header);
        }
        // Output the mime type
        if (defined(mime_assoc[self::$mime])) {
            header(mime_assoc[self::$mime]);
        }
        // Handle file upload (towards the client)
        if (self::$upload === true) {
            header(sprintf(header_upload, self::$filename));
        }
        // Prepare the URL string
        $url = '?' . route_key . '=' . self::$path;
        foreach ($_GET as $var => $val) {
            $url .= $var != route_key ? '&' . $var . '=' . $val : '';
        }
        // Theme wrapping
        $t = new Template(self::$chrome ? self::$base : '');
        if (!self::$chrome) {
            $t->Override('@!sys.buffer;');
        }
        $t->Affect(array('sys.buffer' => $buffer, 'sys.url' => $url, 'sys.rand' => uniqid(time()), 'sys.time' => time()));
        $t->Flush();
    }
}
// Launch the initializer
Output::Initialize();