本文整理汇总了PHP中Context::close方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::close方法的具体用法?PHP Context::close怎么用?PHP Context::close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Context
的用法示例。
在下文中一共展示了Context::close方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dispInstallIntroduce
/**
* @brief Display license messages
*/
function dispInstallIntroduce()
{
$install_config_file = FileHandler::getRealPath('./config/install.config.php');
if (file_exists($install_config_file)) {
include $install_config_file;
if (is_array($install_config)) {
foreach ($install_config as $k => $v) {
$v = $k == 'db_table_prefix' ? $v . '_' : $v;
Context::set($k, $v, true);
}
unset($GLOBALS['__DB__']);
Context::set('install_config', true, true);
$oInstallController = getController('install');
$output = $oInstallController->procInstall();
if (!$output->toBool()) {
return $output;
}
header("location: ./");
Context::close();
exit;
}
}
Context::set('l', Context::getLangType());
$this->setTemplateFile('introduce');
}
示例2: printContent
function printContent($content)
{
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
print $content;
Context::close();
exit;
}
示例3: alertMsg
function alertMsg($message)
{
//입력된 메세지 없으면 리턴
if (!$message) {
return;
}
header("Content-Type: text/html; charset=UTF-8");
//헤더설정 직접 해주거나(한글인코딩) 아래주석 제거하거나 선택적 사용
//htmlHeader();
alertScript($message);
echo '<script type="text/javascript">history.back()</script>';
//htmlFooter();
Context::close();
exit;
}
示例4: dispInstallIntroduce
/**
* @brief Display license messages
*/
function dispInstallIntroduce()
{
$install_config_file = FileHandler::getRealPath('./config/install.config.php');
if (file_exists($install_config_file)) {
/**
* If './config/install.config.php' file created and write array shown in the example below, XE installed using config file.
* ex )
$install_config = array(
'db_type' =>'mysqli_innodb',
'db_port' =>'3306',
'db_hostname' =>'localhost',
'db_userid' =>'root',
'db_password' =>'root',
'db_database' =>'rx_database',
'db_table_prefix' =>'rx',
'user_rewrite' =>'N',
'time_zone' =>'0000',
'email_address' =>'admin@admin.net',
'password' =>'pass',
'password2' =>'pass',
'nick_name' =>'admin',
'user_id' =>'admin',
'lang_type' =>'ko', // en, jp, ...
);
*/
include $install_config_file;
if (is_array($install_config)) {
foreach ($install_config as $k => $v) {
$v = $k == 'db_table_prefix' ? $v . '_' : $v;
Context::set($k, $v, true);
}
unset($GLOBALS['__DB__']);
Context::set('install_config', true, true);
$oInstallController = getController('install');
$output = $oInstallController->procInstall();
if (!$output->toBool()) {
return $output;
}
header("location: ./");
Context::close();
exit;
}
}
Context::set('l', Context::getLangType());
return $this->dispInstallLicenseAgreement();
//$this->setTemplateFile('introduce');
}
示例5: ModuleHandler
/**
* prepares variables to use in moduleHandler
* @param string $module name of module
* @param string $act name of action
* @param int $mid
* @param int $document_srl
* @param int $module_srl
* @return void
**/
function ModuleHandler($module = '', $act = '', $mid = '', $document_srl = '', $module_srl = '')
{
// If XE has not installed yet, set module as install
if (!Context::isInstalled()) {
$this->module = 'install';
$this->act = Context::get('act');
return;
}
// Set variables from request arguments
$this->module = $module ? $module : Context::get('module');
$this->act = $act ? $act : Context::get('act');
$this->mid = $mid ? $mid : Context::get('mid');
$this->document_srl = $document_srl ? (int) $document_srl : (int) Context::get('document_srl');
$this->module_srl = $module_srl ? (int) $module_srl : (int) Context::get('module_srl');
$this->entry = Context::convertEncodingStr(Context::get('entry'));
// Validate variables to prevent XSS
$isInvalid = null;
if ($this->module && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->module)) {
$isInvalid = true;
}
if ($this->mid && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->mid)) {
$isInvalid = true;
}
if ($this->act && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->act)) {
$isInvalid = true;
}
if ($isInvalid) {
htmlHeader();
echo Context::getLang("msg_invalid_request");
htmlFooter();
Context::close();
exit;
}
if (isset($this->act) && substr($this->act, 0, 4) == 'disp') {
if (Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && $_SERVER['HTTPS'] != 'on') {
header('location:https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
return;
}
}
// execute addon (before module initialization)
$called_position = 'before_module_init';
$oAddonController =& getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? 'mobile' : 'pc');
@(include $addon_file);
}
示例6: getWikiTreeList
/**
* @brief 계층구조 추출
* document_category테이블을 이용해서 위키 문서의 계층 구조도를 그림
* document_category테이블에 등록되어 있지 않은 경우 depth = 0 으로 하여 신규 생성
**/
function getWikiTreeList()
{
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
$oModuleModel =& getModel('module');
$mid = Context::get('mid');
$cache_file = sprintf('%sfiles/cache/wiki/%d.xml', _XE_PATH_, $this->module_srl);
if ($this->grant->write_document || !file_exists($cache_file)) {
FileHandler::writeFile($cache_file, $this->loadWikiTreeList($this->module_srl));
}
print FileHandler::readFile($cache_file);
Context::close();
exit;
}
示例7: procTrackbackSend
/**
* Trackbacks sent
* @return object
*/
function procTrackbackSend()
{
// Yeokingeul to post numbers and shipping addresses Wanted
$document_srl = Context::get('target_srl');
$trackback_url = Context::get('trackback_url');
$charset = Context::get('charset');
if (!$document_srl || !$trackback_url || !$charset) {
return new Object(-1, 'msg_invalid_request');
}
// Login Information Wanted
$logged_info = Context::get('logged_info');
if (!$logged_info->member_srl) {
return new Object(-1, 'msg_not_permitted');
}
// Posts of the information obtained permission to come and check whether
$oDocumentModel =& getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
if (!$oDocument->isExists() || !$oDocument->getSummary()) {
return new Object(-1, 'msg_invalid_request');
}
if ($oDocument->getMemberSrl() != $logged_info->member_srl) {
return new Object(-1, 'msg_not_permitted');
}
// Specify the title of the module, the current article
$oModuleModel =& getModel('module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl'));
Context::setBrowserTitle($module_info->browser_title);
// Shipping yeokingeul
$output = $this->sendTrackback($oDocument, $trackback_url, $charset);
if ($output->toBool() && !in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
global $lang;
htmlHeader();
alertScript($lang->success_registed);
reload(true);
closePopupScript();
htmlFooter();
Context::close();
exit;
}
return $output;
}
示例8: procLayoutAdminUserLayoutExport
/**
* @brief faceoff export
*
**/
function procLayoutAdminUserLayoutExport()
{
$layout_srl = Context::get('layout_srl');
if (!$layout_srl) {
return new Object('-1', 'msg_invalid_request');
}
require_once _XE_PATH_ . 'libs/tar.class.php';
// 압축할 파일 목록을 가져온다
$oLayoutModel =& getModel('layout');
$file_list = $oLayoutModel->getUserLayoutFileList($layout_srl);
// 압축을 한다.
$tar = new tar();
$user_layout_path = FileHandler::getRealPath($oLayoutModel->getUserLayoutPath($layout_srl));
chdir($user_layout_path);
$replace_path = getNumberingPath($layout_srl, 3);
foreach ($file_list as $key => $file) {
$tar->addFile($file, $replace_path, '__LAYOUT_PATH__');
}
$stream = $tar->toTarStream();
$filename = 'faceoff_' . date('YmdHis') . '.tar';
header("Cache-Control: ");
header("Pragma: ");
header("Content-Type: application/x-compressed");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// header("Content-Length: " .strlen($stream)); ?? why??
header('Content-Disposition: attachment; filename="' . $filename . '"');
header("Content-Transfer-Encoding: binary\n");
echo $stream;
// Context를 강제로 닫고 종료한다.
Context::close();
exit;
}
示例9: procModuleAdminModuleGrantSetup
/**
* @brief List permissions of the module
*/
function procModuleAdminModuleGrantSetup()
{
$module_srls = Context::get('module_srls');
if (!$module_srls) {
return new Object(-1, 'msg_invalid_request');
}
$modules = explode(',', $module_srls);
if (count($modules) < 1) {
return new Object(-1, 'msg_invalid_request');
}
$oModuleController = getController('module');
$oModuleModel = getModel('module');
$columnList = array('module_srl', 'module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0], $columnList);
$xml_info = $oModuleModel->getModuleActionXml($module_info->module);
$grant_list = $xml_info->grant;
$grant_list->access = new stdClass();
$grant_list->access->default = 'guest';
$grant_list->manager = new stdClass();
$grant_list->manager->default = 'manager';
$grant = new stdClass();
foreach ($grant_list as $grant_name => $grant_info) {
// Get the default value
$default = Context::get($grant_name . '_default');
// -1 = Sign only, 0 = all users
$grant->{$grant_name} = array();
if (strlen($default)) {
$grant->{$grant_name}[] = $default;
continue;
// Users in a particular group
} else {
$group_srls = Context::get($grant_name);
if ($group_srls) {
if (!is_array($group_srls)) {
if (strpos($group_srls, '|@|') !== false) {
$group_srls = explode('|@|', $group_srls);
} elseif (strpos($group_srls, ',') !== false) {
$group_srls = explode(',', $group_srls);
} else {
$group_srls = array($group_srls);
}
}
$grant->{$grant_name} = $group_srls;
}
continue;
}
$grant->{$group_srls} = array();
// dead code, too??
}
// Stored in the DB
foreach ($modules as $module_srl) {
$args = new stdClass();
$args->module_srl = $module_srl;
$output = executeQuery('module.deleteModuleGrants', $args);
if (!$output->toBool()) {
continue;
}
// Permissions stored in the DB
foreach ($grant as $grant_name => $group_srls) {
foreach ($group_srls as $val) {
$args = new stdClass();
$args->module_srl = $module_srl;
$args->name = $grant_name;
$args->group_srl = $val;
$output = executeQuery('module.insertModuleGrant', $args);
if (!$output->toBool()) {
return $output;
}
}
}
}
$this->setMessage('success_registed');
if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
if (Context::get('success_return_url')) {
$this->setRedirectUrl(Context::get('success_return_url'));
} else {
global $lang;
htmlHeader();
alertScript($lang->success_registed);
closePopupScript();
htmlFooter();
Context::close();
exit;
}
}
}
示例10: before_module_init_captchaCompare
function before_module_init_captchaCompare()
{
if (!$this->compareCaptcha()) {
return false;
}
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
print "<response>\r\n<error>0</error>\r\n<message>success</message>\r\n</response>";
Context::close();
exit;
}
示例11: procFileDownload
//.........这里部分代码省略.........
if ($referer['host'] != $_SERVER['HTTP_HOST']) {
if ($file_module_config->allow_outlink_site) {
$allow_outlink_site_array = array();
$allow_outlink_site_array = explode("\n", $file_module_config->allow_outlink_site);
if (!is_array($allow_outlink_site_array)) {
$allow_outlink_site_array[0] = $file_module_config->allow_outlink_site;
}
foreach ($allow_outlink_site_array as $val) {
$site = parse_url(trim($val));
if ($site['host'] == $referer['host']) {
$file_module_config->allow_outlink = 'Y';
break;
}
}
}
} else {
$file_module_config->allow_outlink = 'Y';
}
}
if ($file_module_config->allow_outlink != 'Y') {
return $this->stop('msg_not_allowed_outlink');
}
}
// Check if a permission for file download is granted
$downloadGrantCount = 0;
if (is_array($file_module_config->download_grant)) {
foreach ($file_module_config->download_grant as $value) {
if ($value) {
$downloadGrantCount++;
}
}
}
if (is_array($file_module_config->download_grant) && $downloadGrantCount > 0) {
if (!Context::get('is_logged')) {
return $this->stop('msg_not_permitted_download');
}
$logged_info = Context::get('logged_info');
if ($logged_info->is_admin != 'Y') {
$oModuleModel =& getModel('module');
$columnList = array('module_srl', 'site_srl');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($file_obj->module_srl, $columnList);
if (!$oModuleModel->isSiteAdmin($logged_info, $module_info->site_srl)) {
$oMemberModel =& getModel('member');
$member_groups = $oMemberModel->getMemberGroups($logged_info->member_srl, $module_info->site_srl);
$is_permitted = false;
for ($i = 0; $i < count($file_module_config->download_grant); $i++) {
$group_srl = $file_module_config->download_grant[$i];
if ($member_groups[$group_srl]) {
$is_permitted = true;
break;
}
}
if (!$is_permitted) {
return $this->stop('msg_not_permitted_download');
}
}
}
}
// Call a trigger (before)
$output = ModuleHandler::triggerCall('file.downloadFile', 'before', $file_obj);
if (!$output->toBool()) {
return $this->stop($output->message ? $output->message : 'msg_not_permitted_download');
}
// File Output
if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
$filename = rawurlencode($filename);
$filename = preg_replace('/\\./', '%2e', $filename, substr_count($filename, '.') - 1);
}
$uploaded_filename = $file_obj->uploaded_filename;
if (!file_exists($uploaded_filename)) {
return $this->stop('msg_file_not_found');
}
$fp = fopen($uploaded_filename, 'rb');
if (!$fp) {
return $this->stop('msg_file_not_found');
}
header("Cache-Control: ");
header("Pragma: ");
header("Content-Type: application/octet-stream");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Content-Length: " . (string) $file_obj->file_size);
header('Content-Disposition: attachment; filename="' . $filename . '"');
header("Content-Transfer-Encoding: binary\n");
// if file size is lager than 10MB, use fread function (#18675748)
if (filesize($uploaded_filename) > 1024 * 1024) {
while (!feof($fp)) {
echo fread($fp, 1024);
}
fclose($fp);
} else {
fpassthru($fp);
}
// Increase download_count
$args->file_srl = $file_srl;
executeQuery('file.updateFileDownloadCount', $args);
// Call a trigger (after)
$output = ModuleHandler::triggerCall('file.downloadFile', 'after', $file_obj);
Context::close();
exit;
}
示例12: returnPage
function returnPage($query = null)
{
$js = $this->session->getSession('js');
$skin = $this->session->getSession('widget_skin');
$mode = $this->session->getSession('mode');
$info = $this->session->getSession('info');
// 쿼리가 파라미터로 넘어왔으면 사용하고 아니면 세션을 사용
if (empty($query)) {
$query = $this->session->getSession('callback_query');
}
// 로그인되어 있지 않고, 로그인되어 있다면 소셜 정보 통합 기능을 사용하지 않을 때만 세션을 전송한다.
$is_logged = Context::get('is_logged');
if (!$mode && (!$is_logged || $is_logged && $this->config->use_social_info != 'Y')) {
$this->communicator->sendSession();
}
// 로그인에 사용되는 세션을 지운다.
$this->session->clearSession('js');
$this->session->clearSession('mode');
$this->session->clearSession('callback_query');
$this->session->clearSession('widget_skin');
// JS 사용이면 창을 닫는다.
if ($js) {
Context::set('skin', $skin);
Context::set('info', $info);
$template_path = sprintf("%stpl/", $this->module_path);
$this->setTemplatePath($template_path);
$this->setTemplateFile('completeLogin');
return;
}
// XE주소
$url = Context::getRequestUri();
// SSL 항상 사용이 아니면 https를 http로 변경.
// if(Context::get('_use_ssl') != 'always') {
// $url = str_replace('https', 'http', $url);
// }
// 쿼리가 있으면 붙인다.
if ($query) {
if (strpos($query, 'http') !== false) {
$url = urldecode($query);
} else {
$url .= '?' . urldecode($query);
}
}
header('Location: ' . $url);
Context::close();
exit;
}
示例13: close
function close()
{
Context::close();
exit;
}
示例14: procCommunicationAddFriendGroup
/**
* Add a group of friends
* @return void|Object (success : void, fail : Object)
**/
function procCommunicationAddFriendGroup()
{
// Check login information
if (!Context::get('is_logged')) {
return new Object(-1, 'msg_not_logged');
}
$logged_info = Context::get('logged_info');
// Variables
$args->friend_group_srl = trim(Context::get('friend_group_srl'));
$args->member_srl = $logged_info->member_srl;
$args->title = Context::get('title');
$args->title = htmlspecialchars($args->title);
if (!$args->title) {
return new Object(-1, 'msg_invalid_request');
}
// modify if friend_group_srl exists.
if ($args->friend_group_srl) {
$output = executeQuery('communication.renameFriendGroup', $args);
$msg_code = 'success_updated';
// add if not exists
} else {
$output = executeQuery('communication.addFriendGroup', $args);
$msg_code = 'success_registed';
}
if (!$output->toBool()) {
if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
global $lang;
htmlHeader();
alertScript($lang->fail_to_registed);
closePopupScript();
htmlFooter();
Context::close();
exit;
} else {
return $output;
}
} else {
if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
global $lang;
htmlHeader();
alertScript($lang->success_registed);
reload(true);
closePopupScript();
htmlFooter();
Context::close();
exit;
} else {
$this->setMessage($msg_code);
}
}
}
示例15: procMemberAdminUpdateMembersGroup
/**
* Update a group of selected memebrs
* @return void|Object (void : success, Object : fail)
*/
function procMemberAdminUpdateMembersGroup()
{
$member_srl = Context::get('member_srl');
if (!$member_srl) {
return new Object(-1, 'msg_invalid_request');
}
$member_srls = explode(',', $member_srl);
$group_srl = Context::get('group_srls');
if (!is_array($group_srl)) {
$group_srls = explode('|@|', $group_srl);
} else {
$group_srls = $group_srl;
}
$oDB =& DB::getInstance();
$oDB->begin();
// Delete a group of selected members
$args = new stdClass();
$args->member_srl = $member_srl;
$output = executeQuery('member.deleteMembersGroup', $args);
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
// Add to a selected group
$group_count = count($group_srls);
$member_count = count($member_srls);
for ($j = 0; $j < $group_count; $j++) {
$group_srl = (int) trim($group_srls[$j]);
if (!$group_srl) {
continue;
}
for ($i = 0; $i < $member_count; $i++) {
$member_srl = (int) trim($member_srls[$i]);
if (!$member_srl) {
continue;
}
$args = new stdClass();
$args->member_srl = $member_srl;
$args->group_srl = $group_srl;
$output = executeQuery('member.addMemberToGroup', $args);
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
}
}
$oDB->commit();
$this->_deleteMemberGroupCache();
$this->setMessage('success_updated');
if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
global $lang;
htmlHeader();
alertScript($lang->success_updated);
reload(true);
closePopupScript();
htmlFooter();
Context::close();
exit;
}
}