本文整理汇总了PHP中ext_exit函数的典型用法代码示例。如果您正苦于以下问题:PHP ext_exit函数的具体用法?PHP ext_exit怎么用?PHP ext_exit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ext_exit函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: explode
$json = new $classname();
echo $json->encode($response);
break;
case 'get_image':
require_once _EXT_PATH . "/include/view.php";
ext_View::sendImage($dir, $item);
case 'ftp_authentication':
case 'ssh2_authentication':
case 'extplorer_authentication':
$auth_info = explode('_', $action);
$auth_classname = 'ext_' . $action;
require_once _EXT_PATH . '/include/authentication/' . $auth_info[0] . '.php';
$auth_plugin = new $auth_classname();
$auth_plugin->onShowLoginForm();
break;
default:
require_once _EXT_PATH . "/include/list.php";
ext_List::execAction($dir);
//------------------------------------------------------------------------------
}
// end switch-statement
}
//------------------------------------------------------------------------------
// Disconnect from ftp server
if (ext_isFTPMode()) {
$GLOBALS['FTPCONNECTION']->disconnect();
}
// Empty the output buffer if this is a XMLHttpRequest
if (ext_isXHR()) {
ext_exit();
}
开发者ID:elevenfox,项目名称:VTree,代码行数:31,代码来源:admin.extplorer.php
示例2: execAction
//.........这里部分代码省略.........
}
$cnt_filelist = count($v_list);
// Now we go to the right range of files and "slice" the array
$v_list = array_slice($v_list, $startfrom, $files_per_step - 1);
$remove_path = $GLOBALS["home_dir"];
if ($dir) {
$remove_path .= $dir;
}
$remove_path = str_replace('\\', '/', realpath($remove_path)) . '/';
$debug = 'Starting from: ' . $startfrom . "\n";
$debug .= 'Files to process: ' . $cnt_filelist . "\n";
$debug .= implode("\n", $v_list);
//file_put_contents( 'log.txt', $debug, FILE_APPEND );
// Do some setup stuff
ini_set('memory_limit', '128M');
@set_time_limit(0);
//error_reporting( E_ERROR | E_PARSE );
$result = extArchive::create($archive_name, $v_list, $GLOBALS['__POST']["type"], '', $remove_path);
if (PEAR::isError($result)) {
ext_Result::sendResult('archive', false, $name . ': ' . ext_Lang::err('archive_creation_failed') . ' (' . $result->getMessage() . $archive_name . ')');
}
$classname = class_exists('ext_Json') ? 'ext_Json' : 'Services_JSON';
$json = new $classname();
if ($cnt_filelist > $startfrom + $files_per_step) {
$response = array('startfrom' => $startfrom + $files_per_step, 'totalitems' => $cnt_filelist, 'success' => true, 'action' => 'archive', 'message' => sprintf(ext_Lang::msg('processed_x_files'), $startfrom + $files_per_step, $cnt_filelist));
} else {
@unlink($dir_contents_cache_file);
if ($GLOBALS['__POST']["type"] == 'tgz' || $GLOBALS['__POST']["type"] == 'tbz') {
chmod($archive_name, 0644);
}
$response = array('action' => 'archive', 'success' => true, 'message' => ext_Lang::msg('archive_created'), 'newlocation' => ext_make_link('download', $dir, basename($archive_name)));
}
echo $json->encode($response);
ext_exit();
}
$default_archive_type = 'zip';
?>
{
"xtype": "form",
"id": "simpleform",
"height": "200",
"width": "350",
"labelWidth": 125,
"url":"<?php
echo basename($GLOBALS['script_name']);
?>
",
"dialogtitle": "<?php
echo $GLOBALS["messages"]["actarchive"];
?>
",
"frame": true,
"items": [{
"xtype": "textfield",
"fieldLabel": "<?php
echo ext_Lang::msg('archive_name', true);
?>
",
"name": "name",
"value": "<?php
echo $GLOBALS['item'] . '.' . $default_archive_type;
?>
",
"width": "200"
},
{
开发者ID:chajianku,项目名称:admin_eXtplorer,代码行数:67,代码来源:archive.php
示例3: execAction
//.........这里部分代码省略.........
$extension = 'msword';
break;
case 'docx':
case 'dotx':
$extension = 'vnd.openxmlformats-officedocument.wordprocessingml.template';
break;
case 'docm':
$extension = 'vnd.ms-word.document.macroEnabled.12';
break;
case 'docm':
$extension = 'vnd.ms-word.template.macroEnabled.12';
break;
case 'xls':
case 'xlt':
case 'xla':
$extension = 'vnd.ms-excel';
break;
case 'xlsx':
$extension = 'vnd.openxmlformats-officedocument.spreadsheetml.sheet';
break;
case 'xltx':
$extension = 'vnd.openxmlformats-officedocument.spreadsheetml.template';
break;
case 'xlsm':
$extension = 'vnd.ms-excel.sheet.macroEnabled.12';
break;
case 'xltm':
$extension = 'vnd.ms-excel.template.macroEnabled.12';
break;
case 'xlam':
$extension = 'vnd.ms-excel.addin.macroEnabled.12';
break;
case 'xlsb':
$extension = 'vnd.ms-excel.sheet.binary.macroEnabled.12';
break;
case 'ppt':
case 'pot':
case 'pps':
case 'ppa':
$extension = 'vnd.ms-powerpoint';
break;
case 'pptx':
$extension = 'vnd.openxmlformats-officedocument.presentationml.presentation';
break;
case 'potx':
$extension = 'vnd.openxmlformats-officedocument.presentationml.template';
break;
case 'ppsx':
$extension = 'vnd.openxmlformats-officedocument.presentationml.slideshow';
break;
case 'ppam':
$extension = 'vnd.ms-powerpoint.addin.macroEnabled.12';
break;
case 'pptm':
$extension = 'vnd.ms-powerpoint.presentation.macroEnabled.12';
break;
case 'potm':
$extension = 'vnd.ms-powerpoint.template.macroEnabled.12';
break;
case 'ppsm':
$extension = 'vnd.ms-powerpoint.slideshow.macroEnabled.12';
break;
case 'rtf':
$extension = 'application/rtf';
break;
}
header('Content-Type: application/' . $extension . '; Charset=' . $GLOBALS["system_charset"]);
} else {
$content_disposition = 'attachment';
if ($browser == 'IE' || $browser == 'OPERA') {
header('Content-Type: application/octetstream; Charset=' . $GLOBALS["system_charset"]);
} else {
header('Content-Type: application/octet-stream; Charset=' . $GLOBALS["system_charset"]);
}
}
if ($browser == 'IE') {
// http://support.microsoft.com/kb/436616/ja
header('Content-Disposition: ' . $content_disposition . '; filename="' . urlencode($item) . '"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Content-Disposition: ' . $content_disposition . '; filename="' . $item . '"');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
}
if ($GLOBALS['use_mb']) {
if (mb_detect_encoding($abs_item) == 'ASCII') {
@readFileChunked(utf8_decode($abs_item));
} else {
@readFileChunked($abs_item);
}
} else {
@readFileChunked(utf8_decode($abs_item));
}
if ($unlink == true) {
unlink(utf8_decode($abs_item));
}
ob_end_flush();
ext_exit();
}
开发者ID:chajianku,项目名称:admin_eXtplorer,代码行数:101,代码来源:download.php
示例4: send_dircontents
//.........这里部分代码省略.........
}
$list = $output_array;
}
while (list($item, $info) = each($list)) {
// link to dir / file
if (is_array($info)) {
$abs_item = $info;
if (extension_loaded('posix')) {
$user_info = posix_getpwnam($info['user']);
$file_info['uid'] = $user_info['uid'];
$file_info['gid'] = $user_info['gid'];
}
} else {
$abs_item = get_abs_item(ext_TextEncoding::fromUTF8($dir), $item);
$file_info = @stat($abs_item);
}
$is_dir = get_is_dir($abs_item);
if ($GLOBALS['use_mb']) {
if (ext_isFTPMode()) {
$items['items'][$i]['name'] = $item;
} else {
if (mb_detect_encoding($item) == 'ASCII') {
$items['items'][$i]['name'] = ext_TextEncoding::toUTF8($item);
} else {
$items['items'][$i]['name'] = ext_TextEncoding::toUTF8($item);
}
}
} else {
$items['items'][$i]['name'] = ext_isFTPMode() ? $item : ext_TextEncoding::toUTF8($item);
}
$items['items'][$i]['is_file'] = get_is_file($abs_item);
$items['items'][$i]['is_archive'] = ext_isArchive($item) && !ext_isFTPMode();
$items['items'][$i]['is_writable'] = $is_writable = @$GLOBALS['ext_File']->is_writable($abs_item);
$items['items'][$i]['is_chmodable'] = $is_chmodable = @$GLOBALS['ext_File']->is_chmodable($abs_item);
$items['items'][$i]['is_readable'] = $is_readable = @$GLOBALS['ext_File']->is_readable($abs_item);
$items['items'][$i]['is_deletable'] = $is_deletable = @$GLOBALS['ext_File']->is_deletable($abs_item);
$items['items'][$i]['is_editable'] = get_is_editable($abs_item);
$items['items'][$i]['icon'] = _EXT_URL . "/images/" . get_mime_type($abs_item, "img");
$items['items'][$i]['size'] = parse_file_size(get_file_size($abs_item));
// type
$items['items'][$i]['type'] = get_mime_type($abs_item, "type");
// modified
$items['items'][$i]['modified'] = parse_file_date(get_file_date($abs_item));
// permissions
$perms = get_file_perms($abs_item);
if ($perms) {
if (strlen($perms) > 3) {
$perms = substr($perms, 2);
}
$items['items'][$i]['perms'] = $perms . ' (' . parse_file_perms($perms) . ')';
} else {
$items['items'][$i]['perms'] = ' (unknown) ';
}
$items['items'][$i]['perms'] = $perms . ' (' . parse_file_perms($perms) . ')';
if (extension_loaded("posix")) {
if ($file_info["uid"]) {
$user_info = posix_getpwuid($file_info["uid"]);
//$group_info = posix_getgrgid($file_info["gid"]);
$items['items'][$i]['owner'] = $user_info["name"] . " (" . $file_info["uid"] . ")";
} else {
$items['items'][$i]['owner'] = " (unknown) ";
}
} else {
$items['items'][$i]['owner'] = 'n/a';
}
if ($is_dir && $sendWhat != 'files') {
$id = str_replace('/', $GLOBALS['separator'], $dir) . $GLOBALS['separator'] . $item;
$id = str_replace($GLOBALS['separator'], '_RRR_', $id);
$qtip = "<strong>" . ext_Lang::mime('dir', true) . "</strong><br /><strong>" . ext_Lang::msg('miscperms', true) . ":</strong> " . $perms . "<br />";
$qtip .= '<strong>' . ext_Lang::msg('miscowner', true) . ':</strong> ' . $items['items'][$i]['owner'];
if ($GLOBALS['use_mb']) {
if (ext_isFTPMode()) {
$dirlist[] = array('text' => htmlspecialchars($item), 'id' => $id, 'qtip' => $qtip, 'is_writable' => $is_writable, 'is_chmodable' => $is_chmodable, 'is_readable' => $is_readable, 'is_deletable' => $is_deletable, 'cls' => 'folder');
} else {
if (mb_detect_encoding($item) == 'ASCII') {
$dirlist[] = array('text' => htmlspecialchars(ext_TextEncoding::toUTF8($item)), 'id' => utf8_encode($id), 'qtip' => $qtip, 'is_writable' => $is_writable, 'is_chmodable' => $is_chmodable, 'is_readable' => $is_readable, 'is_deletable' => $is_deletable, 'cls' => 'folder');
} else {
$dirlist[] = array('text' => htmlspecialchars($item), 'id' => $id, 'qtip' => $qtip, 'is_writable' => $is_writable, 'is_chmodable' => $is_chmodable, 'is_readable' => $is_readable, 'is_deletable' => $is_deletable, 'cls' => 'folder');
}
}
} else {
$dirlist[] = array('text' => htmlspecialchars(ext_isFTPMode() ? $item : ext_TextEncoding::toUTF8($item)), 'id' => ext_isFTPMode() ? $id : ext_TextEncoding::toUTF8($id), 'qtip' => $qtip, 'is_writable' => $is_writable, 'is_chmodable' => $is_chmodable, 'is_readable' => $is_readable, 'is_deletable' => $is_deletable, 'cls' => 'folder');
}
}
if (!$is_dir && $sendWhat == 'files' || $sendWhat == 'both') {
$i++;
}
}
while (@ob_end_clean()) {
}
if ($sendWhat == 'dirs') {
$result = $dirlist;
} else {
$result = $items;
}
$classname = class_exists('ext_Json') ? 'ext_Json' : 'Services_JSON';
$json = new $classname();
echo $json->encode($result);
ext_exit();
}
开发者ID:kostya1017,项目名称:our,代码行数:101,代码来源:list.php
示例5: execAction
function execAction($dir, $item, $unlink = false)
{
// download file
global $action, $mosConfig_cache_path;
// Security Fix:
$item = basename($item);
while (@ob_end_clean()) {
}
ob_start();
if (ext_isFTPMode()) {
$abs_item = $dir . '/' . $item;
} else {
$abs_item = get_abs_item($dir, $item);
//if( !strstr( $abs_item, $GLOBALS['home_dir']) )
// $abs_item = realpath($GLOBALS['home_dir']).$abs_item;
}
if (($GLOBALS["permissions"] & 01) != 01) {
ext_Result::sendResult('download', false, $GLOBALS["error_msg"]["accessfunc"]);
}
if (!$GLOBALS['ext_File']->file_exists($abs_item)) {
ext_Result::sendResult('download', false, $item . ": " . $GLOBALS["error_msg"]["fileexist"]);
}
if (!get_show_item($dir, $item)) {
ext_Result::sendResult('download', false, $item . ": " . $GLOBALS["error_msg"]["accessfile"]);
}
if (ext_isFTPMode()) {
$abs_item = ext_ftp_make_local_copy($abs_item);
$unlink = true;
}
$browser = id_browser();
header('Content-Type: ' . ($browser == 'IE' || $browser == 'OPERA' ? 'application/octetstream' : 'application/octet-stream'));
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize(realpath($abs_item)));
//header("Content-Encoding: none");
if ($browser == 'IE') {
header('Content-Disposition: attachment; filename="' . $item . '"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Content-Disposition: attachment; filename="' . $item . '"');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
}
@set_time_limit(0);
@readFileChunked(utf8_decode($abs_item));
if ($unlink == true) {
unlink(utf8_decode($abs_item));
}
ob_end_flush();
ext_exit();
}
开发者ID:BACKUPLIB,项目名称:mwenhanced,代码行数:52,代码来源:download.php
示例6: sendResult
static function sendResult($action, $success, $msg, $extra = array())
{
// show error-message
if (ext_isXHR()) {
$success = (bool) $success;
if ($success && ext_Result::count_errors() > 0) {
$success = false;
foreach (@$_SESSION['ext_error'] as $type) {
if (is_array($type)) {
foreach ($type as $error) {
$msg .= '<br />' . $error;
}
}
}
}
$result = array('action' => $action, 'message' => str_replace("'", "\\'", $msg), 'error' => str_replace("'", "\\'", $msg), 'success' => $success);
foreach ($extra as $key => $value) {
$result[$key] = $value;
}
$classname = class_exists('ext_Json') ? 'ext_Json' : 'Services_JSON';
$json = new $classname();
$jresult = $json->encode($result);
if (strtolower(extGetParam($_POST, 'requestType')) == 'xmlhttprequest') {
header("Content-type: text/html");
}
print $jresult;
ext_exit();
}
$messagetxt = '';
if ($extra != NULL) {
$msg .= " - " . $extra;
}
if ($msg != '') {
ext_Result::add_error($msg);
}
if (ext_Result::count_messages() < 1 && ext_Result::count_errors() < 1) {
return;
}
if (ext_Result::count_messages() > 0) {
$messagetxt .= '<h3>' . $GLOBALS["error_msg"]["message"] . ':</h3>';
foreach ($_SESSION['ext_message'] as $msgtype) {
foreach ($msgtype as $message) {
$messagetxt .= $message . '<br/>';
}
$messagetxt .= '<br /><hr /><br />';
}
ext_Result::empty_messages();
if (!empty($_REQUEST['extra'])) {
$messagetxt .= ' - ' . htmlspecialchars(urldecode($_REQUEST['extra']), ENT_QUOTES);
}
}
if (!empty($_SESSION['ext_error'])) {
$messagetxt .= '<h3>' . $GLOBALS["error_msg"]["error"] . ':</h3>';
foreach ($_SESSION['ext_error'] as $errortype) {
foreach ($errortype as $error) {
$messagetxt .= $error . '<br/>';
}
$messagetxt .= '<br /><hr /><br />';
}
ext_Result::empty_errors();
}
if (!empty($_REQUEST['extra'])) {
$messagetxt .= " - " . htmlspecialchars(urldecode($_REQUEST['extra']), ENT_QUOTES);
}
extHTML::loadExtJS();
show_header();
defined('EXPLORER_NOEXEC') or define('EXPLORER_NOEXEC', 1);
echo ext_scriptTag('', 'Ext.Msg.alert(\'Status\', \'' . $messagetxt . '\')');
//}
$GLOBALS['action'] = 'show_error';
}
开发者ID:kostya1017,项目名称:our,代码行数:71,代码来源:result.class.php
示例7: execAction
//.........这里部分代码省略.........
}
$v_list = explode("\n", $file_list_string);
}
$cnt_filelist = count($v_list);
// Now we go to the right range of files and "slice" the array
$v_list = array_slice($v_list, $startfrom, $files_per_step - 1);
$remove_path = $GLOBALS["home_dir"];
if ($dir) {
$remove_path .= $dir;
}
$debug = 'Starting from: ' . $startfrom . "\n";
$debug .= 'Files to process: ' . $cnt_filelist . "\n";
$debug .= implode("\n", $v_list);
//file_put_contents( 'log.txt', $debug, FILE_APPEND );
// Do some setup stuff
ini_set('memory_limit', '128M');
@set_time_limit(0);
error_reporting(E_ERROR | E_PARSE);
$result = extArchive::create($archive_name, $v_list, $GLOBALS['__POST']["type"], '', $remove_path);
if (PEAR::isError($result)) {
ext_Result::sendResult('archive', false, $name . ': ' . ext_Lang::err('archive_creation_failed') . ' (' . $result->getMessage() . $archive_name . ')');
}
$json = new ext_Json();
if ($cnt_filelist > $startfrom + $files_per_step) {
$response = array('startfrom' => $startfrom + $files_per_step, 'totalitems' => $cnt_filelist, 'success' => true, 'action' => 'archive', 'message' => sprintf(ext_Lang::msg('processed_x_files'), $startfrom + $files_per_step, $cnt_filelist));
} else {
@unlink($dir_contents_cache_file);
if ($GLOBALS['__POST']["type"] == 'tgz' || $GLOBALS['__POST']["type"] == 'tbz') {
chmod($archive_name, 0644);
}
$response = array('action' => 'archive', 'success' => true, 'message' => ext_Lang::msg('archive_created'), 'newlocation' => make_link('download', $dir, basename($archive_name)));
}
echo $json->encode($response);
ext_exit();
}
?>
<div style="width:auto;">
<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
<h3 style="margin-bottom:5px;"><?php
echo $GLOBALS["messages"]["actarchive"];
?>
</h3>
<div id="adminForm"></div>
</div></div></div>
<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
</div>
<script type="text/javascript">
var comprTypes = new Ext.data.SimpleStore({
fields: ['type', 'typename'],
data : [
['zip', 'Zip (<?php
echo ext_Lang::msg('normal_compression', true);
?>
)'],
['tgz', 'Tar/Gz (<?php
echo ext_Lang::msg('good_compression', true);
?>
)'],
<?php
if (extension_loaded("bz2")) {
echo "['tbz', 'Tar/Bzip2 (" . ext_Lang::msg('best_compression', true) . ")'],";
}
?>
开发者ID:shamblett,项目名称:janitor,代码行数:67,代码来源:archive.php
示例8: sendResult
function sendResult($action, $success, $msg, $extra = array())
{
// show error-message
if (ext_isXHR()) {
$success = (bool) $success;
if ($success && ext_Result::count_errors() > 0) {
$success = false;
foreach (@$_SESSION['ext_error'] as $type) {
if (is_array($type)) {
foreach ($type as $error) {
$msg .= '<br >' . $error;
}
}
}
}
$result = array('action' => $action, 'message' => str_replace("'", "\\'", $msg), 'error' => str_replace("'", "\\'", $msg), 'success' => $success);
foreach ($extra as $key => $value) {
$result[$key] = $value;
}
$json = new ext_Json();
$jresult = $json->encode($result);
print $jresult;
ext_exit();
}
if ($extra != NULL) {
$msg .= " - " . $extra;
}
ext_Result::add_error($msg);
if (empty($_GET['error'])) {
session_write_close();
extRedirect(make_link("show_error", $GLOBALS["dir"], null, null, null, null, '&error=1&extra=' . urlencode($extra)));
} else {
show_header($GLOBALS["error_msg"]["error"]);
echo '<div class="quote">';
echo '<a href="#errors">' . ext_Result::count_errors() . ' ' . $GLOBALS["error_msg"]["error"] . '</a>, ';
echo '<a href="#messages">' . ext_Result::count_messages() . ' ' . $GLOBALS["error_msg"]["message"] . '</a><br />';
echo "</div>\n";
if (!empty($_SESSION['ext_message'])) {
echo "<a href=\"" . str_replace('&dir=', '&ignore=', make_link("list", '')) . "\">[ " . $GLOBALS["error_msg"]["back"] . " ]</a>";
echo "<div class=\"ext_message\"><a name=\"messages\"></a>\n\t\t\t\t\t\t<h3>" . $GLOBALS["error_msg"]["message"] . ":</strong>" . "</h3>\n";
foreach ($_SESSION['ext_message'] as $msgtype) {
foreach ($msgtype as $message) {
echo $message . "\n<br/>";
}
echo '<br /><hr /><br />';
}
ext_Result::empty_messages();
if (!empty($_REQUEST['extra'])) {
echo " - " . htmlspecialchars(urldecode($_REQUEST['extra']), ENT_QUOTES);
}
echo "</div>\n";
}
if (!empty($_SESSION['ext_error'])) {
echo "<div class=\"ext_error\"><a name=\"errors\"></a>\n\t\t\t\t\t\t<h3>" . $GLOBALS["error_msg"]["error"] . ":</strong>" . "</h3>\n";
foreach ($_SESSION['ext_error'] as $errortype) {
foreach ($errortype as $error) {
echo $error . "\n<br/>";
}
echo '<br /><hr /><br />';
}
ext_Result::empty_errors();
}
echo "<a href=\"" . str_replace('&dir=', '&ignore=', make_link("list", '')) . "\">" . $GLOBALS["error_msg"]["back"] . "</a>";
if (!empty($_REQUEST['extra'])) {
echo " - " . htmlspecialchars(urldecode($_REQUEST['extra']), ENT_QUOTES);
}
echo "</div>\n";
defined('EXPLORER_NOEXEC') or define('EXPLORER_NOEXEC', 1);
}
}
开发者ID:shamblett,项目名称:janitor,代码行数:70,代码来源:result.class.php
注:本文中的ext_exit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论