TheIconic\Tracking\GoogleAnalytics\Analytics::__construct PHP Method

__construct() public method

It parses the available parameters.
public __construct ( boolean $isSsl = false )
$isSsl boolean
    public function __construct($isSsl = false)
    {
        if (!is_bool($isSsl)) {
            throw new \InvalidArgumentException('First constructor argument "isSSL" must be boolean');
        }
        if ($isSsl) {
            $this->uriScheme .= 's';
            $this->endpoint = str_replace('www', 'ssl', $this->endpoint);
        }
    }

Usage Example

コード例 #1
0
 /**
  * Override __construct() to store whether or not we should be sending Analytics data
  *
  * @param bool $isSsl
  */
 public function __construct($isSsl = false)
 {
     $this->shouldSendAnalytics = craft()->instantAnalytics->shouldSendAnalytics();
     return parent::__construct($isSsl);
 }