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


PHP Piwik_Url::getCurrentScheme方法代码示例

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


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

示例1: test_allMethods

 /**
  * display output of all methods
  */
 public function test_allMethods()
 {
     Piwik::createConfigObject();
     Piwik_Config::getInstance()->setTestEnvironment();
     $this->assertEqual(Piwik_Url::getCurrentQueryStringWithParametersModified(array()), Piwik_Url::getCurrentQueryString());
     $expectedUrl = parse_url(Piwik_Url::getCurrentUrl());
     $port = isset($expectedUrl['port']) ? ":{$expectedUrl['port']}" : '';
     $expectedUrl = $expectedUrl['scheme'] . '://' . $expectedUrl['host'] . $port . $expectedUrl['path'];
     $this->assertEqual($expectedUrl, Piwik_Url::getCurrentUrlWithoutQueryString());
     $this->assertEqual($expectedUrl, Piwik_Url::getCurrentScheme() . '://' . Piwik_Url::getCurrentHost() . Piwik_Url::getCurrentScriptName());
     print "<br/>\nPiwik_Url::getCurrentUrl() -> " . Piwik_Url::getCurrentUrl();
     print "<br/>\nPiwik_Url::getCurrentUrlWithoutQueryString() -> " . Piwik_Url::getCurrentUrlWithoutQueryString();
     print "<br/>\nPiwik_Url::getCurrentUrlWithoutFileName() -> " . Piwik_Url::getCurrentUrlWithoutFileName();
     print "<br/>\nPiwik_Url::getCurrentScriptPath() -> " . Piwik_Url::getCurrentScriptPath();
     print "<br/>\nPiwik_Url::getCurrentHost() -> " . Piwik_Url::getCurrentHost();
     print "<br/>\nPiwik_Url::getCurrentScriptName() -> " . Piwik_Url::getCurrentScriptName();
     print "<br/>\nPiwik_Url::getCurrentQueryString() -> " . Piwik_Url::getCurrentQueryString();
     print "<br/>\nPiwik_Url::getArrayFromCurrentQueryString() -> ";
     var_dump(Piwik_Url::getArrayFromCurrentQueryString());
     print "<br/>\nPiwik_Url::getCurrentQueryStringWithParametersModified() -> " . Piwik_Url::getCurrentQueryStringWithParametersModified(array());
     echo "<br/>\n\n";
     // setting parameter to null should remove it from url
     // test on Url.test.php?test=value
     $parameters = array_keys(Piwik_Url::getArrayFromCurrentQueryString());
     $parametersNameToValue = array();
     foreach ($parameters as $name) {
         $parametersNameToValue[$name] = null;
     }
     $this->assertEqual(Piwik_Url::getCurrentQueryStringWithParametersModified($parametersNameToValue), '');
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:33,代码来源:Url.test.php

示例2: smarty_outputfilter_ajaxcdn

/**
 * Smarty AJAX Libraries CDN outputfilter plugin
 *
 * File:     outputfilter.ajaxcdn.php<br>
 * Type:     outputfilter<br>
 * Name:     ajaxcdn<br>
 * Date:     Oct 13, 2009<br>
 * Purpose:  use AJAX Libraries Content Distribution Network<br>
 * Install:  Drop into the plugin directory, call
 *           <code>$smarty->load_filter('output','ajaxcdn');</code>
 *           from application.
 *
 * @param string
 * @param Smarty
 * @return mixed
 */
function smarty_outputfilter_ajaxcdn($source, &$smarty)
{
    $jquery_version = Piwik_Config::getInstance()->General['jquery_version'];
    $jqueryui_version = Piwik_Config::getInstance()->General['jqueryui_version'];
    $pattern = array('~<link rel="stylesheet" type="text/css" href="libs/jquery/themes/([^"]*)" />~', '~<script type="text/javascript" src="libs/jquery/jquery\\.js([^"]*)">~', '~<script type="text/javascript" src="libs/jquery/jquery-ui\\.js([^"]*)">~', '~<script type="text/javascript" src="libs/jquery/jquery-ui-18n\\.js([^"]*)">~');
    // IE7 and IE8 bug: downloads css twice if scheme not specified
    $requestMethod = Piwik_Url::getCurrentScheme();
    $replace = array('<link rel="stylesheet" type="text/css" href="' . $requestMethod . '://ajax.googleapis.com/ajax/libs/jqueryui/' . $jqueryui_version . '/themes/\\1" />', '<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/' . $jquery_version . '/jquery.min.js">', '<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/' . $jqueryui_version . '/jquery-ui.min.js">', '<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/' . $jqueryui_version . '/i18n/jquery-ui-18n.min.js">');
    return preg_replace($pattern, $replace, $source);
}
开发者ID:josl,项目名称:CGE-File-Sharing,代码行数:26,代码来源:outputfilter.ajaxcdn.php

示例3: testAllMethods

 /**
  * @group Core
  * @group Url
  */
 public function testAllMethods()
 {
     $this->assertEquals(Piwik_Url::getCurrentQueryStringWithParametersModified(array()), Piwik_Url::getCurrentQueryString());
     $this->assertEquals(Piwik_Url::getCurrentUrl(), Piwik_Url::getCurrentUrlWithoutQueryString());
     $this->assertEquals(Piwik_Url::getCurrentUrl(), Piwik_Url::getCurrentScheme() . '://' . Piwik_Url::getCurrentHost() . Piwik_Url::getCurrentScriptName());
     $_SERVER['QUERY_STRING'] = 'q=test';
     $parameters = array_keys(Piwik_Url::getArrayFromCurrentQueryString());
     $parametersNameToValue = array();
     foreach ($parameters as $name) {
         $parametersNameToValue[$name] = null;
     }
     $this->assertEquals('', Piwik_Url::getCurrentQueryStringWithParametersModified($parametersNameToValue));
 }
开发者ID:nomoto-ubicast,项目名称:piwik,代码行数:17,代码来源:UrlTest.php

示例4: start

 public static function start($options = false)
 {
     if (Piwik_Common::isPhpCliMode()) {
         return;
     }
     // use cookies to store session id on the client side
     @ini_set('session.use_cookies', '1');
     // prevent attacks involving session ids passed in URLs
     @ini_set('session.use_only_cookies', '1');
     // advise browser that session cookie should only be sent over secure connection
     if (Piwik_Url::getCurrentScheme() === 'https') {
         @ini_set('session.cookie_secure', '1');
     }
     // advise browser that session cookie should only be accessible through the HTTP protocol (i.e., not JavaScript)
     @ini_set('session.cookie_httponly', '1');
     // don't use the default: PHPSESSID
     $sessionName = defined('PIWIK_SESSION_NAME') ? PIWIK_SESSION_NAME : 'PIWIK_SESSID';
     @ini_set('session.name', $sessionName);
     // we consider these to be misconfigurations, in that
     //  - user - Piwik doesn't implement user-defined session handler functions
     // -  mm - is not recommended, not supported, not available for Windows, and has a potential concurrency issue
     $currentSaveHandler = ini_get('session.save_handler');
     if ($currentSaveHandler == 'user' || $currentSaveHandler == 'mm') {
         @ini_set('session.save_handler', 'files');
         @ini_set('session.save_path', '');
     }
     // for "files", we want a writeable folder;
     // for shared hosting, we assume the web server has been securely configured to prevent local session file hijacking
     if (ini_get('session.save_handler') == 'files') {
         $sessionPath = ini_get('session.save_path');
         if (preg_match('/^[0-9]+;(.*)/', $sessionPath, $matches)) {
             $sessionPath = $matches[1];
         }
         if (ini_get('safe_mode') || ini_get('open_basedir') || empty($sessionPath) || !@is_readable($sessionPath) || !@is_writable($sessionPath)) {
             $sessionPath = PIWIK_USER_PATH . '/tmp/sessions';
             $ok = true;
             if (!is_dir($sessionPath)) {
                 Piwik_Common::mkdir($sessionPath);
                 if (!is_dir($sessionPath)) {
                     // Unable to mkdir $sessionPath
                     $ok = false;
                 }
             } else {
                 if (!@is_writable($sessionPath)) {
                     // $sessionPath is not writable
                     $ok = false;
                 }
             }
             if ($ok) {
                 @ini_set('session.save_path', $sessionPath);
                 // garbage collection may disabled by default (e.g., Debian)
                 if (ini_get('session.gc_probability') == 0) {
                     @ini_set('session.gc_probability', 1);
                 }
             }
             // else rely on default setting (assuming it is configured to a writeable folder)
         }
     }
     try {
         Zend_Session::start();
     } catch (Exception $e) {
         // This message is not translateable because translations haven't been loaded yet.
         Piwik_ExitWithMessage('Unable to start session.  Check that session.save_path or tmp/sessions is writeable, and session.auto_start = 0.');
     }
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:65,代码来源:Session.php

示例5: setHostValidationVariablesView

    /**
     * Checks if the current host is valid and sets variables on the given view, including:
     * 
     * isValidHost - true if host is valid, false if otherwise
     * invalidHostMessage - message to display if host is invalid (only set if host is invalid)
     * invalidHost - the invalid hostname (only set if host is invalid)
     * mailLinkStart - the open tag of a link to email the super user of this problem (only set
     *                 if host is invalid)
     */
    public static function setHostValidationVariablesView($view)
    {
        // check if host is valid
        $view->isValidHost = Piwik_Url::isValidHost();
        if (!$view->isValidHost) {
            // invalid host, so display warning to user
            $validHost = Piwik_Config::getInstance()->General['trusted_hosts'][0];
            $invalidHost = Piwik_Common::sanitizeInputValue($_SERVER['HTTP_HOST']);
            $emailSubject = rawurlencode(Piwik_Translate('CoreHome_InjectedHostEmailSubject', $invalidHost));
            $emailBody = rawurlencode(Piwik_Translate('CoreHome_InjectedHostEmailBody'));
            $superUserEmail = Piwik::getSuperUserEmail();
            $mailToUrl = "mailto:{$superUserEmail}?subject={$emailSubject}&body={$emailBody}";
            $mailLinkStart = "<a href=\"{$mailToUrl}\">";
            $invalidUrl = Piwik_Url::getCurrentUrlWithoutQueryString($checkIfTrusted = false);
            $validUrl = Piwik_Url::getCurrentScheme() . '://' . $validHost . Piwik_Url::getCurrentScriptName();
            $validLink = "<a href=\"{$validUrl}\">{$validUrl}</a>";
            $changeTrustedHostsUrl = "index.php" . Piwik_Url::getCurrentQueryStringWithParametersModified(array('module' => 'CoreAdminHome', 'action' => 'generalSettings')) . "#trustedHostsSection";
            $warningStart = Piwik_Translate('CoreHome_InjectedHostWarningIntro', array('<strong>' . $invalidUrl . '</strong>', '<strong>' . $validUrl . '</strong>')) . ' <br/>';
            if (Piwik::isUserIsSuperUser()) {
                $view->invalidHostMessage = $warningStart . ' ' . Piwik_Translate('CoreHome_InjectedHostSuperUserWarning', array("<a href=\"{$changeTrustedHostsUrl}\">", $invalidHost, '</a>', "<br/><a href=\"{$validUrl}\">", $validHost, '</a>'));
            } else {
                $view->invalidHostMessage = $warningStart . ' ' . Piwik_Translate('CoreHome_InjectedHostNonSuperUserWarning', array("<br/><a href=\"{$validUrl}\">", '</a>', $mailLinkStart, '</a>'));
            }
            $view->invalidHostMessageHowToFix = '<b>How do I fix this problem and how do I login again?</b><br/> The Piwik Super User can manually edit the file piwik/config/config.ini.php
						and add the following lines: <pre>[General]' . "\n" . 'trusted_hosts[] = "' . $validHost . '"</pre><br/>After making the change, you will be able to login again.<br/><br/>
						You may also <i>disable this security feature (not recommended)</i>. To do so edit config/config.ini.php and add:
						<pre>[General]' . "\n" . 'enable_trusted_host_check=0</pre>';
            $view->invalidHost = $invalidHost;
            // for UserSettings warning
            $view->invalidHostMailLinkStart = $mailLinkStart;
        }
    }
开发者ID:nomoto-ubicast,项目名称:piwik,代码行数:41,代码来源:Controller.php

示例6: render

 public function render()
 {
     if (Piwik_Url::getCurrentScheme() == 'https' || Zend_Registry::get('config')->General->reverse_proxy) {
         @header("Pragma: ");
         @header("Cache-Control: must-revalidate");
     }
     return $this->chart->toPrettyString();
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:8,代码来源:Chart.php

示例7: getSystemInformation


//.........这里部分代码省略.........
			if(!in_array($desired_extension, $extensions))
			{
				$infos['missing_desired_extensions'][] = $desired_extension;
			}
		}

		$desired_functions = array(
			'set_time_limit',
			'mail',
			'parse_ini_file',
			'glob',
		);
		$infos['desired_functions'] = $desired_functions;
		$infos['missing_desired_functions'] = array();
		foreach($desired_functions as $desired_function)
		{
			if(!self::functionExists($desired_function))
			{
				$infos['missing_desired_functions'][] = $desired_function;
			}
		}

		$infos['openurl'] = Piwik_Http::getTransportMethod();

		$infos['gd_ok'] = false;
		if (in_array('gd', $extensions))
		{
			$gdInfo = gd_info();
			$infos['gd_version'] = $gdInfo['GD Version'];
			preg_match('/([0-9]{1})/', $gdInfo['GD Version'], $gdVersion);
			if($gdVersion[0] >= 2)
			{
				$infos['gd_ok'] = true;
			}
		}

		$infos['hasMbstring'] = false;
		$infos['multibyte_ok'] = true;
		if(function_exists('mb_internal_encoding'))
		{
			$infos['hasMbstring'] = true;
			if (((int) ini_get('mbstring.func_overload')) != 0)
			{
				$infos['multibyte_ok'] = false;
			}
		}

		$serverSoftware = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '';
		$infos['serverVersion'] = addslashes($serverSoftware);
		$infos['serverOs'] = @php_uname();
		$infos['serverTime'] = date('H:i:s');

		$infos['registerGlobals_ok'] = ini_get('register_globals') == 0;
		$infos['memoryMinimum'] = $minimumMemoryLimit;

		$infos['memory_ok'] = true;
		$infos['memoryCurrent'] = '';

		$raised = Piwik::raiseMemoryLimitIfNecessary();
		if(($memoryValue = Piwik::getMemoryLimitValue()) > 0)
		{
			$infos['memoryCurrent'] = $memoryValue.'M';
			$infos['memory_ok'] = $memoryValue >= $minimumMemoryLimit;
		}

		$infos['isWindows'] = Piwik_Common::isWindows();

		$integrityInfo = Piwik::getFileIntegrityInformation();
		$infos['integrity'] = $integrityInfo[0];
		
		$infos['integrityErrorMessages'] = array();
		if(isset($integrityInfo[1]))
		{
			if($infos['integrity'] == false)
			{
				$infos['integrityErrorMessages'][] = '<b>'.Piwik_Translate('General_FileIntegrityWarningExplanation').'</b>';
			}
			$infos['integrityErrorMessages'] = array_merge($infos['integrityErrorMessages'], array_slice($integrityInfo, 1));
		}

		$infos['timezone'] = Piwik::isTimezoneSupportEnabled();

		$infos['tracker_status'] = Piwik_Common::getRequestVar('trackerStatus', 0, 'int');

		$infos['protocol'] = Piwik_ProxyHeaders::getProtocolInformation();
		if(Piwik_Url::getCurrentScheme() == 'http' && $infos['protocol'] !== null)
		{
			$infos['general_infos']['secure_protocol'] = '1';
		}
		if(count($headers = Piwik_ProxyHeaders::getProxyClientHeaders()) > 0)
		{
			$infos['general_infos']['proxy_client_headers'] = $headers;
		}
		if(count($headers = Piwik_ProxyHeaders::getProxyHostHeaders()) > 0)
		{
			$infos['general_infos']['proxy_host_headers'] = $headers;
		}

		return $infos;
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:101,代码来源:Controller.php

示例8: getSystemInformation


//.........这里部分代码省略.........
		$infos['phpVersion_minimum'] = $minimumPhpVersion;
		$infos['phpVersion'] = phpversion();
		$infos['phpVersion_ok'] = version_compare( $minimumPhpVersion, $infos['phpVersion']) === -1;

		// critical errors
		$extensions = @get_loaded_extensions();
		$needed_extensions = array(
			'zlib',
			'SPL',
			'iconv',
		);
		$infos['needed_extensions'] = $needed_extensions;
		$infos['missing_extensions'] = array();
		foreach($needed_extensions as $needed_extension)
		{
			if(!in_array($needed_extension, $extensions))
			{
				$infos['missing_extensions'][] = $needed_extension;
			}
		}

		$infos['pdo_ok'] = false;
		if(in_array('PDO', $extensions))
		{
			$infos['pdo_ok'] = true;
		}

		$infos['adapters'] = Piwik_Db::getAdapters();

		$infos['json'] = false;
		if(in_array('json', $extensions))
		{
			$infos['json'] = true;
		}

		$infos['xml'] = false;
		if(in_array('xml', $extensions))
		{
			$infos['xml'] = true;
		}

		// warnings
		$needed_functions = array(
			'set_time_limit',
			'mail',
		);
		$infos['needed_functions'] = $needed_functions;
		$infos['missing_functions'] = array();
		foreach($needed_functions as $needed_function)
		{
			if(!function_exists($needed_function))
			{
				$infos['missing_functions'][] = $needed_function;
			}
		}

		$infos['openurl'] = Piwik::getTransportMethod();

		$infos['gd_ok'] = false;
		if (in_array('gd', $extensions))
		{
			$gdInfo = gd_info();
			$infos['gd_version'] = $gdInfo['GD Version'];
			preg_match('/([0-9]{1})/', $gdInfo['GD Version'], $gdVersion);
			if($gdVersion[0] >= 2)
			{
				$infos['gd_ok'] = true;
			}
		}

		$infos['serverVersion'] = addslashes($_SERVER['SERVER_SOFTWARE']);
		$infos['serverOs'] = @php_uname();
		$infos['serverTime'] = date('H:i:s');

		$infos['registerGlobals_ok'] = ini_get('register_globals') == 0;
		$infos['memoryMinimum'] = $minimumMemoryLimit;

		$infos['memory_ok'] = true;
		// on windows the ini_get is not working?
		$infos['memoryCurrent'] = '?M';

		$raised = Piwik::raiseMemoryLimitIfNecessary();
		if(	$memoryValue = Piwik::getMemoryLimitValue() )
		{
			$infos['memoryCurrent'] = $memoryValue.'M';
			$infos['memory_ok'] = $memoryValue >= $minimumMemoryLimit;
		}

		$infos['isWindows'] = substr(PHP_OS, 0, 3) == 'WIN';

		$infos['protocol_ok'] = true;
		$infos['protocol'] = self::getProtocolInformation();
		if(Piwik_Url::getCurrentScheme() == 'http' &&
			$infos['protocol'] !== null)
		{
			$infos['protocol_ok'] = false;
		}

		return $infos;
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:101,代码来源:Controller.php

示例9: isHttps

 /**
  * Returns true if this appears to be a secure HTTPS connection
  *
  * @return bool
  */
 public static function isHttps()
 {
     return Piwik_Url::getCurrentScheme() === 'https';
 }
开发者ID:neolf,项目名称:PIWIK4MOBILE,代码行数:9,代码来源:Piwik.php

示例10: start

	public static function start($options = false)
	{
		if(Piwik_Common::isPhpCliMode() || version_compare(Piwik_GetOption('version_core'), '1.5-b5') < 0)
		{
			return;
		}

		// use cookies to store session id on the client side
		@ini_set('session.use_cookies', '1');

		// prevent attacks involving session ids passed in URLs
		@ini_set('session.use_only_cookies', '1');

		// advise browser that session cookie should only be sent over secure connection
		if(Piwik_Url::getCurrentScheme() === 'https')
		{
			@ini_set('session.cookie_secure', '1');
		}

		// advise browser that session cookie should only be accessible through the HTTP protocol (i.e., not JavaScript)
		@ini_set('session.cookie_httponly', '1');

		// don't use the default: PHPSESSID
		$sessionName = defined('PIWIK_SESSION_NAME') ? PIWIK_SESSION_NAME : 'PIWIK_SESSID';
		@ini_set('session.name', $sessionName);

		// proxies may cause the referer check to fail and
		// incorrectly invalidate the session
		@ini_set('session.referer_check', '');

		// we consider these to be misconfigurations, in that
		// - user  - we can't verify that user-defined session handler functions have been set via session_set_save_handler()
		// - mm    - this handler is not recommended, unsupported, not available for Windows, and has a potential concurrency issue
		// - files - this handler doesn't work well in load-balanced environments and may have a concurrency issue with locked session files
		$currentSaveHandler = ini_get('session.save_handler');
		if(in_array($currentSaveHandler, array('user', 'mm', 'files')))
		{
			$db = Zend_Registry::get('db');

			$config = array(
				'name' => Piwik_Common::prefixTable('session'),
				'primary' => 'id',
				'modifiedColumn' => 'modified',
				'dataColumn' => 'data',
				'lifetimeColumn' => 'lifetime',
				'db' => $db,
			);

			$saveHandler = new Piwik_Session_SaveHandler_DbTable($config);
			if($saveHandler)
			{			
				self::setSaveHandler($saveHandler);
			}
		}

		// garbage collection may disabled by default (e.g., Debian)
		if(ini_get('session.gc_probability') == 0)
		{
			@ini_set('session.gc_probability', 1);
		}

		try {
			Zend_Session::start();
			register_shutdown_function(array('Zend_Session', 'writeClose'), true);
		} catch(Exception $e) {
			Piwik::log('Unable to start session: ' . $e->getMessage());
			Piwik_ExitWithMessage(Piwik_Translate('General_ExceptionUnableToStartSession'));
		}
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:69,代码来源:Session.php

示例11: isHttps

 /**
  * Returns true if this appears to be a secure HTTPS connection
  *
  * @return bool
  */
 public static function isHttps()
 {
     return Piwik_Url::getCurrentScheme() === 'https' || Zend_Registry::get('config')->General->assume_secure_protocol;
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:9,代码来源:Piwik.php

示例12: getSystemInformation

 /**
  * Get system information
  */
 public static function getSystemInformation()
 {
     $minimumPhpVersion = Zend_Registry::get('config')->General->minimum_php_version;
     $minimumMemoryLimit = Zend_Registry::get('config')->General->minimum_memory_limit;
     $infos = array();
     $infos['directories'] = Piwik::checkDirectoriesWritable();
     $infos['phpVersion_minimum'] = $minimumPhpVersion;
     $infos['phpVersion'] = phpversion();
     $infos['phpVersion_ok'] = version_compare($minimumPhpVersion, $infos['phpVersion']) === -1;
     // critical errors
     $extensions = @get_loaded_extensions();
     $needed_extensions = array('zlib', 'SPL', 'iconv', 'Reflection');
     $infos['needed_extensions'] = $needed_extensions;
     $infos['missing_extensions'] = array();
     foreach ($needed_extensions as $needed_extension) {
         if (!in_array($needed_extension, $extensions)) {
             $infos['missing_extensions'][] = $needed_extension;
         }
     }
     $infos['pdo_ok'] = false;
     if (in_array('PDO', $extensions)) {
         $infos['pdo_ok'] = true;
     }
     $infos['adapters'] = Piwik_Db::getAdapters();
     $infos['json'] = false;
     if (in_array('json', $extensions)) {
         $infos['json'] = true;
     }
     $infos['xml'] = false;
     if (in_array('xml', $extensions)) {
         $infos['xml'] = true;
     }
     $needed_functions = array('debug_backtrace', 'create_function');
     $infos['needed_functions'] = $needed_functions;
     $infos['missing_functions'] = array();
     foreach ($needed_functions as $needed_function) {
         if (!self::functionExists($needed_function)) {
             $infos['missing_functions'][] = $needed_function;
         }
     }
     // warnings
     $desired_functions = array('set_time_limit', 'mail', 'parse_ini_file');
     $infos['desired_functions'] = $desired_functions;
     $infos['missing_desired_functions'] = array();
     foreach ($desired_functions as $desired_function) {
         if (!self::functionExists($desired_function)) {
             $infos['missing_desired_functions'][] = $desired_function;
         }
     }
     $infos['openurl'] = Piwik::getTransportMethod();
     $infos['gd_ok'] = false;
     if (in_array('gd', $extensions)) {
         $gdInfo = gd_info();
         $infos['gd_version'] = $gdInfo['GD Version'];
         preg_match('/([0-9]{1})/', $gdInfo['GD Version'], $gdVersion);
         if ($gdVersion[0] >= 2) {
             $infos['gd_ok'] = true;
         }
     }
     $infos['hasMbstring'] = false;
     $infos['multibyte_ok'] = true;
     if (function_exists('mb_internal_encoding')) {
         $infos['hasMbstring'] = true;
         if ((int) ini_get('mbstring.func_overload') != 0) {
             $infos['multibyte_ok'] = false;
         }
     }
     /**
      * @see http://php.net/ip2long
      */
     $infos['isIpv4'] = true;
     if (strpos($_SERVER['REMOTE_ADDR'], ':') !== false) {
         $infos['isIpv4'] = false;
     }
     $infos['serverVersion'] = addslashes($_SERVER['SERVER_SOFTWARE']);
     $infos['serverOs'] = @php_uname();
     $infos['serverTime'] = date('H:i:s');
     $infos['registerGlobals_ok'] = ini_get('register_globals') == 0;
     $infos['memoryMinimum'] = $minimumMemoryLimit;
     $infos['memory_ok'] = true;
     // on windows the ini_get is not working?
     $infos['memoryCurrent'] = '?M';
     $raised = Piwik::raiseMemoryLimitIfNecessary();
     if ($memoryValue = Piwik::getMemoryLimitValue()) {
         $infos['memoryCurrent'] = $memoryValue . 'M';
         $infos['memory_ok'] = $memoryValue >= $minimumMemoryLimit;
     }
     $infos['isWindows'] = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
     $infos['protocol_ok'] = true;
     $infos['protocol'] = self::getProtocolInformation();
     if (Piwik_Url::getCurrentScheme() == 'http' && $infos['protocol'] !== null) {
         $infos['protocol_ok'] = false;
     }
     $integrityInfo = Piwik::getFileIntegrityInformation();
     $infos['integrity'] = $integrityInfo[0];
     $infos['integrityErrorMessages'] = array();
     if (isset($integrityInfo[1])) {
//.........这里部分代码省略.........
开发者ID:Doluci,项目名称:tomatocart,代码行数:101,代码来源:Controller.php


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