當前位置: 首頁>>代碼示例>>PHP>>正文


PHP tsmConfig::_secret方法代碼示例

本文整理匯總了PHP中tsmConfig::_secret方法的典型用法代碼示例。如果您正苦於以下問題:PHP tsmConfig::_secret方法的具體用法?PHP tsmConfig::_secret怎麽用?PHP tsmConfig::_secret使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tsmConfig的用法示例。


在下文中一共展示了tsmConfig::_secret方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loadConfig


//.........這裏部分代碼省略.........
 {
     if ($fresh) {
         self::$_jpConfig = new tsmConfig();
         return self::$_jpConfig;
     }
     vmSetStartTime('loadConfig');
     if (!$force) {
         if (!empty(self::$_jpConfig) && !empty(self::$_jpConfig->_params)) {
             return self::$_jpConfig;
         }
     }
     self::$_jpConfig = new tsmConfig();
     if (!class_exists('tsmartModelConfig')) {
         require VMPATH_ADMIN . '/models/config.php';
     }
     $configTable = tsmartModelConfig::checkConfigTableExists();
     $app = JFactory::getApplication();
     $db = JFactory::getDBO();
     self::$installed = true;
     $install = vRequest::getInt('install', false);
     $redirected = vRequest::getInt('redirected', false);
     $link = '';
     $msg = '';
     if (empty($configTable)) {
         self::$installed = false;
         $jlang = JFactory::getLanguage();
         $selectedLang = $jlang->getTag();
         if (empty($selectedLang)) {
             $selectedLang = $jlang->setLanguage($selectedLang);
         }
         $q = 'SELECT `element` FROM `#__extensions` WHERE type = "language" and enabled = "1"';
         $db->setQuery($q);
         $knownLangs = $db->loadColumn();
         //vmdebug('Selected language '.$selectedLang.' $knownLangs ',$knownLangs);
         if ($app->isAdmin() and !$redirected and !in_array($selectedLang, $knownLangs)) {
             //$option = vRequest::getVar('option');
             //VmConfig::$_debug=true;
             //vmdebug('my option',$option,$_REQUEST);
             //if($option!='com_languages'){
             $msg = 'Install your selected language <b>' . $selectedLang . '</b> first in <a href="' . $link . '">joomla language manager</a>, just select then the component tsmart under menu "component", to proceed with the installation ';
             //$link = 'index.php?option=com_installer&view=languages&redirected=1';
             //$app->redirect($link,$msg);
             //}
             $app->enqueueMessage($msg);
         }
         self::$installed = tsmartModelConfig::checktsmartInstalled();
         /*if(!self::$installed){
         				if(!$redirected and !$install){
         					$link = 'index.php?option=com_tsmart&view=updatesmigration&redirected=1';
         
         					if($app->isSite()){
         						$link = JURI::root(true).'/administrator/'.$link;
         					} else {
         						if(empty($msg)) $msg = 'Install tsmart first, click on the menu component and select tsmart';
         					}
         				}
         			}*/
     } else {
         $query = ' SELECT `config` FROM `#__tsmart_configs` WHERE `tsmart_config_id` = "1";';
         $db->setQuery($query);
         self::$_jpConfig->_raw = $db->loadResult();
         //vmTime('time to load config','loadConfig');
     }
     if (empty(self::$_jpConfig->_raw)) {
         $_value = tsmartModelConfig::readConfigFile();
         if (!$_value) {
             vmError('Serious error, config file could not be filled with data');
             return FALSE;
         }
         $_value = join('|', $_value);
         self::$_jpConfig->_raw = $_value;
         self::$_jpConfig->setParams(self::$_jpConfig->_raw);
         self::$_jpConfig->storeConfig();
     } else {
         self::$_jpConfig->setParams(self::$_jpConfig->_raw);
     }
     self::$_secret = JFactory::getConfig()->get('secret');
     self::$_jpConfig->_params['sctime'] = microtime(TRUE);
     self::$_jpConfig->_params['vmlang'] = self::setdbLanguageTag();
     vmTime('time to load config', 'loadConfig');
     if ($app->isSite()) {
         // try plugins
         JPluginHelper::importPlugin('vmuserfield');
         $dispatcher = JDispatcher::getInstance();
         $dispatcher->trigger('plgVmInitialise', array());
     }
     if (!self::$installed) {
         $user = JFactory::getUser();
         if ($user->authorise('core.admin', 'com_tsmart') and ($install or $redirected)) {
             tsmConfig::$_jpConfig->set('dangeroustools', 1);
         }
         if (!empty($msg)) {
             $app->enqueueMessage($msg);
         }
         if (!empty($link)) {
             $app->redirect($link);
         }
     }
     return self::$_jpConfig;
 }
開發者ID:cuongnd,項目名稱:etravelservice,代碼行數:101,代碼來源:config.php


注:本文中的tsmConfig::_secret方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。