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


PHP Piwik_Config::getDefaultUserConfigPath方法代码示例

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


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

示例1: update

	static function update()
	{
		$config = Zend_Registry::get('config');
		$salt = Piwik_Common::generateUniqId();
		try {
			if(isset($config->superuser->salt))
			{
				return;
			}

			if(is_writable( Piwik_Config::getDefaultUserConfigPath() ))
			{
				$superuser_info = $config->superuser->toArray();
				$superuser_info['salt'] = $salt;
				$config->superuser = $superuser_info;
				$config->__destruct();

				Piwik::createConfigObject();

				return;
			}
		} catch(Exception $e) { }

		throw new Piwik_Updater_UpdateErrorException("Edit config.ini.php and add below <code>[superuser]</code> the following line <br/><code>salt = $salt</code>");
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:25,代码来源:0.5.2.php

示例2: update

	static function update()
	{
		$config = Zend_Registry::get('config');
		$dbInfos = $config->database->toArray();
		if(!isset($dbInfos['schema']))
		{
			try {
				if(is_writable( Piwik_Config::getDefaultUserConfigPath() ))
				{
					$dbInfos['schema'] = 'Myisam';
					$config->database = $dbInfos;

					$config->__destruct();
					Piwik::createConfigObject();
				}
				else
				{
					throw new Exception('mandatory update failed');
				}
			} catch(Exception $e) {
				throw new Piwik_Updater_UpdateErrorException("Please edit your config/config.ini.php file and add below <code>[database]</code> the following line: <br /><code>schema = Myisam</code>");
			}
		}

		Piwik_Updater::updateDatabase(__FILE__, self::getSql());
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:26,代码来源:0.6.3.php

示例3: update

	static function update()
	{
		$config = Zend_Registry::get('config');
		$salt = Piwik_Common::generateUniqId();
		if(!isset($config->superuser->salt))
		{
			try {
				if(is_writable( Piwik_Config::getDefaultUserConfigPath() ))
				{
					$superuser_info = $config->superuser->toArray();
					$superuser_info['salt'] = $salt;
					$config->superuser = $superuser_info;

					$config->__destruct();
					Piwik::createConfigObject();
				}
				else
				{
					throw new Exception('mandatory update failed');
				}
			} catch(Exception $e) {
				throw new Piwik_Updater_UpdateErrorException("Please edit your config/config.ini.php file and add below <code>[superuser]</code> the following line: <br/><code>salt = $salt</code>");
			}
		}

		$config = Zend_Registry::get('config');
		$plugins = $config->Plugins->toArray();
		if(!in_array('MultiSites', $plugins))
		{
			try {
				if(is_writable( Piwik_Config::getDefaultUserConfigPath() ))
				{
					$plugins[] = 'MultiSites';
					$config->Plugins = $plugins;

					$config->__destruct();
					Piwik::createConfigObject();
				}
				else
				{
					throw new Exception('optional update failed');
				}
			} catch(Exception $e) {
				throw new Exception("You can now enable the new MultiSites plugin in the Plugins screen in the Piwik admin!");
			}
		}
		
		Piwik_Updater::updateDatabase(__FILE__, array(
			'ALTER TABLE `'. Piwik::prefixTable('log_action') .'` 
				CHANGE `name` `name` TEXT' => false,
		));
		
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:53,代码来源:0.5.4.php

示例4: update

	static function update()
	{
		$config = Zend_Registry::get('config');
		try {
			if(is_writable( Piwik_Config::getDefaultUserConfigPath() )) {
				$plugins = $config->Plugins->toArray();
				$plugins[] = 'MultiSites';
				$config->Plugins = $plugins;
				$config->__destruct();
				Piwik::createConfigObject();
				return;
			}
		} catch(Exception $e) { }
		throw new Piwik_Updater_UpdateErrorException("You can now enable the new MultiSites plugin in the Plugins screen in the Piwik admin!");
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:15,代码来源:0.5.3.php

示例5: 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)
	 * If step is invalid, then exit.
	 *
	 * @param string $currentStep Current step
	 */
	protected function checkPreviousStepIsValid( $currentStep )
	{
		$error = false;

		if(empty($this->session->currentStepDone))
		{
			$error = true;
		}
		else if($currentStep == 'finished' && $this->session->currentStepDone == 'finished')
		{
			// ok to refresh this page or use language selector
		}
		else
		{
			if(file_exists(Piwik_Config::getDefaultUserConfigPath()))
			{
				$error = true;
			}

			$steps = array_keys($this->steps);

			// the currentStep
			$currentStepId = array_search($currentStep, $steps);

			// the step before
			$previousStepId = array_search($this->session->currentStepDone, $steps);

			// not OK if currentStepId > previous+1
			if( $currentStepId > $previousStepId + 1 )
			{
				$error = true;
			}
		}
		if($error)
		{
			Piwik_Login_Controller::clearSession();
			$message = Piwik_Translate('Installation_ErrorInvalidState',
						array( '<br /><b>',
								'</b>',
								'<a href=\''.Piwik_Common::sanitizeInputValue(Piwik_Url::getCurrentUrlWithoutFileName()).'\'>',
								'</a>')
					);
			Piwik::exitWithErrorMessage( $message );
		}
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:53,代码来源:Controller.php


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