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


PHP Setting::getArray方法代码示例

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


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

示例1: getSettings

 /**
  * Creates an array containing all important cache-settings
  *
  * @global     object    $objDatabase
  * @return    array    $arrSettings
  */
 function getSettings()
 {
     $arrSettings = array();
     \Cx\Core\Setting\Controller\Setting::init('Config', NULL, 'Yaml');
     $ymlArray = \Cx\Core\Setting\Controller\Setting::getArray('Config', null);
     foreach ($ymlArray as $key => $ymlValue) {
         $arrSettings[$key] = $ymlValue['value'];
     }
     return $arrSettings;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:16,代码来源:CacheManager.class.php

示例2: updatePhpCache

 /**
  * Write all settings to the config file
  *
  */
 public static function updatePhpCache()
 {
     global $_ARRAYLANG, $_CONFIG;
     if (!\Cx\Lib\FileSystem\FileSystem::makeWritable(self::getSettingsFile())) {
         \Message::add(self::getSettingsFile() . ' ' . $_ARRAYLANG['TXT_SETTINGS_ERROR_WRITABLE'], \Message::CLASS_ERROR);
         return false;
     }
     //get values from ymlsetting
     \Cx\Core\Setting\Controller\Setting::init('Config', NULL, 'Yaml');
     $ymlArray = \Cx\Core\Setting\Controller\Setting::getArray('Config', null);
     $intMaxLen = 0;
     $ymlArrayValues = array();
     foreach ($ymlArray as $key => $ymlValue) {
         $_CONFIG[$key] = $ymlValue['value'];
         $ymlArrayValues[$ymlValue['group']][$key] = $ymlValue['value'];
         // special case to add legacy domainUrl configuration option
         if ($key == 'mainDomainId') {
             $domainRepository = new \Cx\Core\Net\Model\Repository\DomainRepository();
             $objMainDomain = $domainRepository->findOneBy(array('id' => $ymlArray[$key]['value']));
             if ($objMainDomain) {
                 $domainUrl = $objMainDomain->getName();
             } else {
                 $domainUrl = $_SERVER['SERVER_NAME'];
             }
             $ymlArrayValues[$ymlValue['group']]['domainUrl'] = $domainUrl;
             if ($_CONFIG['xmlSitemapStatus'] == 'on') {
                 \Cx\Core\PageTree\XmlSitemapPageTree::write();
             }
         }
         $intMaxLen = strlen($key) > $intMaxLen ? strlen($key) : $intMaxLen;
     }
     $intMaxLen += strlen('$_CONFIG[\'\']') + 1;
     //needed for formatted output
     // update environment
     \Env::set('config', $_CONFIG);
     $strHeader = "<?php\n";
     $strHeader .= "/**\n";
     $strHeader .= "* This file is generated by the \"settings\"-menu in your CMS.\n";
     $strHeader .= "* Do not try to edit it manually!\n";
     $strHeader .= "*/\n\n";
     $strFooter = "?>";
     //Write values
     $data = $strHeader;
     $strBody = '';
     foreach ($ymlArrayValues as $group => $sectionValues) {
         $strBody .= "/**\n";
         $strBody .= "* -------------------------------------------------------------------------\n";
         $strBody .= "* " . ucfirst($group) . "\n";
         $strBody .= "* -------------------------------------------------------------------------\n";
         $strBody .= "*/\n";
         foreach ($sectionValues as $sectionName => $sectionNameValue) {
             $strBody .= sprintf("%-" . $intMaxLen . "s", '$_CONFIG[\'' . $sectionName . '\']');
             $strBody .= "= ";
             $strBody .= (self::isANumber($sectionNameValue) ? $sectionNameValue : '"' . str_replace('"', '\\"', $sectionNameValue) . '"') . ";\n";
         }
         $strBody .= "\n";
     }
     $data .= $strBody;
     $data .= $strFooter;
     try {
         $objFile = new \Cx\Lib\FileSystem\File(self::getSettingsFile());
         $objFile->write($data);
         return true;
     } catch (\Cx\Lib\FileSystem\FileSystemException $e) {
         \DBG::msg($e->getMessage());
     }
     return false;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:72,代码来源:Config.class.php

示例3: testFileSystemGetArrayOfAllGroups

 public function testFileSystemGetArrayOfAllGroups()
 {
     \DBG::log('*** testFileSystemGetArrayOfAllGroups ***');
     $this->addValuesFileSystem();
     Setting::init('MultiSiteTest', null, 'FileSystem');
     $val = Setting::getArray('MultiSiteTest');
     $this->assertEquals(4, count($val));
     $this->deleteValuesFileSystem();
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:9,代码来源:SettingTest.class.php

示例4: checkIn

 /**
  * Verifies the parameters posted back by Payrexx
  * @return boolean True on success, false otherwise
  */
 public static function checkIn()
 {
     if (empty($_POST['transaction']['invoice']['paymentRequestId']) || empty($_POST['transaction']['status'])) {
         return false;
     }
     if ($_POST['transaction']['status'] === 'waiting') {
         die;
         // we don't want the shop to update the status to cancelled or confirmed
     }
     if ($_POST['transaction']['status'] !== 'confirmed') {
         return false;
     }
     $invoiceId = $_POST['transaction']['invoice']['paymentRequestId'];
     $arrSettings = \Cx\Core\Setting\Controller\Setting::getArray('Shop', 'config');
     if (empty($arrSettings)) {
         return false;
     }
     $instanceName = !empty($arrSettings['payrexx_instance_name']['value']) ? $arrSettings['payrexx_instance_name']['value'] : '';
     $apiSecret = !empty($arrSettings['payrexx_api_secret']['value']) ? $arrSettings['payrexx_api_secret']['value'] : '';
     if (empty($instanceName) || empty($apiSecret)) {
         return false;
     }
     $payrexx = new \Payrexx\Payrexx($instanceName, $apiSecret);
     $invoice = new \Payrexx\Models\Request\Invoice();
     $invoice->setId($invoiceId);
     try {
         $invoice = $payrexx->getOne($invoice);
     } catch (\Payrexx\PayrexxException $e) {
         return false;
     }
     return $invoice->getStatus() === $_POST['transaction']['status'];
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:36,代码来源:PayrexxProcessor.class.php

示例5: getForm

 /**
  * Creates and returns the HTML Form for requesting the payment service.
  *
  * The parameters in $uriparam are appended to the base index URI.
  * If empty, this defaults to "section=Shop&cmd=success".
  *
  * @access  public
  * @global  array       $_ARRAYLANG
  * @param   array       $arrFields      The parameter array
  * @param   string      $submitValue    The optional label for the submit button
  * @param   boolean     $autopost       If true, the form is automatically submitted. Defaults to false.
  * @param   array       $arrSettings    Settings from \Cx\Core\Setting
  * @param   object      $landingPage    The optional URI parameter string
  * @return  string                      The HTML form code
  */
 static function getForm($arrFields, $submitValue = 'Send', $autopost = false, $arrSettings = null, $landingPage = null)
 {
     global $_ARRAYLANG;
     if (gettype($landingPage) != 'object' || get_class($landingPage) != 'Cx\\Core\\ContentManager\\Model\\Entity\\Page') {
         self::$arrError[] = 'No landing page passed.';
     }
     if (($sectionName = $landingPage->getModule()) && !empty($sectionName)) {
         self::$sectionName = $sectionName;
     } else {
         self::$arrError[] = 'Passed landing page is not an application.';
     }
     if (empty($arrSettings)) {
         $settingDb = \Cx\Core\Setting\Controller\Setting::getArray(self::$sectionName, 'config');
         if (!empty($settingDb) && $settingDb['postfinance_active']['value']) {
             $arrSettings = $settingDb;
         } else {
             self::$arrError[] = "Could not load settings.";
         }
     }
     if (empty($arrFields['PSPID'])) {
         $arrFields['PSPID'] = $arrSettings['postfinance_shop_id']['value'];
     }
     if (empty($arrFields['OPERATION'])) {
         $arrFields['OPERATION'] = $arrSettings['postfinance_authorization_type']['value'];
     }
     if (empty($arrFields['LANGUAGE'])) {
         $arrFields['LANGUAGE'] = strtolower(FWLanguage::getLanguageCodeById(FRONTEND_LANG_ID)) . '_' . strtoupper(FWLanguage::getLanguageCodeById(FRONTEND_LANG_ID));
     }
     $baseUri = Cx\Core\Routing\Url::fromPage($landingPage)->toString() . '?result=';
     if (empty($arrFields['ACCEPTURL'])) {
         $arrFields['ACCEPTURL'] = $baseUri . '1';
     }
     if (empty($arrFields['DECLINEURL'])) {
         $arrFields['DECLINEURL'] = $baseUri . '2';
     }
     if (empty($arrFields['EXCEPTIONURL'])) {
         $arrFields['EXCEPTIONURL'] = $baseUri . '2';
     }
     if (empty($arrFields['CANCELURL'])) {
         $arrFields['CANCELURL'] = $baseUri . '0';
     }
     if (empty($arrFields['BACKURL'])) {
         $arrFields['BACKURL'] = $baseUri . '2';
     }
     if (!self::setFields($arrFields)) {
         self::$arrError[] = 'Failed to verify keys.';
         return false;
     }
     $arrFields['SHASIGN'] = self::signature($arrFields, $arrSettings['postfinance_hash_signature_in']['value']);
     $server = $arrSettings['postfinance_use_testserver']['value'] ? 'test' : 'prod';
     $charset = CONTREXX_CHARSET == 'UTF-8' ? '_utf8' : '';
     $hiddenFields = '';
     foreach ($arrFields as $name => $value) {
         $hiddenFields .= Html::getHidden($name, $value);
     }
     $autoSubmit = !$autopost ? '' : '
         <script type="text/javascript">
         /* <![CDATA[ */
             document.yellowpay.submit();
         /* ]]> */
         </script>
     ';
     $form = $_ARRAYLANG['TXT_ORDER_LINK_PREPARED'] . '<br/><br/>' . '<form name="yellowpay" method="post" action="https://e-payment.postfinance.ch/ncol/' . $server . '/orderstandard' . $charset . '.asp">' . $hiddenFields . '<input type="submit" name="go" value="' . $submitValue . '" />' . '</form>' . $autoSubmit;
     return $form;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:80,代码来源:Yellowpay.class.php


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