| Server IP : 87.98.154.146 / Your IP : 216.73.216.101 Web Server : Apache System : Linux webm005.cluster126.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : bsiadvisil ( 110003) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/bsiadvisil/old/administrator/components/com_akeeba/Master/Stats/ |
Upload File : |
<?php
/**
* @package Usagestats
* @copyright Copyright (c)2014-2019 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU GPL version 3 or later
*/
class AkeebaUsagestats
{
/** @var string Unique identifier for the site, created from server variables */
private $siteId;
/** @var array Associative array of data being sent */
private $data = array();
/** @var string Remote url to upload the stats */
private $remoteUrl = 'https://abrandnewsite.com/index.php';
public function setSiteId($siteId)
{
$this->siteId = $siteId;
}
/**
* Sets the value of a collected variable. Use NULL as value to unset it
*
* @param string $key Variable name
* @param string $value Variable value
*/
public function setValue($key, $value)
{
if(is_null($value) && isset($this->data[$key]))
{
unset($this->data[$key]);
}
else
{
$this->data[$key] = $value;
}
}
/**
* Uploads collected data to the remote server
*
* @param bool $useIframe Should I create an iframe to upload data or should I use cURL/fopen?
*
* @return string|bool The HTML code if an iframe is requested or a boolean if we're using cURL/fopen
*/
public function sendInfo($useIframe = false)
{
// No site ID? Well, simply do nothing
if(!$this->siteId)
{
return '';
}
// First of all let's add the siteId
$this->setValue('sid', $this->siteId);
// Then let's create the url
$url = array();
foreach($this->data as $param => $value)
{
$url[] .= $param.'='.$value;
}
$url = $this->remoteUrl.'?'.implode('&', $url);
// Should I create an iframe?
if($useIframe)
{
return '<!-- Anonymous usage statistics collection for Akeeba software --><iframe style="display: none" src="'.$url.'"></iframe>';
}
else
{
// Do we have cURL installed?
if(function_exists('curl_init'))
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
return curl_exec($ch);
}
else
{
// Nope, let's try with fopen and cross our fingers
return @fopen($url, 'r');
}
}
}
}