本文整理汇总了PHP中Context::isInstalled方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::isInstalled方法的具体用法?PHP Context::isInstalled怎么用?PHP Context::isInstalled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Context
的用法示例。
在下文中一共展示了Context::isInstalled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: triggerRssUrlInsert
/**
* Check whether to use RSS rss url by adding
*
* @return Object
*/
function triggerRssUrlInsert()
{
$oModuleModel = getModel('module');
$total_config = $oModuleModel->getModuleConfig('rss');
$current_module_srl = Context::get('module_srl');
$site_module_info = Context::get('site_module_info');
if (is_array($current_module_srl)) {
unset($current_module_srl);
}
if (!$current_module_srl) {
$current_module_info = Context::get('current_module_info');
$current_module_srl = $current_module_info->module_srl;
}
if (!$current_module_srl) {
return new Object();
}
// Imported rss settings of the selected module
$oRssModel = getModel('rss');
$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
if ($rss_config->open_rss != 'N') {
Context::set('rss_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'rss'));
Context::set('atom_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'atom'));
}
if (Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N') {
if (Context::isAllowRewrite() && !Context::get('vid')) {
$request_uri = Context::getRequestUri();
Context::set('general_rss_url', $request_uri . 'rss');
Context::set('general_atom_url', $request_uri . 'atom');
} else {
Context::set('general_rss_url', getUrl('', 'module', 'rss', 'act', 'rss'));
Context::set('general_atom_url', getUrl('', 'module', 'rss', 'act', 'atom'));
}
}
return new Object();
}
示例2: member
/**
* constructor
*
* @return void
**/
function member()
{
if (!Context::isInstalled()) {
return;
}
$oModuleModel =& getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
// Set to use SSL upon actions related member join/information/password and so on
if (Context::get('_use_ssl') == 'optional') {
Context::addSSLAction('dispMemberModifyPassword');
Context::addSSLAction('dispMemberSignUpForm');
Context::addSSLAction('dispMemberModifyInfo');
Context::addSSLAction('dispMemberModifyEmailAddress');
Context::addSSLAction('dispMemberGetTempPassword');
Context::addSSLAction('dispMemberResendAuthMail');
Context::addSSLAction('dispMemberLoginForm');
Context::addSSLAction('dispMemberFindAccount');
Context::addSSLAction('dispMemberLeave');
Context::addSSLAction('procMemberLogin');
Context::addSSLAction('procMemberModifyPassword');
Context::addSSLAction('procMemberInsert');
Context::addSSLAction('procMemberModifyInfo');
Context::addSSLAction('procMemberFindAccount');
Context::addSSLAction('procMemberModifyEmailAddress');
Context::addSSLAction('procMemberUpdateAuthMail');
Context::addSSLAction('procMemberResendAuthMail');
Context::addSSLAction('procMemberLeave');
//Context::addSSLAction('getMemberMenu');
}
}
示例3: __construct
/**
* constructor
*
* @return void
*/
function __construct()
{
if (!Context::isInstalled()) {
return;
}
if (!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') {
$ssl_actions = array('dispBoardWrite', 'dispBoardWriteComment', 'dispBoardReplyComment', 'dispBoardModifyComment', 'dispBoardDelete', 'dispBoardDeleteComment', 'procBoardInsertDocument', 'procBoardDeleteDocument', 'procBoardInsertComment', 'procBoardDeleteComment', 'procBoardVerificationPassword');
Context::addSSLActions($ssl_actions);
}
}
示例4: member
/**
* constructor
*
* @return void
*/
function member()
{
if (!Context::isInstalled()) {
return;
}
$oModuleModel = getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
// Set to use SSL upon actions related member join/information/password and so on. 2013.02.15
if (!Context::isExistsSSLAction('dispMemberModifyPassword') && Context::getSslStatus() == 'optional') {
$ssl_actions = array('dispMemberModifyPassword', 'dispMemberSignUpForm', 'dispMemberModifyInfo', 'dispMemberModifyEmailAddress', 'dispMemberGetTempPassword', 'dispMemberResendAuthMail', 'dispMemberLoginForm', 'dispMemberFindAccount', 'dispMemberLeave', 'procMemberLogin', 'procMemberModifyPassword', 'procMemberInsert', 'procMemberModifyInfo', 'procMemberFindAccount', 'procMemberModifyEmailAddress', 'procMemberUpdateAuthMail', 'procMemberResendAuthMail', 'procMemberLeave', 'procMemberFindAccountByQuestion');
Context::addSSLActions($ssl_actions);
}
}
示例5: procInstallFTP
/**
* @brief FTP 정보 등록
**/
function procInstallFTP()
{
if (Context::isInstalled()) {
return new Object(-1, 'msg_already_installed');
}
$ftp_info = Context::gets('ftp_user', 'ftp_password', 'ftp_port');
$ftp_info->ftp_port = (int) $ftp_info->ftp_port;
if (!$ftp_info->ftp_port) {
$ftp_info->ftp_port = 21;
}
$buff = '<?php if(!defined("__ZBXE__")) exit();' . "\n";
foreach ($ftp_info as $key => $val) {
$buff .= sprintf("\$ftp_info->%s = '%s';\n", $key, str_replace("'", "\\'", $val));
}
$buff .= "?>";
// safe_mode 일 경우
if (ini_get('safe_mode')) {
if (!$ftp_info->ftp_user || !$ftp_info->ftp_password) {
return new Object(-1, 'msg_safe_mode_ftp_needed');
}
require_once _XE_PATH_ . 'libs/ftp.class.php';
$oFtp = new ftp();
if (!$oFtp->ftp_connect('localhost', $ftp_info->ftp_port)) {
return new Object(-1, 'msg_ftp_not_connected');
}
if (!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) {
$oFtp->ftp_quit();
return new Object(-1, 'msg_ftp_invalid_auth_info');
}
if (!is_dir(_XE_PATH_ . 'files') && !$oFtp->ftp_mkdir(_XE_PATH_ . 'files')) {
$oFtp->ftp_quit();
return new Object(-1, 'msg_ftp_mkdir_fail');
}
if (!$oFtp->ftp_site("CHMOD 777 " . _XE_PATH_ . 'files')) {
$oFtp->ftp_quit();
return new Object(-1, 'msg_ftp_chmod_fail');
}
if (!is_dir(_XE_PATH_ . 'files/config') && !$oFtp->ftp_mkdir(_XE_PATH_ . 'files/config')) {
$oFtp->ftp_quit();
return new Object(-1, 'msg_ftp_mkdir_fail');
}
if (!$oFtp->ftp_site("CHMOD 777 " . _XE_PATH_ . 'files/config')) {
$oFtp->ftp_quit();
return new Object(-1, 'msg_ftp_chmod_fail');
}
$oFtp->ftp_quit();
}
$config_file = Context::getFTPConfigFile();
FileHandler::WriteFile($config_file, $buff);
}
示例6: xe_context_init
function xe_context_init($xe)
{
//
// simplified XE context init method to speed up
//
// set context variables in $GLOBALS (to use in display handler)
$xe->context =& $GLOBALS['__Context__'];
$xe->context->_COOKIE = $_COOKIE;
$xe->loadDBInfo();
// set session handler
if (Context::isInstalled() && $this->db_info->use_db_session == 'Y') {
$oSessionModel = getModel('session');
$oSessionController = getController('session');
session_set_save_handler(array(&$oSessionController, 'open'), array(&$oSessionController, 'close'), array(&$oSessionModel, 'read'), array(&$oSessionController, 'write'), array(&$oSessionController, 'destroy'), array(&$oSessionController, 'gc'));
}
}
示例7: init
/**
* @brief 초기화
**/
function init()
{
// template 경로를 지정
$this->setTemplatePath($this->module_path . 'tpl');
// 설치가 되어 있으면 오류
if (Context::isInstalled()) {
return $this->stop('msg_already_installed');
}
// 컨트롤러 생성
$oInstallController =& getController('install');
$this->install_enable = $oInstallController->checkInstallEnv();
// 설치 가능한 환경이라면 installController::makeDefaultDirectory() 실행
if ($this->install_enable) {
$oInstallController->makeDefaultDirectory();
}
}
示例8: init
/**
* @brief Initialization
*/
function init()
{
// Stop if already installed.
if (Context::isInstalled()) {
return $this->stop('msg_already_installed');
}
// Set the browser title.
Context::setBrowserTitle(Context::getLang('introduce_title'));
// Specify the template path.
$this->setTemplatePath($this->module_path . 'tpl');
// Check the environment.
$oInstallController = getController('install');
self::$checkEnv = $oInstallController->checkInstallEnv();
if (self::$checkEnv) {
$oInstallController->makeDefaultDirectory();
}
}
示例9: init
/**
* @brief Initialization
*/
function init()
{
// Set browser title
Context::setBrowserTitle(Context::getLang('introduce_title'));
// Specify the template path
$this->setTemplatePath($this->module_path . 'tpl');
// Error occurs if already installed
if (Context::isInstalled()) {
return $this->stop('msg_already_installed');
}
// Install a controller
$oInstallController = getController('install');
$this->install_enable = $oInstallController->checkInstallEnv();
// If the environment is installable, execute installController::makeDefaultDirectory()
if ($this->install_enable) {
$oInstallController->makeDefaultDirectory();
}
}
示例10: triggerRssUrlInsert
/**
* @brief RSS 사용 유무를 체크하여 rss url 추가
**/
function triggerRssUrlInsert()
{
$oModuleModel =& getModel('module');
$total_config = $oModuleModel->getModuleConfig('rss');
$current_module_srl = Context::get('module_srl');
$site_module_info = Context::get('site_module_info');
if (!$current_module_srl) {
$current_module_info = Context::get('current_module_info');
$current_module_srl = $current_module_info->module_srl;
}
if (!$current_module_srl) {
return new Object();
}
// 선택된 모듈의 rss설정을 가져옴
$oRssModel =& getModel('rss');
$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
if ($rss_config->open_rss != 'N') {
if (Context::isAllowRewrite()) {
$request_uri = Context::getRequestUri();
// 가상 사이트 변수가 있고 이 변수가 mid와 다를때. (vid와 mid는 같을 수 없다고 함)
if (Context::get('vid') && Context::get('vid') != Context::get('mid')) {
Context::set('rss_url', Context::getRequestUri() . Context::get('vid') . '/' . Context::get('mid') . '/rss');
Context::set('atom_url', Context::getRequestUri() . Context::get('vid') . '/' . Context::get('mid') . '/atom');
} else {
Context::set('rss_url', $request_uri . Context::get('mid') . '/rss');
Context::set('atom_url', $request_uri . Context::get('mid') . '/atom');
}
} else {
Context::set('rss_url', getUrl('', 'mid', Context::get('mid'), 'act', 'rss'));
Context::set('atom_url', getUrl('', 'mid', Context::get('mid'), 'act', 'atom'));
}
}
if (Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N') {
if (Context::isAllowRewrite() && !Context::get('vid')) {
$request_uri = Context::getRequestUri();
Context::set('general_rss_url', $request_uri . 'rss');
Context::set('general_atom_url', $request_uri . 'atom');
} else {
Context::set('general_rss_url', getUrl('', 'module', 'rss', 'act', 'rss'));
Context::set('general_atom_url', getUrl('', 'module', 'rss', 'act', 'atom'));
}
}
return new Object();
}
示例11: Object
/**
* @brief DB를 상속받는 특정 db type의 instance를 생성 후 return
**/
function &getInstance($db_type = NULL)
{
if (!$db_type) {
$db_type = Context::getDBType();
}
if (!$db_type && Context::isInstalled()) {
return new Object(-1, 'msg_db_not_setted');
}
if (!$GLOBALS['__DB__']) {
$class_name = sprintf("DB%s%s", strtoupper(substr($db_type, 0, 1)), strtolower(substr($db_type, 1)));
$class_file = sprintf("%sclasses/db/%s.class.php", _XE_PATH_, $class_name);
if (!file_exists($class_file)) {
new Object(-1, 'msg_db_not_setted');
}
require_once $class_file;
$eval_str = sprintf('$GLOBALS[\'__DB__\'][\'' . $db_type . '\'] = new %s();', $class_name);
eval($eval_str);
}
return $GLOBALS['__DB__'][$db_type];
}
示例12: member
/**
* @brief constructor
**/
function member()
{
if (!Context::isInstalled()) {
return;
}
$oModuleModel =& getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
// SSL 사용시 회원가입/정보/비밀번호등과 관련된 action에 대해 SSL 전송하도록 지정
if (Context::get('_use_ssl') == 'optional') {
Context::addSSLAction('dispMemberLoginForm');
Context::addSSLAction('dispMemberModifyPassword');
Context::addSSLAction('dispMemberSignUpForm');
Context::addSSLAction('dispMemberModifyInfo');
Context::addSSLAction('dispMemberOpenIDLogin');
Context::addSSLAction('procMemberLogin');
Context::addSSLAction('procMemberModifyPassword');
Context::addSSLAction('procMemberInsert');
Context::addSSLAction('procMemberModifyInfo');
Context::addSSLAction('procMemberOpenIDLogin');
}
}
示例13: checkAdminMenu
public function checkAdminMenu()
{
// for admin menu
if (Context::isInstalled()) {
$oMenuAdminModel = getAdminModel('menu');
$output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName);
if (!$output->menu_srl) {
$this->createXeAdminMenu();
$output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName);
} else {
if (!is_readable(FileHandler::getRealPath($output->php_file))) {
$oMenuAdminController = getAdminController('menu');
$oMenuAdminController->makeXmlFile($output->menu_srl);
}
Context::set('admin_menu_srl', $output->menu_srl);
}
$this->_oldAdminmenuDelete();
$returnObj = new stdClass();
$returnObj->menu_srl = $output->menu_srl;
$returnObj->php_file = FileHandler::getRealPath($output->php_file);
return $returnObj;
}
}
示例14: getController
<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
if (!defined('__XE__')) {
exit;
}
/**
* @file counter.addon.php
* @author NAVER (developers@xpressengine.com)
* @brief Counter add-on
*/
// Execute if called_position is before_display_content
if ($called_position == 'before_module_init' && Context::get('module') != 'admin' && Context::getResponseMethod() == 'HTML' && Context::isInstalled() && !isCrawler()) {
$oCounterController = getController('counter');
$oCounterController->counterExecute();
}
/* End of file counter.addon.php */
/* Location: ./addons/counter/counter.addon.php */
示例15: procInstall
/**
* @brief Install with received information
*/
function procInstall($install_config = null)
{
// Check if it is already installed
if (Context::isInstalled()) {
return new Object(-1, 'msg_already_installed');
}
// Get install parameters.
$config = Rhymix\Framework\Config::getDefaults();
if ($install_config) {
$install_config = (array) $install_config;
$config['db']['master']['type'] = str_replace('_innodb', '', $install_config['db_type']);
$config['db']['master']['host'] = $install_config['db_hostname'];
$config['db']['master']['port'] = $install_config['db_port'];
$config['db']['master']['user'] = $install_config['db_userid'];
$config['db']['master']['pass'] = $install_config['db_password'];
$config['db']['master']['database'] = $install_config['db_database'];
$config['db']['master']['prefix'] = $install_config['db_table_prefix'];
$config['db']['master']['charset'] = $install_config['db_charset'];
$config['db']['master']['engine'] = strpos($install_config['db_type'], 'innodb') !== false ? 'innodb' : (strpos($install_config['db_type'], 'mysql') !== false ? 'myisam' : null);
$config['use_rewrite'] = $install_config['use_rewrite'] === 'Y' ? true : false;
$config['url']['ssl'] = $install_config['use_ssl'] ?: 'none';
$time_zone = $install_config['time_zone'];
$user_info = new stdClass();
$user_info->email_address = $install_config['email_address'];
$user_info->password = $install_config['password'];
$user_info->nick_name = $install_config['nick_name'];
$user_info->user_id = $install_config['user_id'];
} else {
$config['db']['master']['type'] = str_replace('_innodb', '', $_SESSION['db_config']->db_type);
$config['db']['master']['host'] = $_SESSION['db_config']->db_host;
$config['db']['master']['port'] = $_SESSION['db_config']->db_port;
$config['db']['master']['user'] = $_SESSION['db_config']->db_user;
$config['db']['master']['pass'] = $_SESSION['db_config']->db_pass;
$config['db']['master']['database'] = $_SESSION['db_config']->db_database;
$config['db']['master']['prefix'] = $_SESSION['db_config']->db_prefix;
$config['db']['master']['charset'] = $_SESSION['db_config']->db_charset;
$config['db']['master']['engine'] = strpos($_SESSION['db_config']->db_type, 'innodb') !== false ? 'innodb' : (strpos($_SESSION['db_config']->db_type, 'mysql') !== false ? 'myisam' : null);
$config['use_rewrite'] = $_SESSION['use_rewrite'] === 'Y' ? true : false;
$config['url']['ssl'] = Context::get('use_ssl') ?: 'none';
$time_zone = Context::get('time_zone');
$user_info = Context::gets('email_address', 'password', 'nick_name', 'user_id');
}
// Fix the database table prefix.
$config['db']['master']['prefix'] = rtrim($config['db']['master']['prefix'], '_');
if ($config['db']['master']['prefix'] !== '') {
$config['db']['master']['prefix'] .= '_';
}
// Create new crypto keys.
$config['crypto']['encryption_key'] = Rhymix\Framework\Security::getRandom(64, 'alnum');
$config['crypto']['authentication_key'] = Rhymix\Framework\Security::getRandom(64, 'alnum');
$config['crypto']['session_key'] = Rhymix\Framework\Security::getRandom(64, 'alnum');
// Set the default language.
$config['locale']['default_lang'] = Context::getLangType();
$config['locale']['enabled_lang'] = array($config['locale']['default_lang']);
// Set the default time zone.
if (strpos($time_zone, '/') !== false) {
$config['locale']['default_timezone'] = $time_zone;
$user_timezone = null;
} else {
$user_timezone = intval(Rhymix\Framework\DateTime::getTimezoneOffsetByLegacyFormat($time_zone ?: '+0900') / 3600);
switch ($user_timezone) {
case 9:
$config['locale']['default_timezone'] = 'Asia/Seoul';
break;
case 0:
$config['locale']['default_timezone'] = 'Etc/UTC';
break;
default:
$config['locale']['default_timezone'] = 'Etc/GMT' . ($user_timezone > 0 ? '-' : '+') . abs($user_timezone);
}
}
// Set the internal time zone.
if ($config['locale']['default_timezone'] === 'Asia/Seoul') {
$config['locale']['internal_timezone'] = 32400;
} elseif ($user_timezone !== null) {
$config['locale']['internal_timezone'] = $user_timezone * 3600;
} else {
$config['locale']['internal_timezone'] = 0;
}
// Set the default URL.
$config['url']['default'] = Context::getRequestUri();
// Set the default umask.
$config['file']['umask'] = Rhymix\Framework\Storage::recommendUmask();
// Load the new configuration.
Rhymix\Framework\Config::setAll($config);
Context::loadDBInfo($config);
// Check DB.
$oDB = DB::getInstance();
if (!$oDB->isConnected()) {
return $oDB->getError();
}
// Assign a temporary administrator while installing.
foreach ($user_info as $key => $val) {
Context::set($key, $val, true);
}
$user_info->is_admin = 'Y';
Context::set('logged_info', $user_info);
//.........这里部分代码省略.........