当前位置: 首页>>代码示例>>PHP>>正文


PHP Configurator类代码示例

本文整理汇总了PHP中Configurator的典型用法代码示例。如果您正苦于以下问题:PHP Configurator类的具体用法?PHP Configurator怎么用?PHP Configurator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Configurator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor
  *
  * @param \Nette\Http\Session     $session      Session
  * @param \Nette\Caching\IStorage $cacheStorage Cache storage
  * @param array                   $config       Custom configuration
  */
 public function __construct(\Nette\Http\Session $session, \Nette\Caching\IStorage $cacheStorage, $config)
 {
     $this->session = $session;
     $this->cacheStorage = $cacheStorage;
     $configurator = new Configurator();
     $this->parameters = $configurator->createConfig($config);
 }
开发者ID:ixtrum,项目名称:file-manager,代码行数:14,代码来源:Loader.php

示例2: setLastRobin

 function setLastRobin($lastRobin)
 {
     require_once 'modules/Configurator/Configurator.php';
     $cfg = new Configurator();
     $cfg->config['aop']['last_robin'] = $lastRobin;
     $cfg->saveConfig();
 }
开发者ID:omusico,项目名称:windcrm,代码行数:7,代码来源:CaseUpdatesHook.php

示例3: process

 /**
  * @see SugarView::process()
  */
 public function process()
 {
     global $current_user;
     if (!is_admin($current_user)) {
         sugar_die("Unauthorized access to administration.");
     }
     // Check if default_theme is valid
     if (isset($_REQUEST['default_theme']) && !in_array($_REQUEST['default_theme'], array_keys(SugarThemeRegistry::allThemes()))) {
         sugar_die("Default theme is invalid.");
     }
     if (isset($_REQUEST['disabled_themes'])) {
         $toDecode = html_entity_decode($_REQUEST['disabled_themes'], ENT_QUOTES);
         $disabledThemes = json_decode($toDecode, true);
         if (($key = array_search(SugarThemeRegistry::current()->__toString(), $disabledThemes)) !== FALSE) {
             unset($disabledThemes[$key]);
         }
         $_REQUEST['disabled_themes'] = implode(',', $disabledThemes);
         $configurator = new Configurator();
         $configurator->config['disabled_themes'] = $_REQUEST['disabled_themes'];
         $configurator->config['default_theme'] = $_REQUEST['default_theme'];
         $configurator->handleOverride();
         echo "true";
     } else {
         parent::process();
     }
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:29,代码来源:view.themesettings.php

示例4: process

 /**
  * @see SugarView::process()
  */
 public function process()
 {
     global $current_user;
     if (!is_admin($current_user)) {
         sugar_die("Unauthorized access to administration.");
     }
     // Check if the theme is valid
     if (!isset($_REQUEST['theme']) || !in_array($_REQUEST['theme'], array_keys(SugarThemeRegistry::allThemes()))) {
         sugar_die("theme is invalid.");
     }
     if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'save') {
         $theme_config = SugarThemeRegistry::getThemeConfig($_REQUEST['theme']);
         $configurator = new Configurator();
         foreach ($theme_config as $name => $def) {
             if (isset($_REQUEST[$name])) {
                 if ($_REQUEST[$name] == 'true') {
                     $_REQUEST[$name] = true;
                 } else {
                     if ($_REQUEST[$name] == 'false') {
                         $_REQUEST[$name] = false;
                     }
                 }
                 $configurator->config['theme_settings'][$_REQUEST['theme']][$name] = $_REQUEST[$name];
             }
         }
         $configurator->handleOverride();
         SugarApplication::redirect('index.php?module=Administration&action=ThemeSettings');
         exit;
     }
     parent::process();
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:34,代码来源:view.themeconfigsettings.php

示例5: display

 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $current_user, $mod_strings, $app_strings, $app_list_strings, $sugar_config, $locale;
     $configurator = new Configurator();
     $sugarConfig = SugarConfig::getInstance();
     $focus = new Administration();
     $configurator->parseLoggerSettings();
     $focus->retrieveSettings();
     if (!empty($_POST['restore'])) {
         $configurator->restoreConfig();
     }
     $this->ss->assign('MOD', $mod_strings);
     $this->ss->assign('APP', $app_strings);
     $this->ss->assign('APP_LIST', $app_list_strings);
     $this->ss->assign('config', $configurator->config);
     $this->ss->assign('error', $configurator->errors);
     $this->ss->assign("AUTO_REFRESH_INTERVAL_OPTIONS", get_select_options_with_id($app_list_strings['dashlet_auto_refresh_options_admin'], isset($configurator->config['dashlet_auto_refresh_min']) ? $configurator->config['dashlet_auto_refresh_min'] : 30));
     $this->ss->assign('LANGUAGES', get_languages());
     $this->ss->assign("JAVASCRIPT", get_set_focus_js() . get_configsettings_js());
     $this->ss->assign('company_logo', SugarThemeRegistry::current()->getImageURL('company_logo.png'));
     $this->ss->assign("settings", $focus->settings);
     $this->ss->assign("mail_sendtype_options", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $focus->settings['mail_sendtype']));
     if (!empty($focus->settings['proxy_on'])) {
         $this->ss->assign("PROXY_CONFIG_DISPLAY", 'inline');
     } else {
         $this->ss->assign("PROXY_CONFIG_DISPLAY", 'none');
     }
     if (!empty($focus->settings['proxy_auth'])) {
         $this->ss->assign("PROXY_AUTH_DISPLAY", 'inline');
     } else {
         $this->ss->assign("PROXY_AUTH_DISPLAY", 'none');
     }
     if (!empty($configurator->config['logger']['level'])) {
         $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), $configurator->config['logger']['level']));
     } else {
         $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), ''));
     }
     if (!empty($configurator->config['lead_conv_activity_opt'])) {
         $this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), $configurator->config['lead_conv_activity_opt']));
     } else {
         $this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), ''));
     }
     if (!empty($configurator->config['logger']['file']['suffix'])) {
         $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, $configurator->config['logger']['file']['suffix']));
     } else {
         $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, ''));
     }
     echo $this->getModuleTitle(false);
     $this->ss->display('modules/Configurator/tpls/EditView.tpl');
     $javascript = new javascript();
     $javascript->setFormName("ConfigureSettings");
     $javascript->addFieldGeneric("notify_fromaddress", "email", $mod_strings['LBL_NOTIFY_FROMADDRESS'], TRUE, "");
     $javascript->addFieldGeneric("notify_subject", "varchar", $mod_strings['LBL_NOTIFY_SUBJECT'], TRUE, "");
     $javascript->addFieldGeneric("proxy_host", "varchar", $mod_strings['LBL_PROXY_HOST'], TRUE, "");
     $javascript->addFieldGeneric("proxy_port", "int", $mod_strings['LBL_PROXY_PORT'], TRUE, "");
     $javascript->addFieldGeneric("proxy_password", "varchar", $mod_strings['LBL_PROXY_PASSWORD'], TRUE, "");
     $javascript->addFieldGeneric("proxy_username", "varchar", $mod_strings['LBL_PROXY_USERNAME'], TRUE, "");
     echo $javascript->getScript();
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:62,代码来源:view.edit.php

示例6: testConfiguratorAddsRoutesFromLoaderToCollection

 public function testConfiguratorAddsRoutesFromLoaderToCollection()
 {
     $collection = $this->getMockCollection();
     $loader = $this->getMockLoader();
     $loader->expects($this->once())->method('loadRoutes')->with($collection);
     $instance = new Configurator($loader);
     $instance->configure($collection);
 }
开发者ID:alecgunnar,项目名称:maverick,代码行数:8,代码来源:ConfiguratorTest.php

示例7: install_aod

function install_aod()
{
    require_once 'modules/Configurator/Configurator.php';
    $cfg = new Configurator();
    if (empty($cfg->config['aod'])) {
        $cfg->config['aod'] = array('enable_aod' => true);
    }
    $cfg->saveConfig();
    addAODSchedulers();
}
开发者ID:omusico,项目名称:SelkirkCRM,代码行数:10,代码来源:AdvancedOpenDiscovery.php

示例8: setAppSettings

function setAppSettings($appId, $appSecret)
{
    if (ctype_alnum($appId) && strlen($appId) == 20 && ctype_alnum($appSecret) && strlen($appSecret) == 40) {
        $configurator = new Configurator();
        $configurator->config['authenticationClass'] = "LatchAuthenticate";
        $configurator->config['appId'] = $appId;
        $configurator->config['appSecret'] = $appSecret;
        $configurator->handleOverride();
    }
}
开发者ID:naviprojects,项目名称:latch-plugin-sugarCRM,代码行数:10,代码来源:LatchPersistence.php

示例9: testPopulateFromPostConvertsBoolValuesFromStrings

 public function testPopulateFromPostConvertsBoolValuesFromStrings()
 {
     $_POST = array('disable_export' => 'true', 'admin_export_only' => 'false', 'upload_dir' => 'yummy');
     $cfg = new Configurator();
     $cfg->populateFromPost();
     $this->assertEquals($cfg->config['disable_export'], true);
     $this->assertEquals($cfg->config['admin_export_only'], false);
     $this->assertEquals($cfg->config['upload_dir'], 'yummy');
     $_POST = array();
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:10,代码来源:ConfiguratorTest.php

示例10: display

 /** 
  * @see SugarView::display()
  */
 public function display()
 {
     global $mod_strings, $app_strings;
     $admin = Administration::getSettings();
     require 'modules/Trackers/config.php';
     ///////////////////////////////////////////////////////////////////////////////
     ////	HANDLE CHANGES
     if (isset($_POST['process'])) {
         if ($_POST['process'] == 'true') {
             foreach ($tracker_config as $entry) {
                 if (isset($entry['bean'])) {
                     //If checkbox is unchecked, we add the entry into the config table; otherwise delete it
                     if (empty($_POST[$entry['name']])) {
                         $admin->saveSetting('tracker', $entry['name'], 1);
                     } else {
                         $db = DBManagerFactory::getInstance();
                         $db->query("DELETE FROM config WHERE category = 'tracker' and name = '" . $entry['name'] . "'");
                     }
                 }
             }
             //foreach
             //save the tracker prune interval
             if (!empty($_POST['tracker_prune_interval'])) {
                 $admin->saveSetting('tracker', 'prune_interval', $_POST['tracker_prune_interval']);
             }
             //save log slow queries and slow query interval
             $configurator = new Configurator();
             $configurator->saveConfig();
         }
         //if
         header('Location: index.php?module=Administration&action=index');
     }
     echo getClassicModuleTitle("Administration", array("<a href='index.php?module=Administration&action=index'>" . translate('LBL_MODULE_NAME', 'Administration') . "</a>", translate('LBL_TRACKER_SETTINGS', 'Administration')), false);
     $trackerManager = TrackerManager::getInstance();
     $disabledMonitors = $trackerManager->getDisabledMonitors();
     $trackerEntries = array();
     foreach ($tracker_config as $entry) {
         if (isset($entry['bean'])) {
             $disabled = !empty($disabledMonitors[$entry['name']]);
             $trackerEntries[$entry['name']] = array('label' => $mod_strings['LBL_' . strtoupper($entry['name']) . '_DESC'], 'helpLabel' => $mod_strings['LBL_' . strtoupper($entry['name']) . '_HELP'], 'disabled' => $disabled);
         }
     }
     $configurator = new Configurator();
     $this->ss->assign('config', $configurator->config);
     $config_strings = return_module_language($GLOBALS['current_language'], 'Configurator');
     $mod_strings['LOG_SLOW_QUERIES'] = $config_strings['LOG_SLOW_QUERIES'];
     $mod_strings['SLOW_QUERY_TIME_MSEC'] = $config_strings['SLOW_QUERY_TIME_MSEC'];
     $this->ss->assign('mod', $mod_strings);
     $this->ss->assign('app', $app_strings);
     $this->ss->assign('trackerEntries', $trackerEntries);
     $this->ss->assign('tracker_prune_interval', !empty($admin->settings['tracker_prune_interval']) ? $admin->settings['tracker_prune_interval'] : 30);
     $this->ss->display('modules/Trackers/tpls/TrackerSettings.tpl');
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:56,代码来源:view.trackersettings.php

示例11: clearFTSFlags

 /**
  * After the notification is displayed, clear the fts flags
  * @return null
  */
 protected function clearFTSFlags()
 {
     if (is_admin($GLOBALS['current_user'])) {
         $admin = Administration::getSettings();
         if (!empty($settings->settings['info_fts_index_done'])) {
             $admin->saveSetting('info', 'fts_index_done', 0);
         }
         // remove notification disabled notification
         $cfg = new Configurator();
         $cfg->config['fts_disable_notification'] = false;
         $cfg->handleOverride();
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:17,代码来源:view.systemquicklist.php

示例12: store_api_key

 public function store_api_key($api, $args)
 {
     if (!isset($args['api_key'])) {
         return array('success' => 0, 'error_code' => '200', 'error_message' => 'No API Key was sent.');
     }
     $api_key = $args['api_key'];
     $configuratorObj = new Configurator();
     //Load config
     $configuratorObj->loadConfig();
     //Update the API setting
     $configuratorObj->config['ClockworkSMSApiKey'] = $api_key;
     //Save the new setting
     $configuratorObj->saveConfig();
     return array('success' => 1);
 }
开发者ID:hectorrios,项目名称:clockworksms_dashlet,代码行数:15,代码来源:ClockworkSMSSenderApi.php

示例13: process

 /**
  * @see SugarView::process()
  */
 public function process()
 {
     global $current_user;
     if (is_admin($current_user) && isset($_REQUEST['disabled_themes'])) {
         $_REQUEST['disabled_themes'] = explode(',', $_REQUEST['disabled_themes']);
         if (($key = array_search(SugarThemeRegistry::current()->__toString(), $_REQUEST['disabled_themes'])) !== FALSE) {
             unset($_REQUEST['disabled_themes'][$key]);
         }
         $_REQUEST['disabled_themes'] = implode(',', $_REQUEST['disabled_themes']);
         $configurator = new Configurator();
         $configurator->config['disabled_themes'] = $_REQUEST['disabled_themes'];
         $configurator->handleOverride();
     }
     parent::process();
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:18,代码来源:view.themesettings.php

示例14: GetConnectionCredentials

 private function GetConnectionCredentials($databaseName = '')
 {
     $this->mDbCredentials['database_host'] = Configurator::GetInstance()->GetSettings('database_host_' . $this->mConnenctionType);
     $this->mDbCredentials['database_user'] = Configurator::GetInstance()->GetSettings('database_user_' . $this->mConnenctionType);
     $this->mDbCredentials['database_password'] = Configurator::GetInstance()->GetSettings('database_password_' . $this->mConnenctionType);
     $this->mDbCredentials['database_database'] = $databaseName == '' ? Configurator::GetInstance()->GetSettings('database_name_' . $this->mConnenctionType) : $databaseName;
 }
开发者ID:ndumisom,项目名称:ANYC-Project,代码行数:7,代码来源:pdodb.class.php

示例15: getInstance

 public static function getInstance()
 {
     if (is_null(self::$c_instance)) {
         self::$c_instance = new Configurator();
     }
     return self::$c_instance;
 }
开发者ID:greglike1001,项目名称:dictionary-backup,代码行数:7,代码来源:Configurator.php


注:本文中的Configurator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。