diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-07-23 11:52:15 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-07-23 11:52:15 +0400 |
commit | 5104d94f3b2250f766b9c520e2da8da9b4cab2e9 (patch) | |
tree | 5f30daf7bc14373fb1bbd0504ce11a771dafc02f /core/Common.php | |
parent | ae4b1f4e38077b174e4df5b7d4513d63fe026a24 (diff) |
Refs #4059 Work in progress: Conversion to use Namespaces of dozen more classes
Removed many Piwik_ functions, in Piwik 2 it is best practise to use the methods calls instead
Todo: finish converting core/ classes + convert plugins/ classes to use \Piwik\Plugin namespace + fix build + Merge master
Diffstat (limited to 'core/Common.php')
-rw-r--r-- | core/Common.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/core/Common.php b/core/Common.php index da6e8892b5..4f40424c95 100644 --- a/core/Common.php +++ b/core/Common.php @@ -1,9 +1,18 @@ <?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + * @category Piwik + * @package Piwik + */ namespace Piwik; use Exception; -use Piwik_IP; -use Piwik_Tracker; +use Piwik\IP; +use Piwik\Tracker; use Piwik_Tracker_Cache; use Piwik_UserCountry_LocationProvider_Default; @@ -753,10 +762,10 @@ class Common */ public static function convertVisitorIdToBin($id) { - if (strlen($id) !== Piwik_Tracker::LENGTH_HEX_ID_STRING + if (strlen($id) !== Tracker::LENGTH_HEX_ID_STRING || @bin2hex(self::hex2bin($id)) != $id ) { - throw new Exception("visitorId is expected to be a " . Piwik_Tracker::LENGTH_HEX_ID_STRING . " hex char string"); + throw new Exception("visitorId is expected to be a " . Tracker::LENGTH_HEX_ID_STRING . " hex char string"); } return self::hex2bin($id); } @@ -778,7 +787,7 @@ class Common */ public static function long2ip($ip) { - return Piwik_IP::long2ip($ip); + return IP::long2ip($ip); } /** |