Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'modules/Piwik.php')
-rwxr-xr-xmodules/Piwik.php100
1 files changed, 50 insertions, 50 deletions
diff --git a/modules/Piwik.php b/modules/Piwik.php
index 2bf043a301..8a21d2ab59 100755
--- a/modules/Piwik.php
+++ b/modules/Piwik.php
@@ -1,25 +1,25 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik
- */
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @package Piwik
+ */
require_once "Config.php";
require_once "Zend/Db.php";
require_once "Zend/Db/Table.php";
require_once "Log.php";
require_once "PluginsManager.php";
-
-/**
+
+/**
* Main piwik helper class.
* Contains static functions you can call from the plugins.
- *
- * @package Piwik
+ *
+ * @package Piwik
*/
class Piwik
{
@@ -107,17 +107,17 @@ class Piwik
return $resultCheck;
}
- static public function getJavascriptCode($idSite, $piwikUrl, $actionName = "''")
- {
- $jsTag = file_get_contents( PIWIK_INCLUDE_PATH . "/modules/LogStats/javascriptTag.tpl");
- $jsTag = nl2br(htmlentities($jsTag));
- $jsTag = str_replace('{$actionName}', $actionName, $jsTag);
- $jsTag = str_replace('{$idSite}', $idSite, $jsTag);
+ static public function getJavascriptCode($idSite, $piwikUrl, $actionName = "''")
+ {
+ $jsTag = file_get_contents( PIWIK_INCLUDE_PATH . "/modules/LogStats/javascriptTag.tpl");
+ $jsTag = nl2br(htmlentities($jsTag));
+ $jsTag = str_replace('{$actionName}', $actionName, $jsTag);
+ $jsTag = str_replace('{$idSite}', $idSite, $jsTag);
$jsTag = str_replace('{$piwikUrl}', $piwikUrl, $jsTag);
$jsTag = str_replace('{$hrefTitle}', Piwik::getRandomTitle(), $jsTag);
-
- return $jsTag;
- }
+
+ return $jsTag;
+ }
static public function getMemoryLimitValue()
{
@@ -177,15 +177,15 @@ class Piwik
);
exit;
}
-
- /**
- * Computes the division of i1 by i2. If either i1 or i2 are not number, or if i2 has a value of zero
- * we return 0 to avoid the division by zero.
- *
- * @param numeric $i1
- * @param numeric $i2
- * @return numeric The result of the division or zero
- */
+
+ /**
+ * Computes the division of i1 by i2. If either i1 or i2 are not number, or if i2 has a value of zero
+ * we return 0 to avoid the division by zero.
+ *
+ * @param numeric $i1
+ * @param numeric $i2
+ * @return numeric The result of the division or zero
+ */
static public function secureDiv( $i1, $i2 )
{
if ( is_numeric($i1) && is_numeric($i2) && floatval($i2) != 0)
@@ -737,8 +737,8 @@ class Piwik
// at this point we have only the piwik tables which is good
// but we still miss the piwik generated tables (using the class Piwik_TablePartitioning)
- $allArchiveNumeric = $db->fetchCol("SHOW TABLES LIKE '".$prefixTables."archive_numeric%'");
- $allArchiveBlob = $db->fetchCol("SHOW TABLES LIKE '".$prefixTables."archive_blob%'");
+ $allArchiveNumeric = $db->fetchCol("SHOW TABLES LIKE '".$prefixTables."archive_numeric%'");
+ $allArchiveBlob = $db->fetchCol("SHOW TABLES LIKE '".$prefixTables."archive_blob%'");
$allTablesReallyInstalled = array_merge($tablesInstalled, $allArchiveNumeric, $allArchiveBlob);
@@ -849,8 +849,8 @@ class Piwik
}
Zend_Registry::set($loggerType, $logger);
}
- }
-
+ }
+
static public function createConfigObject( $pathConfigFile = null )
{
@@ -887,21 +887,21 @@ class Piwik
static public function isValidEmailString( $email )
{
return (preg_match('/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9_.-]+\.[a-zA-Z]{2,4}$/', $email) > 0);
- }
-
- /**
- * Creates an entry in the User table for the "anonymous" user.
- *
- * @return void
+ }
+
+ /**
+ * Creates an entry in the User table for the "anonymous" user.
+ *
+ * @return void
*/
- static public function createAnonymousUser()
- {
- // The anonymous user is the user that is assigned by default
- // note that the token_auth value is anonymous, which is assigned by default as well in the Login plugin
- $db = Zend_Registry::get('db');
- $db->query("INSERT INTO ". Piwik::prefixTable("user") . "
- VALUES ( 'anonymous', '', 'anonymous', 'anonymous@example.org', 'anonymous', CURRENT_TIMESTAMP );" );
- }
+ static public function createAnonymousUser()
+ {
+ // The anonymous user is the user that is assigned by default
+ // note that the token_auth value is anonymous, which is assigned by default as well in the Login plugin
+ $db = Zend_Registry::get('db');
+ $db->query("INSERT INTO ". Piwik::prefixTable("user") . "
+ VALUES ( 'anonymous', '', 'anonymous', 'anonymous@example.org', 'anonymous', CURRENT_TIMESTAMP );" );
+ }
static public function createTablesIndex()
{