diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-12-18 15:26:54 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-12-18 15:26:54 +0100 |
commit | ed98cdf532ae475f4d5f5ec88afa55972cba3ba2 (patch) | |
tree | 10b3d7ce4862c6336938aee98efb7a9d34729048 /lib/private | |
parent | a743047e8228fb4973d99e0101dec5e6c39f81b9 (diff) | |
download | nextcloud-server-ed98cdf532ae475f4d5f5ec88afa55972cba3ba2.tar.gz nextcloud-server-ed98cdf532ae475f4d5f5ec88afa55972cba3ba2.zip |
Use OCP\Util::getVersion instead of the internal private implementation
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/app.php | 12 | ||||
-rw-r--r-- | lib/private/app/platform.php | 2 | ||||
-rw-r--r-- | lib/private/defaults.php | 2 | ||||
-rw-r--r-- | lib/private/installer.php | 8 | ||||
-rw-r--r-- | lib/private/ocs/cloud.php | 2 | ||||
-rw-r--r-- | lib/private/setup.php | 2 | ||||
-rw-r--r-- | lib/private/templatelayout.php | 2 | ||||
-rw-r--r-- | lib/private/updater.php | 10 | ||||
-rw-r--r-- | lib/private/util.php | 2 |
9 files changed, 21 insertions, 21 deletions
diff --git a/lib/private/app.php b/lib/private/app.php index ff711e82424..5f6ca9596c8 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -318,8 +318,8 @@ class OC_App { \OC::$server->getConfig(), \OC::$server->getLogger() ); - $appData = $ocsClient->getApplication($app, \OC_Util::getVersion()); - $download= $ocsClient->getApplicationDownload($app, \OC_Util::getVersion()); + $appData = $ocsClient->getApplication($app, \OCP\Util::getVersion()); + $download= $ocsClient->getApplicationDownload($app, \OCP\Util::getVersion()); if(isset($download['downloadlink']) and $download['downloadlink']!='') { // Replace spaces in download link without encoding entire URL $download['downloadlink'] = str_replace(' ', '%20', $download['downloadlink']); @@ -880,7 +880,7 @@ class OC_App { if (is_null($category)) { - $categoryNames = $ocsClient->getCategories(\OC_Util::getVersion()); + $categoryNames = $ocsClient->getCategories(\OCP\Util::getVersion()); if (is_array($categoryNames)) { // Check that categories of apps were retrieved correctly if (!$categories = array_keys($categoryNames)) { @@ -892,7 +892,7 @@ class OC_App { } $page = 0; - $remoteApps = $ocsClient->getApplications($categories, $page, $filter, \OC_Util::getVersion()); + $remoteApps = $ocsClient->getApplications($categories, $page, $filter, \OCP\Util::getVersion()); $apps = []; $i = 0; $l = \OC::$server->getL10N('core'); @@ -1050,7 +1050,7 @@ class OC_App { $config, \OC::$server->getLogger() ); - $appData = $ocsClient->getApplication($app, \OC_Util::getVersion()); + $appData = $ocsClient->getApplication($app, \OCP\Util::getVersion()); // check if app is a shipped app or not. OCS apps have an integer as id, shipped apps use a string if (!is_numeric($app)) { @@ -1080,7 +1080,7 @@ class OC_App { if ($app !== false) { // check if the app is compatible with this version of ownCloud $info = self::getAppInfo($app); - $version = OC_Util::getVersion(); + $version = \OCP\Util::getVersion(); if (!self::isAppCompatible($version, $info)) { throw new \Exception( $l->t('App "%s" cannot be installed because it is not compatible with this version of ownCloud.', diff --git a/lib/private/app/platform.php b/lib/private/app/platform.php index f433ecd9f9e..c16f050e13c 100644 --- a/lib/private/app/platform.php +++ b/lib/private/app/platform.php @@ -52,7 +52,7 @@ class Platform { * @return string */ public function getOcVersion() { - $v = OC_Util::getVersion(); + $v = \OCP\Util::getVersion(); return join('.', $v); } diff --git a/lib/private/defaults.php b/lib/private/defaults.php index 16f45943f54..23f0baad96e 100644 --- a/lib/private/defaults.php +++ b/lib/private/defaults.php @@ -49,7 +49,7 @@ class OC_Defaults { function __construct() { $this->l = \OC::$server->getL10N('lib'); - $version = OC_Util::getVersion(); + $version = \OCP\Util::getVersion(); $this->defaultEntity = 'ownCloud'; /* e.g. company name, used for footers and copyright notices */ $this->defaultName = 'ownCloud'; /* short name, used when referring to the software */ diff --git a/lib/private/installer.php b/lib/private/installer.php index e1447db0db5..bbd976cda91 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -232,8 +232,8 @@ class OC_Installer{ \OC::$server->getConfig(), \OC::$server->getLogger() ); - $appData = $ocsClient->getApplication($ocsId, \OC_Util::getVersion()); - $download = $ocsClient->getApplicationDownload($ocsId, \OC_Util::getVersion()); + $appData = $ocsClient->getApplication($ocsId, \OCP\Util::getVersion()); + $download = $ocsClient->getApplicationDownload($ocsId, \OCP\Util::getVersion()); if (isset($download['downloadlink']) && trim($download['downloadlink']) !== '') { $download['downloadlink'] = str_replace(' ', '%20', $download['downloadlink']); @@ -342,7 +342,7 @@ class OC_Installer{ } // check if the app is compatible with this version of ownCloud - if(!OC_App::isAppCompatible(OC_Util::getVersion(), $info)) { + if(!OC_App::isAppCompatible(\OCP\Util::getVersion(), $info)) { OC_Helper::rmdirr($extractDir); throw new \Exception($l->t("App can't be installed because it is not compatible with this version of ownCloud")); } @@ -400,7 +400,7 @@ class OC_Installer{ \OC::$server->getConfig(), \OC::$server->getLogger() ); - $ocsdata = $ocsClient->getApplication($ocsid, \OC_Util::getVersion()); + $ocsdata = $ocsClient->getApplication($ocsid, \OCP\Util::getVersion()); $ocsversion= (string) $ocsdata['version']; $currentversion=OC_App::getAppVersion($app); if (version_compare($ocsversion, $currentversion, '>')) { diff --git a/lib/private/ocs/cloud.php b/lib/private/ocs/cloud.php index 2cf40c449ff..1b04f43d477 100644 --- a/lib/private/ocs/cloud.php +++ b/lib/private/ocs/cloud.php @@ -26,7 +26,7 @@ class OC_OCS_Cloud { public static function getCapabilities() { $result = array(); - list($major, $minor, $micro) = OC_Util::getVersion(); + list($major, $minor, $micro) = \OCP\Util::getVersion(); $result['version'] = array( 'major' => $major, 'minor' => $minor, diff --git a/lib/private/setup.php b/lib/private/setup.php index 4d11cb44a83..770f5cdab52 100644 --- a/lib/private/setup.php +++ b/lib/private/setup.php @@ -322,7 +322,7 @@ class Setup { 'datadirectory' => $dataDir, 'overwrite.cli.url' => $request->getServerProtocol() . '://' . $request->getInsecureServerHost() . \OC::$WEBROOT, 'dbtype' => $dbType, - 'version' => implode('.', \OC_Util::getVersion()), + 'version' => implode('.', \OCP\Util::getVersion()), ]); try { diff --git a/lib/private/templatelayout.php b/lib/private/templatelayout.php index 95688268c47..bf25b2d31a9 100644 --- a/lib/private/templatelayout.php +++ b/lib/private/templatelayout.php @@ -159,7 +159,7 @@ class OC_TemplateLayout extends OC_Template { if(empty(self::$versionHash)) { $v = OC_App::getAppVersions(); - $v['core'] = implode('.', \OC_Util::getVersion()); + $v['core'] = implode('.', \OCP\Util::getVersion()); self::$versionHash = md5(implode(',', $v)); } diff --git a/lib/private/updater.php b/lib/private/updater.php index d5598d339d3..04f8dcf7226 100644 --- a/lib/private/updater.php +++ b/lib/private/updater.php @@ -155,7 +155,7 @@ class Updater extends BasicEmitter { $this->config->setAppValue('core', 'installedat', microtime(true)); } - $version = \OC_Util::getVersion(); + $version = \OCP\Util::getVersion(); $version['installed'] = $this->config->getAppValue('core', 'installedat'); $version['updated'] = $this->config->getAppValue('core', 'lastupdatedat'); $version['updatechannel'] = \OC_Util::getChannel(); @@ -208,7 +208,7 @@ class Updater extends BasicEmitter { } $installedVersion = $this->config->getSystemValue('version', '0.0.0'); - $currentVersion = implode('.', \OC_Util::getVersion()); + $currentVersion = implode('.', \OCP\Util::getVersion()); $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core')); $success = true; @@ -353,7 +353,7 @@ class Updater extends BasicEmitter { } // only set the final version if everything went well - $this->config->setSystemValue('version', implode('.', \OC_Util::getVersion())); + $this->config->setSystemValue('version', implode('.', \OCP\Util::getVersion())); } } @@ -472,7 +472,7 @@ class Updater extends BasicEmitter { private function checkAppsRequirements() { $isCoreUpgrade = $this->isCodeUpgrade(); $apps = OC_App::getEnabledApps(); - $version = OC_Util::getVersion(); + $version = \OCP\Util::getVersion(); $disabledApps = []; foreach ($apps as $app) { // check if the app is compatible with this version of ownCloud @@ -509,7 +509,7 @@ class Updater extends BasicEmitter { */ private function isCodeUpgrade() { $installedVersion = $this->config->getSystemValue('version', '0.0.0'); - $currentVersion = implode('.', OC_Util::getVersion()); + $currentVersion = implode('.', \OCP\Util::getVersion()); if (version_compare($currentVersion, $installedVersion, '>')) { return true; } diff --git a/lib/private/util.php b/lib/private/util.php index 0e029d74b7d..12146f6980b 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1509,7 +1509,7 @@ class OC_Util { public static function needUpgrade(\OCP\IConfig $config) { if ($config->getSystemValue('installed', false)) { $installedVersion = $config->getSystemValue('version', '0.0.0'); - $currentVersion = implode('.', OC_Util::getVersion()); + $currentVersion = implode('.', \OCP\Util::getVersion()); $versionDiff = version_compare($currentVersion, $installedVersion); if ($versionDiff > 0) { return true; |