You are here

function _cloudflare_settings in CloudFlare 7

Same name and namespace in other branches
  1. 6 cloudflare.module \_cloudflare_settings()

Load the cloudflare settings into a static array.

3 calls to _cloudflare_settings()
_cloudflare_spam_api in ./cloudflare.module
_cloudflare_threat_api in ./cloudflare.module
Perform an action using Cloudflare's Threat API.
_is_cloudflare_configured in ./cloudflare.module
Check if Cloudflare has been configured.

File

./cloudflare.module, line 456

Code

function _cloudflare_settings() {
  static $cloudflare_settings;
  if (!isset($cloudflare_settings)) {
    $cloudflare_settings = array(
      'cf_api_email' => variable_get('cloudflare_api_email', FALSE),
      'cf_api_key' => variable_get('cloudflare_api_key', FALSE),
      'cf_api_ssl_host' => "ssl://www.cloudflare.com",
      'cf_api_https_host' => "https://www.cloudflare.com",
      'cf_api_port' => 443,
      'cf_ip_ranges' => array(
        "204.93.240.0/24",
        "204.93.177.0/24",
        "199.27.128.0/21",
        "173.245.48.0/20",
        "103.22.200.0/22",
        "141.101.64.0/18",
        "108.162.192.0/18",
        "190.93.240.0/20",
      ),
      'my_ip' => $_SERVER["REMOTE_ADDR"],
    );
  }
  return $cloudflare_settings;
}