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


PHP Configuration::set方法代码示例

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


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

示例1: testVerify

 /**
  * @covers Airbrake\Configuration::verify
  */
 public function testVerify()
 {
     $this->object->set('apiKey', null);
     try {
         $this->object->verify();
     } catch (\Exception $e) {
         $this->assertInstanceOf('Airbrake\\Exception', $e);
     }
 }
开发者ID:airbrake,项目名称:airbrake-php,代码行数:12,代码来源:ConfigurationTest.php

示例2: initializeConfiguration

 /**
  * Initializes the shared configuration
  *
  * @param string $basePath
  * @return Configuration
  */
 public static function initializeConfiguration($basePath)
 {
     // Read the configurations file
     $configuration = array();
     $configurationFile = $basePath . 'Configurations/Configuration.json';
     if (file_exists($configurationFile) && is_readable($configurationFile)) {
         $configuration = json_decode(file_get_contents($configurationFile), TRUE);
     }
     self::$sharedConfiguration = new Configuration($configuration);
     self::$sharedConfiguration->set('basePath', $basePath);
     return self::$sharedConfiguration;
 }
开发者ID:cundd,项目名称:noshi,代码行数:18,代码来源:ConfigurationManager.php

示例3: set

 public static function set($key, $values, $id_shop_group = null, $id_shop = null)
 {
     ConfigurationKPI::setKpiDefinition();
     $r = parent::set($key, $values, $id_shop_group, $id_shop);
     ConfigurationKPI::unsetKpiDefinition();
     return $r;
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:7,代码来源:ConfigurationKPI.php

示例4: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     if (\Schema::hasTable('config')) {
         if (!\Configuration::has('app_name')) {
             \Configuration::set('app_name', env('APP_NAME'));
         }
     }
 }
开发者ID:hramose,项目名称:laravel5-admin,代码行数:13,代码来源:ConfigServiceProvider.php

示例5: getContent

 function getContent()
 {
     global $cookie;
     /* Languages preliminaries */
     $defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT'));
     $languages = Language::getLanguages();
     $iso = Language::getIsoById($defaultLanguage);
     $isoUser = Language::getIsoById(intval($cookie->id_lang));
     /* display the module name */
     $this->_html = '<h2>' . $this->displayName . ' ' . $this->version . '</h2>';
     /* update the editorial xml */
     if (isset($_POST['submitUpdate'])) {
         // Generate new XML data
         $newXml = '<?xml version=\'1.0\' encoding=\'utf-8\' ?>' . "\n";
         $newXml .= '<links>' . "\n";
         $i = 0;
         foreach ($_POST['link'] as $link) {
             $newXml .= '	<link>';
             foreach ($link as $key => $field) {
                 if ($line = $this->putContent($newXml, $key, $field)) {
                     $newXml .= $line;
                 }
             }
             /* upload the image */
             if (isset($_FILES['link_' . $i . '_img']) and isset($_FILES['link_' . $i . '_img']['tmp_name']) and !empty($_FILES['link_' . $i . '_img']['tmp_name'])) {
                 Configuration::set('PS_IMAGE_GENERATION_METHOD', 1);
                 if ($error = checkImage($_FILES['link_' . $i . '_img'], $this->maxImageSize)) {
                     $this->_html .= $error;
                 } elseif (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) or !move_uploaded_file($_FILES['link_' . $i . '_img']['tmp_name'], $tmpName)) {
                     return false;
                 } elseif (!imageResize($tmpName, dirname(__FILE__) . '/' . $isoUser . $i . '.jpg')) {
                     $this->_html .= $this->displayError($this->l('An error occurred during the image upload.'));
                 }
                 unlink($tmpName);
             }
             if ($line = $this->putContent($newXml, 'img', $isoUser . $i . '.jpg')) {
                 $newXml .= $line;
             }
             $newXml .= "\n" . '	</link>' . "\n";
             $i++;
         }
         $newXml .= '</links>' . "\n";
         /* write it into the editorial xml file */
         if ($fd = @fopen(dirname(__FILE__) . '/' . $isoUser . 'links.xml', 'w')) {
             if (!@fwrite($fd, $newXml)) {
                 $this->_html .= $this->displayError($this->l('Unable to write to the editor file.'));
             }
             if (!@fclose($fd)) {
                 $this->_html .= $this->displayError($this->l('Can\'t close the editor file.'));
             }
         } else {
             $this->_html .= $this->displayError($this->l('Unable to update the editor file.<br />Please check the editor file\'s writing permissions.'));
         }
     }
     /* display the editorial's form */
     $this->_displayForm();
     return $this->_html;
 }
开发者ID:srikanthash09,项目名称:codetestdatld,代码行数:58,代码来源:slideric.php

示例6: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     \App::bind('admin', function () {
         // set debug mode!
         if (!\Configuration::has('debug')) {
             \Configuration::set('debug', true);
         }
         return new \App\Classes\Admin();
     });
 }
开发者ID:hramose,项目名称:laravel5-admin,代码行数:15,代码来源:AdminServiceProvider.php

示例7: addRoute

 public function addRoute($route = array(), $key = '')
 {
     if (count($route) > 0) {
         $keys = array_keys($route);
         $currentRoutes = \Admin::routes();
         if (!array_key_exists($keys[0], $currentRoutes)) {
             $currentRoutes[$key][] = $route;
             \Configuration::set('admin_routes', $currentRoutes);
             return true;
         }
     }
     return false;
 }
开发者ID:hramose,项目名称:laravel5-admin,代码行数:13,代码来源:Admin.php

示例8: __construct

 public function __construct()
 {
     $this->name = 'veritransinstallment';
     $this->tab = 'payments_gateways';
     $this->version = '1.0';
     $this->author = 'Veritrans';
     $this->bootstrap = true;
     $this->currencies = true;
     $this->currencies_mode = 'checkbox';
     $this->veritrans_convenience_fee = 0;
     // key length must be between 0-32 chars to maintain compatibility with <= 1.5
     $this->config_keys = array('VI_CLIENT_KEY', 'VI_SERVER_KEY', 'VI_API_VERSION', 'VI_PAYMENT_TYPE', 'VI_3D_SECURE', 'VI_KURS', 'VI_CONVENIENCE_FEE', 'VI_PAYMENT_SUCCESS_STATUS_MAP', 'VI_PAYMENT_FAILURE_STATUS_MAP', 'VI_PAYMENT_CHALLENGE_STATUS_MAP', 'VI_ENVIRONMENT', 'VI_SANITIZED', 'VI_ENABLE_INSTALLMENT', 'VI_INSTALLMENTS_BNI', 'VI_INSTALLMENTS_TERM', 'VI_BIN_FILTER', 'VI_DISPLAY_NAME', 'VI_AMOUNT_THRESHOLD');
     foreach (array('BNI', 'MANDIRI') as $bank) {
         foreach (array(3, 6, 12) as $months) {
             array_push($this->config_keys, 'VI_INSTALLMENTS_' . $bank . '_' . $months);
         }
     }
     $config = Configuration::getMultiple($this->config_keys);
     foreach ($this->config_keys as $key) {
         if (isset($config[$key])) {
             $this->{strtolower($key)} = $config[$key];
         }
     }
     if (isset($config['VI_KURS'])) {
         $this->veritrans_kurs = $config['VI_KURS'];
     } else {
         Configuration::set('VI_KURS', 10000);
     }
     if (!isset($config['VI_DISPLAY_NAME'])) {
         Configuration::set('VI_DISPLAY_NAME', "Credit Card Installment");
     }
     if (!isset($config['VI_AMOUNT_THRESHOLD']) || strlen($config['VI_AMOUNT_THRESHOLD']) < 1) {
         Configuration::set('VI_AMOUNT_THRESHOLD', "500000");
     }
     Configuration::set('VI_API_VERSION', 2);
     Configuration::set('VI_PAYMENT_TYPE', 'vtweb');
     if (!isset($config['VI_SANITIZED'])) {
         Configuration::set('VI_SANITIZED', 0);
     }
     parent::__construct();
     $this->displayName = $this->l('Veritrans Offline Installment');
     $this->description = $this->l('Accept offline installment payments for your products via Veritrans.');
     $this->confirmUninstall = $this->l('Are you sure about uninstalling Veritrans offline installment?');
     if (!count(Currency::checkPaymentCurrencies($this->id))) {
         $this->warning = $this->l('No currency has been set for this module.');
     }
     // Retrocompatibility
     $this->initContext();
 }
开发者ID:rizdaprasetya,项目名称:vtweb-prestashop-OfflineInstallment,代码行数:49,代码来源:veritransinstallment.php

示例9: __construct

 public function __construct()
 {
     $this->name = 'veritransbni';
     $this->tab = 'payments_gateways';
     $this->version = '1.0';
     $this->author = 'Veritrans';
     $this->bootstrap = true;
     $this->currencies = true;
     $this->currencies_mode = 'checkbox';
     $this->veritrans_convenience_fee = 0;
     // key length must be between 0-32 chars to maintain compatibility with <= 1.5
     $this->config_keys = array('VN_CLIENT_KEY', 'VN_SERVER_KEY', 'VN_API_VERSION', 'VN_PAYMENT_TYPE', 'VN_3D_SECURE', 'VN_KURS', 'VN_CONVENIENCE_FEE', 'VN_PAYMENT_SUCCESS_STATUS_MAP', 'VN_PAYMENT_FAILURE_STATUS_MAP', 'VN_PAYMENT_CHALLENGE_STATUS_MAP', 'VN_ENVIRONMENT', 'VN_SANITIZED', 'VN_ENABLE_INSTALLMENT', 'VN_ENABLED_BNI_INSTALLMENT', 'VN_INSTALLMENTS_BNI', 'VN_INSTALLMENTS_MANDIRI');
     foreach (array('BNI', 'MANDIRI') as $bank) {
         foreach (array(3, 6, 12) as $months) {
             array_push($this->config_keys, 'VN_INSTALLMENTS_' . $bank . '_' . $months);
         }
     }
     $config = Configuration::getMultiple($this->config_keys);
     foreach ($this->config_keys as $key) {
         if (isset($config[$key])) {
             $this->{strtolower($key)} = $config[$key];
         }
     }
     if (isset($config['VN_KURS'])) {
         $this->veritrans_kurs = $config['VN_KURS'];
     } else {
         Configuration::set('VN_KURS', 10000);
     }
     Configuration::set('VN_API_VERSION', 2);
     Configuration::set('VN_PAYMENT_TYPE', 'vtweb');
     if (!isset($config['VN_SANITIZED'])) {
         Configuration::set('VN_SANITIZED', 0);
     }
     parent::__construct();
     $this->displayName = $this->l('Veritrans BNI Installments');
     $this->description = $this->l('Extends Veritrans payment method to accept payment using BNI Installments.');
     $this->confirmUninstall = $this->l('Are you sure about uninstalling Veritrans BNI Installments?');
     if (!count(Currency::checkPaymentCurrencies($this->id))) {
         $this->warning = $this->l('No currency has been set for this module.');
     }
     // Retrocompatibility
     $this->initContext();
 }
开发者ID:harrypujianto,项目名称:vtweb-prestashop-BNIInstallment,代码行数:43,代码来源:veritransbni.php

示例10: postIndex

 public function postIndex(Request $request)
 {
     $nameVal = \Validator::make($request->all(), ['name' => 'required', 'email' => 'required|unique:users|email|max:255', 'password' => 'required|min:6', 'admin_name' => 'required', 'password_confirm' => 'required_with:password|same:password|min:6']);
     if ($nameVal->fails()) {
         return redirect('install')->withErrors($nameVal)->withInput();
     }
     // save the user
     $user = new User();
     $user->email = $request->input('email');
     $user->name = $request->input('admin_name');
     $user->password = bcrypt($request->input('password'));
     $user->save();
     \Configuration::set('app_name', $request->input('name'));
     \Configuration::set('installed', bcrypt(time()));
     if (\Auth::attempt(['email' => $user->email, 'password' => $request->input('password')])) {
         // Authentication passed...
         return redirect()->intended('admin');
     }
 }
开发者ID:hramose,项目名称:laravel5-admin,代码行数:19,代码来源:InstallController.php

示例11: execute

 /**
  * @param array $arguments
  * @param array $options
  * @return int
  */
 protected function execute($arguments = array(), $options = array())
 {
     $databaseManager = new sfDatabaseManager($this->configuration);
     $validModes = array('get', 'set', 'remove');
     switch ($arguments['mode']) {
         case 'get':
             $configValue = Configuration::get($arguments['name']);
             $this->logSection('config', sprintf("Configuration %s value: %s", $arguments['name'], null === $configValue ? 'NULL' : sprintf('"%s"', $configValue)));
             break;
         case 'set':
             $configValue = $arguments['value'];
             Configuration::set($arguments['name'], $arguments['value']);
             $this->logSection('config+', sprintf("Configuration %s set to: %s", $arguments['name'], null === $configValue ? 'NULL' : sprintf('"%s"', $configValue)));
             break;
         case 'remove':
             Configuration::remove($arguments['name']);
             $this->logSection('config-', sprintf("Configuration %s removed", $arguments['name']));
             break;
         default:
             throw new InvalidArgumentException(sprintf("Invalid value for mode argument (%s). One of the following values is accepted: %s", $arguments['mode'], implode(', ', $validModes)));
             break;
     }
     return 0;
 }
开发者ID:xfifix,项目名称:Jenkins-Khan,代码行数:29,代码来源:configTask.class.php

示例12: handleNumAttempts

 private static function handleNumAttempts($data)
 {
     $attempts = Configuration::get('attempt_counter_' . $data[0]['user_name']);
     //check if an attempt was made and log the first attempt
     if (Configuration::get('attempt_counter_' . $data[0]['user_name']) == '0') {
         Configuration::set('time_first_try_' . $data[0]['user_name'], time());
     }
     //Increment the attempts if and only if the username exists
     if (!empty($data)) {
         Configuration::set('attempt_counter_' . $data[0]['user_name'], ++$attempts);
     }
     $timeElapsed = self::checkElapsedTime(Configuration::get('time_first_try_' . $data[0]['user_name']), time());
     if (Configuration::get('attempt_counter_' . $data[0]['user_name']) >= '2') {
         if ($timeElapsed->i < 5) {
             self::disableUserAccount($data);
         } else {
             Configuration::set('attempt_counter_' . $data[0]['user_name'], 0);
         }
     }
 }
开发者ID:ekowabaka,项目名称:cfx,代码行数:20,代码来源:CfxAuthLoginController.php

示例13: uploadImage

 protected function uploadImage($image, $image_w = '', $image_h = '')
 {
     $res = false;
     if (is_array($image) && ImageManager::validateUpload($image, $this->max_image_size) === false && ($tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS')) && move_uploaded_file($image['tmp_name'], $tmp_name)) {
         $type = Tools::strtolower(Tools::substr(strrchr($image['name'], '.'), 1));
         $img_name = Tools::encrypt($image['name'] . sha1(microtime())) . '.' . $type;
         Configuration::set('PS_IMAGE_QUALITY', 'png_all');
         if (ImageManager::resize($tmp_name, dirname(__FILE__) . '/img/' . $img_name, $image_w, $image_h)) {
             $res = true;
         }
     }
     if (!$res) {
         $this->context->smarty->assign('error', $this->l('An error occurred during the image upload.'));
         return false;
     }
     return $img_name;
 }
开发者ID:gks-stage,项目名称:prestashop,代码行数:17,代码来源:themeconfigurator.php

示例14: __construct

 public function __construct()
 {
     $this->name = 'veritranspay';
     $this->tab = 'payments_gateways';
     $this->version = '1.0';
     $this->author = 'Veritrans';
     $this->bootstrap = true;
     $this->currencies = true;
     $this->currencies_mode = 'checkbox';
     $this->veritrans_convenience_fee = 0;
     // key length must be between 0-32 chars to maintain compatibility with <= 1.5
     $this->config_keys = array('VT_CLIENT_KEY', 'VT_SERVER_KEY', 'VT_API_VERSION', 'VT_PAYMENT_TYPE', 'VT_3D_SECURE', 'VT_KURS', 'VT_CONVENIENCE_FEE', 'VT_PAYMENT_SUCCESS_STATUS_MAP', 'VT_PAYMENT_FAILURE_STATUS_MAP', 'VT_PAYMENT_CHALLENGE_STATUS_MAP', 'VT_ENVIRONMENT', 'ENABLED_CREDIT_CARD', 'ENABLED_CIMB', 'ENABLED_MANDIRI', 'ENABLED_PERMATAVA', 'ENABLED_BRIEPAY', 'ENABLED_TELKOMSEL_CASH', 'ENABLED_XL_TUNAI', 'ENABLED_MANDIRI_BILL', 'ENABLED_BBM_MONEY', 'ENABLED_INDOMARET', 'ENABLED_INDOSAT_DOMPETKU', 'ENABLED_MANDIRI_ECASH', 'VT_SANITIZED', 'VT_ENABLE_INSTALLMENT', 'ENABLED_BNI_INSTALLMENT', 'ENABLED_MANDIRI_INSTALLMENT', 'VT_INSTALLMENTS_BNI', 'VT_INSTALLMENTS_MANDIRI');
     foreach (array('BNI', 'MANDIRI') as $bank) {
         foreach (array(3, 6, 12) as $months) {
             array_push($this->config_keys, 'VT_INSTALLMENTS_' . $bank . '_' . $months);
         }
     }
     $config = Configuration::getMultiple($this->config_keys);
     foreach ($this->config_keys as $key) {
         if (isset($config[$key])) {
             $this->{strtolower($key)} = $config[$key];
         }
     }
     if (isset($config['VT_KURS'])) {
         $this->veritrans_kurs = $config['VT_KURS'];
     } else {
         Configuration::set('VT_KURS', 10000);
     }
     Configuration::set('VT_API_VERSION', 2);
     Configuration::set('VT_PAYMENT_TYPE', 'vtweb');
     if (!isset($config['VT_SANITIZED'])) {
         Configuration::set('VT_SANITIZED', 0);
     }
     if (!isset($config['ENABLED_CREDIT_CARD'])) {
         Configuration::set('ENABLED_CREDIT_CARD', 0);
     }
     if (!isset($config['ENABLED_CIMB'])) {
         Configuration::set('ENABLED_CIMB', 0);
     }
     if (!isset($config['ENABLED_MANDIRI'])) {
         Configuration::set('ENABLED_MANDIRI', 0);
     }
     if (!isset($config['ENABLED_PERMATAVA'])) {
         Configuration::set('ENABLED_PERMATAVA', 0);
     }
     if (!isset($config['ENABLED_BRIEPAY'])) {
         Configuration::set('ENABLED_BRIEPAY', 0);
     }
     if (!isset($config['ENABLED_TELKOMSEL_CASH'])) {
         Configuration::set('ENABLED_TELKOMSEL_CASH', 0);
     }
     if (!isset($config['ENABLED_XL_TUNAI'])) {
         Configuration::set('ENABLED_XL_TUNAI', 0);
     }
     if (!isset($config['ENABLED_MANDIRI_BILL'])) {
         Configuration::set('ENABLED_MANDIRI_BILL', 0);
     }
     if (!isset($config['ENABLED_BBM_MONEY'])) {
         Configuration::set('ENABLED_BBM_MONEY', 0);
     }
     if (!isset($config['ENABLED_INDOMARET'])) {
         Configuration::set('ENABLED_INDOMARET', 0);
     }
     if (!isset($config['ENABLED_INDOSAT_DOMPETKU'])) {
         Configuration::set('ENABLED_INDOSAT_DOMPETKU', 0);
     }
     if (!isset($config['ENABLED_MANDIRI_ECASH'])) {
         Configuration::set('ENABLED_MANDIRI_ECASH', 0);
     }
     parent::__construct();
     $this->displayName = $this->l('Veritrans Pay');
     $this->description = $this->l('Accept payments for your products via Veritrans.');
     $this->confirmUninstall = $this->l('Are you sure about uninstalling Veritrans pay?');
     if (!count(Currency::checkPaymentCurrencies($this->id))) {
         $this->warning = $this->l('No currency has been set for this module.');
     }
     // Retrocompatibility
     $this->initContext();
 }
开发者ID:rizdaprasetya,项目名称:vtweb-prestashop,代码行数:79,代码来源:veritranspay.php

示例15: Configuration

            }
        }
        $this->{$name} = $value;
    }
}
// end class
$CF = new Configuration();
$mode = getData("mode");
$submode = getData("submode");
// system actions
switch ($mode) {
    case "sessionconfig":
        switch ($submode) {
            case "submit":
                // apply datas to the current settings
                $CF->set("ENABLE_TABLES", getData("FORM_ENABLE_TABLES", "integer"));
                $CF->set("ENABLE_SEQUENCES", getData("FORM_ENABLE_SEQUENCES", "integer"));
                $CF->set("ENABLE_TRIGGERS", getData("FORM_ENABLE_TRIGGERS", "integer"));
                $CF->set("ENABLE_FUNCTIONS", getData("FORM_ENABLE_FUNCTIONS", "integer"));
                $CF->set("ENABLE_INDEXES", getData("FORM_ENABLE_INDEXES", "integer"));
                $CF->set("ENABLE_PACKAGES", getData("FORM_ENABLE_PACKAGES", "integer"));
                $CF->set("ENABLE_PROCEDURES", getData("FORM_ENABLE_PROCEDURES", "integer"));
                $CF->set("ENABLE_TYPES", getData("FORM_ENABLE_TYPES", "integer"));
                $CF->set("ENABLE_VIEWS", getData("FORM_ENABLE_VIEWS", "integer"));
                $CF->set("ENABLE_TABLESPACES", getData("FORM_ENABLE_TABLESPACES", "integer"));
                $CF->set("ENABLE_DATAFILES", getData("FORM_ENABLE_DATAFILES", "integer"));
                $CF->set("USE_ALL_USER_DATA", getData("FORM_USE_ALL_USER_DATA", "integer"));
                $CF->set("ENABLE_VIEW_STATEMENTS", getData("FORM_ENABLE_VIEW_STATEMENTS", "integer"));
                $CF->set("TABLE_ROW_LIMIT", getData("FORM_TABLE_ROW_LIMIT", "integer"));
                $CF->set("TABLE_FIELDLENGTH_LIMIT", getData("FORM_TABLE_FIELDLENGTH_LIMIT", "integer"));
                $CF->set("ENABLE_HTML_OPTIMIZATION", getData("FORM_ENABLE_HTML_OPTIMIZATION", "integer"));
开发者ID:BackupTheBerlios,项目名称:phporacleadmin,代码行数:31,代码来源:prepend.inc.php


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