You are here

public static function ShareaholicUtilities::get_env in Share Buttons, Related Posts, Content Analytics - Shareaholic 8

Same name and namespace in other branches
  1. 7.3 utilities.php \ShareaholicUtilities::get_env()

Returns the appropriate environment based on URL constant

Return value

string

2 calls to ShareaholicUtilities::get_env()
ShareaholicPublicJS::get_overrides in ./public_js.php
ShareaholicUtilities::asset_url in ./utilities.php
Returns the appropriate asset path for something from our rails app based on environment.

File

./utilities.php, line 509

Class

ShareaholicUtilities

Code

public static function get_env() {
  if (preg_match('/spreadaholic/', self::URL)) {
    return 'development';
  }
  elseif (preg_match('/stageaholic/', self::URL)) {
    return 'staging';
  }
  else {
    return 'production';
  }
}