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


PHP Piwik_Config::init方法代码示例

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


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

示例1: testWritingConfigWithSpecialCharacters

 public function testWritingConfigWithSpecialCharacters()
 {
     $userFile = PIWIK_INCLUDE_PATH . '/tests/resources/Config/config.written.ini.php';
     $globalFile = PIWIK_INCLUDE_PATH . '/tests/resources/Config/global.ini.php';
     $config = new Piwik_Config($userFile, $globalFile);
     $config->init();
     $stringWritten = '&6^ geagea\'\'\'";;&';
     $config->Category = array('test' => $stringWritten);
     $this->assertEqual($config->Category->test, $stringWritten);
     unset($config);
     $config = new Piwik_Config($userFile, $globalFile);
     $config->init();
     $this->assertEqual($config->Category->test, $stringWritten);
     $config->Category = array('test' => $config->Category->test, 'test2' => $stringWritten);
     $this->assertEqual($config->Category->test, $stringWritten);
     $this->assertEqual($config->Category->test2, $stringWritten);
 }
开发者ID:klando,项目名称:pgpiwik,代码行数:17,代码来源:Config.test.php

示例2: checkPreviousStepIsValid

 /**
  * The previous step is valid if it is either 
  * - any step before (OK to go back)
  * - the current step (case when validating a form)
  */
 protected function checkPreviousStepIsValid($currentStep)
 {
     $error = false;
     // first we make sure that the config file is not present, ie. Installation state is expected
     try {
         $config = new Piwik_Config();
         $config->init();
         $error = true;
     } catch (Exception $e) {
     }
     if (empty($this->session->currentStepDone)) {
         $error = true;
     } else {
         // the currentStep
         $currentStepId = array_search($currentStep, $this->steps);
         // the step before
         $previousStepId = array_search($this->session->currentStepDone, $this->steps);
         // not OK if currentStepId > previous+1
         if ($currentStepId > $previousStepId + 1) {
             $error = true;
         }
     }
     if ($error) {
         $message = Piwik_Translate('Installation_ErrorInvalidState', array('<br /><b>', '</b>', '<a href=\'' . Piwik_Url::getCurrentUrlWithoutFileName() . '\'>', '</a>'));
         Piwik::exitWithErrorMessage($message);
     }
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:32,代码来源:Controller.php


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