本文整理汇总了PHP中garbage_collection函数的典型用法代码示例。如果您正苦于以下问题:PHP garbage_collection函数的具体用法?PHP garbage_collection怎么用?PHP garbage_collection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了garbage_collection函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
function main($id, $mode)
{
global $db, $user, $phpbb_root_path, $config, $phpEx;
// Do we have an id? No, then just exit
$confirm_id = request_var('id', '');
$type = request_var('type', 0);
if (!$confirm_id || !$type) {
exit;
}
// Try and grab code for this id and session
$sql = 'SELECT code, seed
FROM ' . CONFIRM_TABLE . "\n\t\t\tWHERE session_id = '" . $db->sql_escape($user->session_id) . "'\n\t\t\t\tAND confirm_id = '" . $db->sql_escape($confirm_id) . "'\n\t\t\t\tAND confirm_type = {$type}";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// If we have a row then grab data else create a new id
if (!$row) {
exit;
}
if ($config['captcha_gd']) {
include $phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx;
} else {
include $phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx;
}
$captcha = new captcha();
$captcha->execute($row['code'], $row['seed']);
garbage_collection();
exit_handler();
}
示例2: kleeja_admin_err
/**
* Print admin area errors
*
* @param string $msg The message of error
* @param bool $navigation [optional] Show the side mneu or not
* @param string $title [optional] The title of the error
* @param bool $exit [optional] halt after showing the error
* @param bool|string $redirect [optional] if link given it will redirected to it after $rs seconds
* @param int $rs [optional] if $redirected is given and not false, this will be the time in seconds
* @param string $style [optional] this is just here to use it inside kleeja_admin_info to use admin_info
*/
function kleeja_admin_err($msg, $navigation = true, $title = '', $exit = true, $redirect = false, $rs = 5, $style = 'error.php')
{
global $text, $tpl, $SHOW_LIST, $adm_extensions, $adm_extensions_menu;
global $STYLE_PATH_ADMIN, $lang, $plugin, $SQL, $MINI_MENU;
($hook = $plugin->run_hook('kleeja_admin_err_func')) ? eval($hook) : null;
//run hook
#Exception for ajax
if (isset($_GET['_ajax_'])) {
$text = $msg . ($redirect ? "\n" . '<script type="text/javascript"> setTimeout("location.href=\'' . str_replace('&', '&', $redirect) . '\';", ' . $rs * 1000 . ');</script>' : '');
echo_ajax(1, $tpl->display($style));
$SQL->close();
exit;
}
#assign {text} in err template
$text = $msg . ($redirect != false ? redirect($redirect, false, false, $rs, true) : '');
$SHOW_LIST = $navigation;
#header
include get_template_path('header.php');
#show tpl
include get_template_path($style);
#footer
include get_template_path('footer.php');
#show tpl
//echo $tpl->display($style);
#footer
//echo $tpl->display("admin_footer");
#if exit, clean it
if ($exit) {
garbage_collection();
exit;
}
}
示例3: phpbb_end_update
function phpbb_end_update($cache, $config)
{
$cache->purge();
$config->increment('assets_version', 1);
?>
</p>
</div>
</div>
<span class="corners-bottom"><span></span></span>
</div>
</div>
</div>
<div id="page-footer">
<div class="copyright">
Powered by <a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Limited
</div>
</div>
</div>
</body>
</html>
<?php
garbage_collection();
exit_handler();
}
示例4: adm_page_footer
/**
* Page footer for acp pages
*/
function adm_page_footer($copyright_html = true)
{
global $db, $config, $template, $user, $auth, $cache;
global $starttime, $phpbb_admin_path;
// Output page creation time
if (defined('DEBUG')) {
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
// Let's remove $auth->acl_get('a_') until I finish coding permissions properly... and also add/remove 'a_' when users are added/removed from administrators in ACP
//$is_admin = (($user->data['user_level'] == ADMIN) || $auth->acl_get('a_')) ? true : false;
$is_admin = $user->data['user_level'] == ADMIN ? true : false;
if (!empty($_REQUEST['explain']) && $is_admin && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report')) {
$db->sql_report('display');
}
$debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . ($config['gzip_compress'] ? 'On' : 'Off') . ($user->load ? ' | Load : ' . $user->load : ''), $totaltime);
if ($is_admin && defined('DEBUG_EXTRA')) {
if (function_exists('memory_get_usage')) {
if ($memory_usage = memory_get_usage()) {
global $base_memory_usage;
$memory_usage -= $base_memory_usage;
$memory_usage = get_formatted_filesize($memory_usage);
$debug_output .= ' | Memory Usage: ' . $memory_usage;
}
}
$debug_output .= ' | <a href="' . build_url() . '&explain=1">Explain</a>';
}
}
$template->assign_vars(array('DEBUG_OUTPUT' => defined('DEBUG') ? $debug_output : '', 'TRANSLATION_INFO' => !empty($user->lang['TRANSLATION_INFO']) ? $user->lang['TRANSLATION_INFO'] : '', 'S_COPYRIGHT_HTML' => $copyright_html, 'VERSION' => $config['version']));
$template->display('body');
garbage_collection();
exit_handler();
}
示例5: main
function main($id, $mode)
{
global $db, $user, $phpbb_root_path, $config, $phpEx, $phpbb_container;
$captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
$captcha->init(request_var('type', 0));
$captcha->execute();
garbage_collection();
exit_handler();
}
示例6: deliver_demo
/**
* Entry point for delivering image CAPTCHAs in the ACP.
*/
function deliver_demo($selected)
{
global $db, $user, $config, $src_container;
$captcha = $src_container->get('captcha.factory')->get_instance($selected);
$captcha->init(CONFIRM_REG);
$captcha->execute_demo();
garbage_collection();
exit_handler();
}
示例7: main
function main($id, $mode)
{
global $config, $phpbb_container, $request;
$captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
$captcha->init($request->variable('type', 0));
$captcha->execute();
garbage_collection();
exit_handler();
}
示例8: main
function main($id, $mode)
{
global $db, $user, $phpbb_root_path, $config, $phpEx;
include $phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx;
$captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
$captcha->init(request_var('type', 0));
$captcha->execute();
garbage_collection();
exit_handler();
}
示例9: disabled_board
public function disabled_board($event)
{
$style_id = !$this->config['override_user_style'] ? $this->user->data['user_style'] : $this->config['default_style'];
$sql = 'SELECT style_id FROM ' . STYLES_TABLE . ' WHERE style_copyright LIKE "© SiteSplat.com%"';
$result = $this->db->sql_query($sql);
$row = $this->db->sql_fetchrow($result);
$in_sitesplat = in_array($style_id, $row);
$this->template->assign_vars(array('PM_NEW_COUNT_BADGE' => $this->user->lang('PM_NEW_MSG_BUBBLE', (int) $this->user->data['user_new_privmsg']), 'PM_NEW_COUNT' => $this->user->lang('PM_NEW_MSG', (int) $this->user->data['user_new_privmsg']), 'PM_UNREAD_COUNT' => $this->user->lang('PM_UNREAD_MSG', (int) $this->user->data['user_unread_privmsg'])));
if ($this->config['board_disable'] && !defined('IN_LOGIN') && $in_sitesplat && !$this->auth->acl_get('a_')) {
global $phpbb_path_helper, $phpbb_root_path;
// Determine board url - we may need it later
$board_url = generate_board_url() . '/';
// This path is sent with the base template paths in the assign_vars()
// call below. We need to correct it in case we are accessing from a
// controller because the web paths will be incorrect otherwise.
$phpbb_path_helper = $this->phpbb_container->get('path_helper');
$corrected_path = $phpbb_path_helper->get_web_root_path();
$web_path = defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH ? $board_url : $corrected_path;
// Send a proper content-language to the output
$user_lang = $this->user->lang['USER_LANG'];
if (strpos($user_lang, '-x-') !== false) {
$user_lang = substr($user_lang, 0, strpos($user_lang, '-x-'));
}
$file = $phpbb_root_path . 'ext/sitesplat/BBCore/styles/all/template/offline_board_body.html';
$fp = fopen($file, 'r');
$content = fread($fp, filesize($file));
fclose($fp);
$match = array('#\\{S_CONTENT_DIRECTION\\}#', '#\\{S_USER_LANG\\}#', '#\\{S_CONTENT_ENCODING\\}#', '#\\{SITENAME\\}#', '#\\{PAGE_TITLE\\}#', '#\\{T_STYLESHEET_LINK\\}#', '#\\{T_THEME_PATH\\}#', '#\\{SCRIPT_NAME\\}#', '#\\{L_BOARD_DISABLED\\}#', '#\\{ACP_DISABLE_MESSAGE\\}#', '#\\{L_LOGIN_LOGOUT\\}#', '#\\{U_LOGIN_LOGOUT\\}#');
$replace = array($this->user->lang['DIRECTION'], $user_lang, 'UTF-8', $this->config['sitename'], 'Website offline', "{$web_path}styles/" . rawurlencode($this->user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $this->config['assets_version'], "{$web_path}styles/" . rawurlencode($this->user->style['style_path']) . '/theme', str_replace('.' . 'php', '', $this->user->page['page_name']), 'board disabled', $this->config['board_disable_msg'], $this->user->lang['LOGIN'], append_sid("{$phpbb_root_path}ucp.php", 'mode=login'));
$content = preg_replace($match, $replace, $content);
$response = new Response('Content', 200, array('content-type' => 'text/html'));
$response->setContent($content);
$response->send();
garbage_collection();
exit_handler();
}
}
示例10: deliver_demo
/**
* Entry point for delivering image CAPTCHAs in the ACP.
*/
function deliver_demo($selected)
{
global $db, $user, $config;
$captcha =& phpbb_captcha_factory::get_instance($selected);
$captcha->init(CONFIRM_REG);
$captcha->execute_demo();
garbage_collection();
exit_handler();
}
示例11: page_footer
/**
* Generate page footer
*
* @param bool $run_cron Whether or not to run the cron
* @param bool $display_template Whether or not to display the template
* @param bool $exit_handler Whether or not to run the exit_handler()
*/
function page_footer($run_cron = true, $display_template = true, $exit_handler = true)
{
global $db, $config, $template, $user, $auth, $cache, $starttime, $phpbb_root_path, $phpEx;
global $request, $phpbb_dispatcher, $phpbb_admin_path;
// A listener can set this variable to `true` when it overrides this function
$page_footer_override = false;
/**
* Execute code and/or overwrite page_footer()
*
* @event core.page_footer
* @var bool run_cron Shall we run cron tasks
* @var bool page_footer_override Shall we return instead of running
* the rest of page_footer()
* @since 3.1.0-a1
*/
$vars = array('run_cron', 'page_footer_override');
extract($phpbb_dispatcher->trigger_event('core.page_footer', compact($vars)));
if ($page_footer_override) {
return;
}
phpbb_check_and_display_sql_report($request, $auth, $db);
$template->assign_vars(array('DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user, $phpbb_dispatcher), 'TRANSLATION_INFO' => !empty($user->lang['TRANSLATION_INFO']) ? $user->lang['TRANSLATION_INFO'] : '', 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Limited'), 'U_ACP' => $auth->acl_get('a_') && !empty($user->data['is_registered']) ? append_sid("{$phpbb_admin_path}index.{$phpEx}", false, true, $user->session_id) : ''));
// Call cron-type script
$call_cron = false;
if (!defined('IN_CRON') && !$config['use_system_cron'] && $run_cron && !$config['board_disable'] && !$user->data['is_bot'] && !$cache->get('_cron.lock_check')) {
$call_cron = true;
$time_now = !empty($user->time_now) && is_int($user->time_now) ? $user->time_now : time();
// Any old lock present?
if (!empty($config['cron_lock'])) {
$cron_time = explode(' ', $config['cron_lock']);
// If 1 hour lock is present we do not call cron.php
if ($cron_time[0] + 3600 >= $time_now) {
$call_cron = false;
}
}
}
// Call cron job?
if ($call_cron) {
global $phpbb_container;
$cron = $phpbb_container->get('cron.manager');
$task = $cron->find_one_ready_task();
if ($task) {
$url = $task->get_url();
$template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />');
} else {
$cache->put('_cron.lock_check', true, 60);
}
}
/**
* Execute code and/or modify output before displaying the template.
*
* @event core.page_footer_after
* @var bool display_template Whether or not to display the template
* @var bool exit_handler Whether or not to run the exit_handler()
*
* @since 3.1.0-RC5
*/
$vars = array('display_template', 'exit_handler');
extract($phpbb_dispatcher->trigger_event('core.page_footer_after', compact($vars)));
if ($display_template) {
$template->display('body');
}
garbage_collection();
if ($exit_handler) {
exit_handler();
}
}
示例12: feed_output
/**
* Outputs data as a Feed.
*
* @param int|array $blog_ids The id's of blogs that are going to get outputted,
* @param string $feed_type The type of feed we are outputting
*/
function feed_output($ids, $feed_type)
{
global $template, $phpbb_root_path, $phpEx, $page, $mode, $limit, $config, $user, $blog_data, $user_id, $blog_id;
// Feed explanation page
if ($feed_type == 'explain') {
$available_feeds = array('RSS 0.91' => blog_url(false, false, false, array_merge($_GET, array('feed' => 'RSS_0.91'))), 'RSS 1.0' => blog_url(false, false, false, array_merge($_GET, array('feed' => 'RSS_1.0'))), 'RSS 2.0' => blog_url(false, false, false, array_merge($_GET, array('feed' => 'RSS_2.0'))), 'ATOM' => blog_url(false, false, false, array_merge($_GET, array('feed' => 'ATOM'))), 'JAVASCRIPT' => array('url' => blog_url(false, false, false, array_merge($_GET, array('feed' => 'JAVASCRIPT'))), 'text' => htmlspecialchars('<script type="text/javascript" src="' . blog_url(false, false, false, array_merge($_GET, array('feed' => 'JAVASCRIPT', 'output' => 'true'))) . '"></script>'), 'demo' => '<script type="text/javascript" src="' . blog_url(false, false, false, array_merge($_GET, array('feed' => 'JAVASCRIPT', 'output' => 'true'))) . '"></script>'));
blog_plugins::plugin_do_ref('available_feeds', $available_feeds);
$message = '<strong>' . $user->lang['AVAILABLE_FEEDS'] . '</strong><br /><br />';
foreach ($available_feeds as $feed_name => $data) {
if (!is_array($data)) {
$message .= '<br /><h2><a href="' . $data . '">' . $feed_name . '</a></h2><div><a href="' . $data . '">' . $data . '</a></div><br />';
} else {
$message .= '<br /><h2><a href="' . $data['url'] . '">' . $feed_name . '</a></h2><div><dl class="codebox"><dt>' . $user->lang['CODE'] . ': <a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd><code style="font-size: 12px;">' . $data['text'] . '</code></dd></dl></div><br />';
if (isset($data['demo'])) {
$message .= $data['demo'];
}
}
}
trigger_error($message);
}
$title = $feed_type == 'JAVASCRIPT' ? str_replace("'", "\\'", $template->_tpldata['navlinks'][sizeof($template->_tpldata['navlinks']) - 1]['FORUM_NAME']) : $template->_tpldata['navlinks'][sizeof($template->_tpldata['navlinks']) - 1]['FORUM_NAME'];
$template->assign_vars(array('FEED' => $feed_type, 'SELF_URL' => blog_url(false, false, false, array('page' => $page, 'mode' => $mode)), 'SELF_FULL_URL' => blog_url(false, false, false, array('page' => $page, 'mode' => $mode, 'feed' => $feed_type, 'limit' => $limit)), 'TITLE' => $config['sitename'] . ' ' . $title . ' ' . $user->lang['FEED'], 'SITE_URL' => generate_board_url(), 'SITE_DESC' => $config['site_desc'], 'SITE_LANG' => $config['default_lang'], 'CURRENT_TIME' => $feed_type == 'ATOM' ? date3339() : date('r'), 'IMG_MIN' => generate_board_url() . '/styles/' . $user->theme['theme_path'] . '/theme/images/blog/min_dark_blue.gif', 'IMG_MAX' => generate_board_url() . '/styles/' . $user->theme['theme_path'] . '/theme/images/blog/max_dark_blue.gif', 'S_OUTPUT' => isset($_GET['output']) ? true : false));
if ($ids !== false) {
if (!is_array($ids)) {
$ids = array(intval($ids));
}
// the items section is only used in RSS 1.0
if ($feed_type == 'RSS_1.0') {
if (strpos($mode, 'comments') === false) {
// output the URLS for the items section
foreach ($ids as $id) {
$template->assign_block_vars('items', array('URL' => blog_url(blog_data::$blog[$id]['user_id'], $id)));
}
} else {
// output the URLS for the items section
foreach ($ids as $id) {
$template->assign_block_vars('items', array('URL' => blog_url(blog_data::$reply[$id]['user_id'], $id)));
}
}
}
if (strpos($mode, 'comments') === false) {
// Output the main data
foreach ($ids as $id) {
$blog_row = $blog_data->handle_blog_data($id, true);
$row = array('URL' => blog_url(blog_data::$blog[$id]['user_id'], $id), 'USERNAME' => blog_data::$user[blog_data::$blog[$id]['user_id']]['username'], 'MESSAGE' => str_replace("'", ''', $blog_row['MESSAGE']), 'PUB_DATE' => date('r', blog_data::$blog[$id]['blog_time']), 'DATE_3339' => $feed_type == 'ATOM' ? date3339(blog_data::$blog[$id]['blog_time']) : '');
$template->assign_block_vars('item', array_merge($blog_row, $row));
}
} else {
// Output the main data
foreach ($ids as $id) {
$reply_row = $blog_data->handle_reply_data($id, true);
$row = array('URL' => blog_url(blog_data::$reply[$id]['user_id'], blog_data::$reply[$id]['blog_id'], $id), 'USERNAME' => blog_data::$user[blog_data::$reply[$id]['user_id']]['username'], 'MESSAGE' => str_replace("'", ''', $reply_row['MESSAGE']), 'PUB_DATE' => date('r', blog_data::$reply[$id]['reply_time']), 'DATE_3339' => $feed_type == 'ATOM' ? date3339(blog_data::$reply[$id]['reply_time']) : '');
$template->assign_block_vars('item', array_merge($reply_row, $row));
}
}
blog_plugins::plugin_do_arg('function_feed_output', compact('ids', 'feed_type', 'mode'));
}
// Output time
if ($feed_type == 'JAVASCRIPT') {
header('Content-type: text/html; charset=UTF-8');
} else {
header('Content-type: application/xml; charset=UTF-8');
}
header('Cache-Control: private, no-cache="set-cookie"');
header('Expires: 0');
header('Pragma: no-cache');
$template->set_template();
$template->set_filenames(array('body' => 'blog/blog_feed.xml'));
$template->display('body');
garbage_collection();
exit_handler();
}
示例13: main
//.........这里部分代码省略.........
$pak_options = '';
foreach ($_paks as $pak) {
$pak_options .= '<option value="' . $pak . '">' . htmlspecialchars($pak) . '</option>';
}
$template->assign_vars(array('S_CHOOSE_PAK' => true, 'S_PAK_OPTIONS' => $pak_options, 'L_TITLE' => $user->lang['ACP_' . $lang], 'L_EXPLAIN' => $user->lang['ACP_' . $lang . '_EXPLAIN'], 'L_NO_PAK_OPTIONS' => $user->lang['NO_' . $lang . '_PAK'], 'L_CURRENT' => $user->lang['CURRENT_' . $lang], 'L_CURRENT_EXPLAIN' => $user->lang['CURRENT_' . $lang . '_EXPLAIN'], 'L_IMPORT_SUBMIT' => $user->lang['IMPORT_' . $lang], 'U_BACK' => $this->u_action, 'U_ACTION' => $this->u_action . '&action=import'));
}
break;
case 'export':
$this->page_title = 'EXPORT_' . $lang;
$this->tpl_name = 'message_body';
$template->assign_vars(array('MESSAGE_TITLE' => $user->lang['EXPORT_' . $lang], 'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="' . $this->u_action . '&action=send&hash=' . generate_link_hash('acp_icons') . '">', '</a>'), 'S_USER_NOTICE' => true));
return;
break;
case 'send':
if (!check_link_hash($request->variable('hash', ''), 'acp_icons')) {
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = "SELECT *\n\t\t\t\t\tFROM {$table}\n\t\t\t\t\tORDER BY {$fields}_order";
$result = $db->sql_query($sql);
$pak = '';
while ($row = $db->sql_fetchrow($result)) {
$pak .= "'" . addslashes($row[$fields . '_url']) . "', ";
$pak .= "'" . addslashes($row[$fields . '_width']) . "', ";
$pak .= "'" . addslashes($row[$fields . '_height']) . "', ";
$pak .= "'" . addslashes($row['display_on_posting']) . "', ";
if ($mode == 'smilies') {
$pak .= "'" . addslashes($row['emotion']) . "', ";
$pak .= "'" . addslashes($row['code']) . "', ";
}
$pak .= "\n";
}
$db->sql_freeresult($result);
if ($pak != '') {
garbage_collection();
header('Cache-Control: public');
// Send out the Headers
header('Content-Type: text/x-delimtext; name="' . $mode . '.pak"');
header('Content-Disposition: inline; filename="' . $mode . '.pak"');
echo $pak;
flush();
exit;
} else {
trigger_error($user->lang['NO_' . strtoupper($fields) . '_EXPORT'] . adm_back_link($this->u_action), E_USER_WARNING);
}
break;
case 'delete':
if (confirm_box(true)) {
$sql = "DELETE FROM {$table}\n\t\t\t\t\t\tWHERE {$fields}_id = {$icon_id}";
$db->sql_query($sql);
switch ($mode) {
case 'smilies':
break;
case 'icons':
// Reset appropriate icon_ids
$db->sql_query('UPDATE ' . TOPICS_TABLE . "\n\t\t\t\t\t\t\t\tSET icon_id = 0\n\t\t\t\t\t\t\t\tWHERE icon_id = {$icon_id}");
$db->sql_query('UPDATE ' . POSTS_TABLE . "\n\t\t\t\t\t\t\t\tSET icon_id = 0\n\t\t\t\t\t\t\t\tWHERE icon_id = {$icon_id}");
break;
}
$notice = $user->lang[$lang . '_DELETED'];
$cache->destroy('_icons');
$cache->destroy('sql', $table);
$phpbb_container->get('text_formatter.cache')->invalidate();
if ($request->is_ajax()) {
$json_response = new \phpbb\json_response();
$json_response->send(array('MESSAGE_TITLE' => $user->lang['INFORMATION'], 'MESSAGE_TEXT' => $notice, 'REFRESH_DATA' => array('time' => 3)));
}
示例14: _download_result
/**
* Download the MySQL Upgrader script
* @access private
* @return void
*/
function _download_result()
{
global $cache;
// Read from the cache
$result = $cache->get('_stk_mysql_upgrader_result');
if ($result === false) {
return;
}
// Write the file
header('Content-Type: text/x-delimtext; name="mysql_upgrader.sql"');
header('Content-disposition: attachment; filename=mysql_upgrader.sql');
print $result;
// Exit
garbage_collection();
exit_handler();
}
示例15: wpu_output_page
/**
* Does final clean-up of the integrated page, and sends it to the browser.
* @param string $content The fully integrated page.
*/
function wpu_output_page($content)
{
global $wpuNoHead, $wpu_page_title, $wpu_dtd, $wpuSetWPSignature;
//Add title back
$content = str_replace("<!--[**PAGE_TITLE**]-->", $wpu_page_title, $content);
//Add DTD if needed
if (isset($wpu_dtd)) {
$content = str_replace("<!--[**WP_DTD**]-->", $wpu_dtd, $content);
}
global $wpuDebug;
// Add login debugging if requested
if (defined('WPU_DEBUG') && WPU_DEBUG && !$wpuNoHead) {
$content = $wpuDebug->add_debug_box($content, 'login');
}
// Add stats if requested
if (defined('WPU_SHOW_STATS') && WPU_SHOW_STATS && !$wpuNoHead) {
$content = $wpuDebug->add_stats_box($content);
}
echo $content . $wpuSetWPSignature;
// Finally -- clean up
define('WPU_FINISHED', true);
garbage_collection();
exit_handler();
}