<commit_before><?php
/**
 * CGoogleApi class file.
 *
 * @author <NAME> <<EMAIL>>
 * @link http://www.yiiframework.com/
 * @copyright Copyright &copy; 2008-2011 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

/**
 * CGoogleApi provides helper methods to easily access {@link http://code.google.com/apis/ajax/ Google AJAX APIs}.
 *
 * @author <NAME> <<EMAIL>>
 * @version $Id$
 * @package system.web.helpers
 */
class CGoogleApi
{
	public static $bootstrapUrl='http://www.google.com/jsapi';

	/**
	 * Renders the jsapi script file.
	 * @param string $apiKey the API key. Null if you do not have a key.
	 * @return string the script tag that loads Google jsapi.
	 */
	public static function init($apiKey=null)
	{
		if($apiKey===null)
			return CHtml::scriptFile(self::$bootstrapUrl);
		else
			return CHtml::scriptFile(self::$bootstrapUrl.'?key='.$apiKey);
	}

	/**
	 * Loads the specified API module.<commit_msg>Fix #220 - Use protocol relative URL in CGoogleApi<commit_after><?php
/**
 * CGoogleApi class file.
 *
 * @author <NAME> <<EMAIL>>
 * @link http://www.yiiframework.com/
 * @copyright Copyright &copy; 2008-2011 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

/**
 * CGoogleApi provides helper methods to easily access {@link http://code.google.com/apis/ajax/ Google AJAX APIs}.
 *
 * @author <NAME> <<EMAIL>>
 * @version $Id$
 * @package system.web.helpers
 */
class CGoogleApi
{
	public static $bootstrapUrl='//www.google.com/jsapi';

	/**
	 * Renders the jsapi script file.
	 * @param string $apiKey the API key. Null if you do not have a key.
	 * @return string the script tag that loads Google jsapi.
	 */
	public static function init($apiKey=null)
	{
		if($apiKey===null)
			return CHtml::scriptFile(self::$bootstrapUrl);
		else
			return CHtml::scriptFile(self::$bootstrapUrl.'?key='.$apiKey);
	}

	/**
	 * Loads the specified API module.
{'fraction_non_alphanumeric': 0.1531578947368421, 'fraction_numerical': 0.01, 'mean_word_length': 3.8005050505050506, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1541271', 'n_tokens_mistral': 656, 'n_tokens_neox': 609, 'n_words': 176}