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:
authormattab <matthieu.aubry@gmail.com>2013-07-23 11:52:15 +0400
committermattab <matthieu.aubry@gmail.com>2013-07-23 11:52:15 +0400
commit5104d94f3b2250f766b9c520e2da8da9b4cab2e9 (patch)
tree5f30daf7bc14373fb1bbd0504ce11a771dafc02f /core/Updater.php
parentae4b1f4e38077b174e4df5b7d4513d63fe026a24 (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/Updater.php')
-rw-r--r--core/Updater.php18
1 files changed, 7 insertions, 11 deletions
diff --git a/core/Updater.php b/core/Updater.php
index bc62eca147..a0000eeb55 100644
--- a/core/Updater.php
+++ b/core/Updater.php
@@ -9,19 +9,15 @@
* @package Piwik
*/
use Piwik\Common;
-
-/**
- * @see core/Option.php
- */
-require_once PIWIK_INCLUDE_PATH . '/core/Option.php';
+use Piwik\Version;
/**
* Load and execute all relevant, incremental update scripts for Piwik core and plugins, and bump the component version numbers for completed updates.
*
* @package Piwik
- * @subpackage Piwik_Updater
+ * @subpackage Updater
*/
-class Piwik_Updater
+class Updater
{
const INDEX_CURRENT_VERSION = 0;
const INDEX_NEW_VERSION = 1;
@@ -130,7 +126,7 @@ class Piwik_Updater
$this->hasMajorDbUpdate = $this->hasMajorDbUpdate || call_user_func(array($className, 'isMajorUpdate'));
}
}
- // unfortunately had to extract this query from the Piwik_Option class
+ // unfortunately had to extract this query from the Option class
$queries[] = 'UPDATE `' . Common::prefixTable('option') . '`
SET option_value = \'' . $fileVersion . '\'
WHERE option_name = \'' . $this->getNameInOptionTable($componentName) . '\';';
@@ -257,7 +253,7 @@ class Piwik_Updater
if ($currentVersion === false) {
if ($name === 'core') {
// This should not happen
- $currentVersion = Piwik_Version::VERSION;
+ $currentVersion = Version::VERSION;
} else {
$currentVersion = '0.0.1';
}
@@ -288,7 +284,7 @@ class Piwik_Updater
{
foreach ($sqlarray as $update => $ignoreError) {
try {
- Piwik_Exec($update);
+ Db::exec($update);
} catch (Exception $e) {
if (($ignoreError === false)
|| !Zend_Registry::get('db')->isErrNo($e, $ignoreError)
@@ -305,7 +301,7 @@ class Piwik_Updater
* Exception thrown by updater if a non-recoverable error occurs
*
* @package Piwik
- * @subpackage Piwik_Updater
+ * @subpackage Updater
*/
class Piwik_Updater_UpdateErrorException extends Exception
{