diff options
Diffstat (limited to 'lib')
56 files changed, 300 insertions, 302 deletions
diff --git a/lib/l10n/ja.js b/lib/l10n/ja.js index e1121b6344b..f28db0d7204 100644 --- a/lib/l10n/ja.js +++ b/lib/l10n/ja.js @@ -84,6 +84,7 @@ OC.L10N.register( "Set an admin password." : "管理者のパスワードを設定。", "Can't create or write into the data directory %s" : "%s データディレクトリに作成、書き込みができません", "%s shared »%s« with you" : "%sが あなたと »%s«を共有しました", + "%s via %s" : "%s に %s から", "Sharing %s failed, because the backend does not allow shares from type %i" : "%s の共有に失敗しました。%i タイプからの共有は許可されていないからです。", "Sharing %s failed, because the file does not exist" : "%s の共有に失敗しました。そのようなファイルは存在しないからです。", "You are not allowed to share %s" : "%s を共有することを許可されていません。", @@ -116,6 +117,8 @@ OC.L10N.register( "A valid password must be provided" : "有効なパスワードを指定する必要があります", "The username is already being used" : "ユーザー名はすでに使われています", "No database drivers (sqlite, mysql, or postgresql) installed." : "データベースドライバー (sqlite, mysql, postgresql) がインストールされていません。", + "Microsoft Windows Platform is not supported" : "Microsoft Windows サーバーはサポートしていません。", + "Running ownCloud Server on the Microsoft Windows platform is not supported. We suggest you use a Linux server in a virtual machine if you have no option for migrating the server itself. Find Linux packages as well as easy to deploy virtual machine images on <a href=\"%s\">%s</a>. For migrating existing installations to Linux you can find some tips and a migration script in <a href=\"%s\">our documentation</a>." : "Microsoft Windowsサーバー上での ownCloud の動作は、サポートされていません。現在のサーバーOSを変更することができないのであれば、仮想マシン上で Linuxサーバーを動かすことをお勧めします。仮想マシンイメージを配置するのと同じぐらい簡単にLinuxパッケージを<a href=\"%s\">%s</a>で見つけられます。現在稼働中の設定をLinuxに移行する 移行スクリプトと注意点をこちらの<a href=\"%s\">ドキュメント</a>で確認してください。", "Cannot write into \"config\" directory" : "\"config\" ディレクトリに書き込みができません", "Cannot write into \"apps\" directory" : "\"apps\" ディレクトリに書き込みができません", "This can usually be fixed by %sgiving the webserver write access to the apps directory%s or disabling the appstore in the config file." : "多くの場合、これは %s Webサーバーにappsディレクトリ %s への書き込み権限を与えるか、設定ファイルでアプリストアを無効化することで解決できます。", @@ -141,6 +144,8 @@ OC.L10N.register( "Please make sure you have PostgreSQL >= 9 or check the logs for more information about the error" : "PostgreSQL >= 9 がインストールされているかどうか確認してください。もしくは、ログからエラーに関する詳細な情報を確認してください。", "Please change the permissions to 0770 so that the directory cannot be listed by other users." : "ディレクトリが他のユーザーから見えないように、パーミッションを 0770 に変更してください。", "Data directory (%s) is readable by other users" : "データディレクトリ (%s) は他のユーザーも閲覧することができます", + "Data directory (%s) must be an absolute path" : "データディレクトリ (%s) は、絶対パスである必要があります。", + "Check the value of \"datadirectory\" in your configuration" : "設定ファイル内の \"datadirectory\" の値を確認してください。", "Data directory (%s) is invalid" : "データディレクトリ (%s) は無効です", "Please check that the data directory contains a file \".ocdata\" in its root." : "データディレクトリに \".ocdata\" ファイルが含まれていることを確認してください。", "Could not obtain lock type %d on \"%s\"." : "\"%s\" で %d タイプのロックを取得できませんでした。" diff --git a/lib/l10n/ja.json b/lib/l10n/ja.json index 25bbc7b72fa..d096d48e3c2 100644 --- a/lib/l10n/ja.json +++ b/lib/l10n/ja.json @@ -82,6 +82,7 @@ "Set an admin password." : "管理者のパスワードを設定。", "Can't create or write into the data directory %s" : "%s データディレクトリに作成、書き込みができません", "%s shared »%s« with you" : "%sが あなたと »%s«を共有しました", + "%s via %s" : "%s に %s から", "Sharing %s failed, because the backend does not allow shares from type %i" : "%s の共有に失敗しました。%i タイプからの共有は許可されていないからです。", "Sharing %s failed, because the file does not exist" : "%s の共有に失敗しました。そのようなファイルは存在しないからです。", "You are not allowed to share %s" : "%s を共有することを許可されていません。", @@ -114,6 +115,8 @@ "A valid password must be provided" : "有効なパスワードを指定する必要があります", "The username is already being used" : "ユーザー名はすでに使われています", "No database drivers (sqlite, mysql, or postgresql) installed." : "データベースドライバー (sqlite, mysql, postgresql) がインストールされていません。", + "Microsoft Windows Platform is not supported" : "Microsoft Windows サーバーはサポートしていません。", + "Running ownCloud Server on the Microsoft Windows platform is not supported. We suggest you use a Linux server in a virtual machine if you have no option for migrating the server itself. Find Linux packages as well as easy to deploy virtual machine images on <a href=\"%s\">%s</a>. For migrating existing installations to Linux you can find some tips and a migration script in <a href=\"%s\">our documentation</a>." : "Microsoft Windowsサーバー上での ownCloud の動作は、サポートされていません。現在のサーバーOSを変更することができないのであれば、仮想マシン上で Linuxサーバーを動かすことをお勧めします。仮想マシンイメージを配置するのと同じぐらい簡単にLinuxパッケージを<a href=\"%s\">%s</a>で見つけられます。現在稼働中の設定をLinuxに移行する 移行スクリプトと注意点をこちらの<a href=\"%s\">ドキュメント</a>で確認してください。", "Cannot write into \"config\" directory" : "\"config\" ディレクトリに書き込みができません", "Cannot write into \"apps\" directory" : "\"apps\" ディレクトリに書き込みができません", "This can usually be fixed by %sgiving the webserver write access to the apps directory%s or disabling the appstore in the config file." : "多くの場合、これは %s Webサーバーにappsディレクトリ %s への書き込み権限を与えるか、設定ファイルでアプリストアを無効化することで解決できます。", @@ -139,6 +142,8 @@ "Please make sure you have PostgreSQL >= 9 or check the logs for more information about the error" : "PostgreSQL >= 9 がインストールされているかどうか確認してください。もしくは、ログからエラーに関する詳細な情報を確認してください。", "Please change the permissions to 0770 so that the directory cannot be listed by other users." : "ディレクトリが他のユーザーから見えないように、パーミッションを 0770 に変更してください。", "Data directory (%s) is readable by other users" : "データディレクトリ (%s) は他のユーザーも閲覧することができます", + "Data directory (%s) must be an absolute path" : "データディレクトリ (%s) は、絶対パスである必要があります。", + "Check the value of \"datadirectory\" in your configuration" : "設定ファイル内の \"datadirectory\" の値を確認してください。", "Data directory (%s) is invalid" : "データディレクトリ (%s) は無効です", "Please check that the data directory contains a file \".ocdata\" in its root." : "データディレクトリに \".ocdata\" ファイルが含まれていることを確認してください。", "Could not obtain lock type %d on \"%s\"." : "\"%s\" で %d タイプのロックを取得できませんでした。" diff --git a/lib/l10n/uk.js b/lib/l10n/uk.js index c2a237f894d..44964a0514b 100644 --- a/lib/l10n/uk.js +++ b/lib/l10n/uk.js @@ -115,6 +115,7 @@ OC.L10N.register( "The username is already being used" : "Ім'я користувача вже використовується", "No database drivers (sqlite, mysql, or postgresql) installed." : "Не встановлено драйвер бази даних (sqlite, mysql, or postgresql).", "Microsoft Windows Platform is not supported" : "Платформа Microsoft Windows не підтримується", + "Running ownCloud Server on the Microsoft Windows platform is not supported. We suggest you use a Linux server in a virtual machine if you have no option for migrating the server itself. Find Linux packages as well as easy to deploy virtual machine images on <a href=\"%s\">%s</a>. For migrating existing installations to Linux you can find some tips and a migration script in <a href=\"%s\">our documentation</a>." : "Запуск сервера ownCloud на платформі Microsoft Windows не підтримується. Ми пропонуємо використати сервер на базі Linux у віртуальній машині, якщо у вас немає можливості мігрувати увесь сервер. Знайдіть пакунки для Linux, а також прості у впровадженні образи віртуальних машин на <a href=\"%s\">%s</a>. При міграції існуючих встановлень на Linux ви можете використати деякі поради та скрипт міграції з <a href=\"%s\">нашій документації</a>.", "Cannot write into \"config\" directory" : "Не можу писати у теку \"config\"", "Cannot write into \"apps\" directory" : "Не можу писати у теку \"apps\"", "This can usually be fixed by %sgiving the webserver write access to the apps directory%s or disabling the appstore in the config file." : "Зазвичай це можна виправити, %s надавши веб-серверу права на запис в каталог додатків %s або відключивши сховище програм у файлі конфігурації.", @@ -140,6 +141,8 @@ OC.L10N.register( "Please make sure you have PostgreSQL >= 9 or check the logs for more information about the error" : "Переконайтеся що версія PostgreSQL> = 9 або перевірте журнали для отримання додаткової інформацією про помилку", "Please change the permissions to 0770 so that the directory cannot be listed by other users." : "Змініть права доступу на 0770, щоб інші користувачі не могли отримати список файлів цього каталогу.", "Data directory (%s) is readable by other users" : "Каталог даних (%s) доступний для читання іншим користувачам", + "Data directory (%s) must be an absolute path" : "Тека з даними (%s) має бути задана абсолютним шляхом", + "Check the value of \"datadirectory\" in your configuration" : "Перевірте значення \"datadirectory\" у своїй конфігурації", "Data directory (%s) is invalid" : "Каталог даних (%s) невірний", "Please check that the data directory contains a file \".ocdata\" in its root." : "Переконайтеся, що файл \".ocdata\" присутній у корені каталогу даних.", "Could not obtain lock type %d on \"%s\"." : "Не вдалося отримати блокування типу %d для \"%s\"" diff --git a/lib/l10n/uk.json b/lib/l10n/uk.json index 9e7161c838a..a3ddeb3656a 100644 --- a/lib/l10n/uk.json +++ b/lib/l10n/uk.json @@ -113,6 +113,7 @@ "The username is already being used" : "Ім'я користувача вже використовується", "No database drivers (sqlite, mysql, or postgresql) installed." : "Не встановлено драйвер бази даних (sqlite, mysql, or postgresql).", "Microsoft Windows Platform is not supported" : "Платформа Microsoft Windows не підтримується", + "Running ownCloud Server on the Microsoft Windows platform is not supported. We suggest you use a Linux server in a virtual machine if you have no option for migrating the server itself. Find Linux packages as well as easy to deploy virtual machine images on <a href=\"%s\">%s</a>. For migrating existing installations to Linux you can find some tips and a migration script in <a href=\"%s\">our documentation</a>." : "Запуск сервера ownCloud на платформі Microsoft Windows не підтримується. Ми пропонуємо використати сервер на базі Linux у віртуальній машині, якщо у вас немає можливості мігрувати увесь сервер. Знайдіть пакунки для Linux, а також прості у впровадженні образи віртуальних машин на <a href=\"%s\">%s</a>. При міграції існуючих встановлень на Linux ви можете використати деякі поради та скрипт міграції з <a href=\"%s\">нашій документації</a>.", "Cannot write into \"config\" directory" : "Не можу писати у теку \"config\"", "Cannot write into \"apps\" directory" : "Не можу писати у теку \"apps\"", "This can usually be fixed by %sgiving the webserver write access to the apps directory%s or disabling the appstore in the config file." : "Зазвичай це можна виправити, %s надавши веб-серверу права на запис в каталог додатків %s або відключивши сховище програм у файлі конфігурації.", @@ -138,6 +139,8 @@ "Please make sure you have PostgreSQL >= 9 or check the logs for more information about the error" : "Переконайтеся що версія PostgreSQL> = 9 або перевірте журнали для отримання додаткової інформацією про помилку", "Please change the permissions to 0770 so that the directory cannot be listed by other users." : "Змініть права доступу на 0770, щоб інші користувачі не могли отримати список файлів цього каталогу.", "Data directory (%s) is readable by other users" : "Каталог даних (%s) доступний для читання іншим користувачам", + "Data directory (%s) must be an absolute path" : "Тека з даними (%s) має бути задана абсолютним шляхом", + "Check the value of \"datadirectory\" in your configuration" : "Перевірте значення \"datadirectory\" у своїй конфігурації", "Data directory (%s) is invalid" : "Каталог даних (%s) невірний", "Please check that the data directory contains a file \".ocdata\" in its root." : "Переконайтеся, що файл \".ocdata\" присутній у корені каталогу даних.", "Could not obtain lock type %d on \"%s\"." : "Не вдалося отримати блокування типу %d для \"%s\"" diff --git a/lib/private/api.php b/lib/private/api.php index 119cdb7d1a3..dd50162f03e 100644 --- a/lib/private/api.php +++ b/lib/private/api.php @@ -34,17 +34,33 @@ class OC_API { /** * API authentication levels */ + + /** @deprecated Use \OCP\API::GUEST_AUTH instead */ const GUEST_AUTH = 0; + + /** @deprecated Use \OCP\API::USER_AUTH instead */ const USER_AUTH = 1; + + /** @deprecated Use \OCP\API::SUBADMIN_AUTH instead */ const SUBADMIN_AUTH = 2; + + /** @deprecated Use \OCP\API::ADMIN_AUTH instead */ const ADMIN_AUTH = 3; /** * API Response Codes */ + + /** @deprecated Use \OCP\API::RESPOND_UNAUTHORISED instead */ const RESPOND_UNAUTHORISED = 997; + + /** @deprecated Use \OCP\API::RESPOND_SERVER_ERROR instead */ const RESPOND_SERVER_ERROR = 996; + + /** @deprecated Use \OCP\API::RESPOND_NOT_FOUND instead */ const RESPOND_NOT_FOUND = 998; + + /** @deprecated Use \OCP\API::RESPOND_UNKNOWN_ERROR instead */ const RESPOND_UNKNOWN_ERROR = 999; /** @@ -65,7 +81,7 @@ class OC_API { * @param array $requirements */ public static function register($method, $url, $action, $app, - $authLevel = OC_API::USER_AUTH, + $authLevel = \OCP\API::USER_AUTH, $defaults = array(), $requirements = array()) { $name = strtolower($method).$url; @@ -106,7 +122,7 @@ class OC_API { if(!self::isAuthorised($action)) { $responses[] = array( 'app' => $action['app'], - 'response' => new OC_OCS_Result(null, OC_API::RESPOND_UNAUTHORISED, 'Unauthorised'), + 'response' => new OC_OCS_Result(null, \OCP\API::RESPOND_UNAUTHORISED, 'Unauthorised'), 'shipped' => OC_App::isShipped($action['app']), ); continue; @@ -114,7 +130,7 @@ class OC_API { if(!is_callable($action['action'])) { $responses[] = array( 'app' => $action['app'], - 'response' => new OC_OCS_Result(null, OC_API::RESPOND_NOT_FOUND, 'Api method not found'), + 'response' => new OC_OCS_Result(null, \OCP\API::RESPOND_NOT_FOUND, 'Api method not found'), 'shipped' => OC_App::isShipped($action['app']), ); continue; @@ -172,7 +188,7 @@ class OC_API { // Which shipped response do we use if they all failed? // They may have failed for different reasons (different status codes) // Which response code should we return? - // Maybe any that are not OC_API::RESPOND_SERVER_ERROR + // Maybe any that are not \OCP\API::RESPOND_SERVER_ERROR // Merge failed responses if more than one $data = array(); foreach($shipped['failed'] as $failure) { @@ -235,15 +251,15 @@ class OC_API { private static function isAuthorised($action) { $level = $action['authlevel']; switch($level) { - case OC_API::GUEST_AUTH: + case \OCP\API::GUEST_AUTH: // Anyone can access return true; break; - case OC_API::USER_AUTH: + case \OCP\API::USER_AUTH: // User required return self::loginUser(); break; - case OC_API::SUBADMIN_AUTH: + case \OCP\API::SUBADMIN_AUTH: // Check for subadmin $user = self::loginUser(); if(!$user) { @@ -258,7 +274,7 @@ class OC_API { } } break; - case OC_API::ADMIN_AUTH: + case \OCP\API::ADMIN_AUTH: // Check for admin $user = self::loginUser(); if(!$user) { @@ -325,7 +341,7 @@ class OC_API { */ public static function respond($result, $format='xml') { // Send 401 headers if unauthorised - if($result->getStatusCode() === self::RESPOND_UNAUTHORISED) { + if($result->getStatusCode() === \OCP\API::RESPOND_UNAUTHORISED) { header('WWW-Authenticate: Basic realm="Authorisation Required"'); header('HTTP/1.0 401 Unauthorized'); } @@ -384,7 +400,7 @@ class OC_API { * Based on the requested format the response content type is set */ public static function setContentType() { - $format = \OC_API::requestedFormat(); + $format = self::requestedFormat(); if ($format === 'xml') { header('Content-type: text/xml; charset=UTF-8'); return; diff --git a/lib/private/appframework/http/request.php b/lib/private/appframework/http/request.php index 002c1151adc..2455209cdf3 100644 --- a/lib/private/appframework/http/request.php +++ b/lib/private/appframework/http/request.php @@ -238,7 +238,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { case 'params': case 'urlParams': if(in_array($name, array('put', 'patch'))) { - return $this->getContent($name); + return $this->getContent(); } else { return isset($this->items[$name]) ? $this->items[$name] @@ -252,7 +252,6 @@ class Request implements \ArrayAccess, \Countable, IRequest { return isset($this[$name]) ? $this[$name] : null; - break; } } @@ -360,7 +359,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { * @param string $key the key that will be taken from the $_COOKIE array * @return array the value in the $_COOKIE element */ - function getCookie($key) { + public function getCookie($key) { return isset($this->cookies[$key]) ? $this->cookies[$key] : null; } diff --git a/lib/private/appframework/utility/simplecontainer.php b/lib/private/appframework/utility/simplecontainer.php index 9e80f89e458..c7dff6f4571 100644 --- a/lib/private/appframework/utility/simplecontainer.php +++ b/lib/private/appframework/utility/simplecontainer.php @@ -106,7 +106,7 @@ class SimpleContainer extends \Pimple\Container implements \OCP\IContainer { * @param string $name * @param mixed $value */ - function registerParameter($name, $value) { + public function registerParameter($name, $value) { $this[$name] = $value; } @@ -119,7 +119,7 @@ class SimpleContainer extends \Pimple\Container implements \OCP\IContainer { * @param \Closure $closure the closure to be called on service creation * @param bool $shared */ - function registerService($name, \Closure $closure, $shared = true) { + public function registerService($name, \Closure $closure, $shared = true) { if (isset($this[$name])) { unset($this[$name]); } diff --git a/lib/private/avatarmanager.php b/lib/private/avatarmanager.php index 578ab05d49b..0ff4a3444e2 100644 --- a/lib/private/avatarmanager.php +++ b/lib/private/avatarmanager.php @@ -38,7 +38,7 @@ class AvatarManager implements IAvatarManager { * @param string $user the ownCloud user id * @return \OCP\IAvatar */ - function getAvatar($user) { + public function getAvatar($user) { return new Avatar($user); } } diff --git a/lib/private/backgroundjob.php b/lib/private/backgroundjob.php deleted file mode 100644 index 574109feee1..00000000000 --- a/lib/private/backgroundjob.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * @author Bart Visscher <bartv@thisnet.nl> - * @author Felix Moeller <mail@felixmoeller.de> - * @author Jakob Sack <mail@jakobsack.de> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com> - * - * @copyright Copyright (c) 2015, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -/** - * This class does the dirty work. - */ -class OC_BackgroundJob{ - /** - * get the execution type of background jobs - * @return string - * - * This method returns the type how background jobs are executed. If the user - * did not select something, the type is ajax. - */ - public static function getExecutionType() { - return OC_Appconfig::getValue( 'core', 'backgroundjobs_mode', 'ajax' ); - } - - /** - * sets the background jobs execution type - * @param string $type execution type - * @return false|null - * - * This method sets the execution type of the background jobs. Possible types - * are "none", "ajax", "webcron", "cron" - */ - public static function setExecutionType( $type ) { - if( !in_array( $type, array('none', 'ajax', 'webcron', 'cron'))) { - return false; - } - return OC_Appconfig::setValue( 'core', 'backgroundjobs_mode', $type ); - } -} diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php index 0878b6c60a0..d253afbfa1d 100644 --- a/lib/private/files/cache/scanner.php +++ b/lib/private/files/cache/scanner.php @@ -103,23 +103,10 @@ class Scanner extends BasicEmitter { * @return array an array of metadata of the file */ public function getData($path) { - $permissions = $this->storage->getPermissions($path); - if (!$permissions & \OCP\PERMISSION_READ) { - //cant read, nothing we can do + $data = $this->storage->getMetaData($path); + if (is_null($data)) { \OCP\Util::writeLog('OC\Files\Cache\Scanner', "!!! Path '$path' is not accessible or present !!!", \OCP\Util::DEBUG); - return null; } - $data = array(); - $data['mimetype'] = $this->storage->getMimeType($path); - $data['mtime'] = $this->storage->filemtime($path); - if ($data['mimetype'] == 'httpd/unix-directory') { - $data['size'] = -1; //unknown - } else { - $data['size'] = $this->storage->filesize($path); - } - $data['etag'] = $this->storage->getETag($path); - $data['storage_mtime'] = $data['mtime']; - $data['permissions'] = $permissions; return $data; } diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php index 66ed713e22d..06c61fe6931 100644 --- a/lib/private/files/storage/common.php +++ b/lib/private/files/storage/common.php @@ -580,4 +580,29 @@ abstract class Common implements Storage { } return $result; } + + /** + * @inheritdoc + */ + public function getMetaData($path) { + $permissions = $this->getPermissions($path); + if (!$permissions & \OCP\Constants::PERMISSION_READ) { + //cant read, nothing we can do + return null; + } + + $data = []; + $data['mimetype'] = $this->getMimeType($path); + $data['mtime'] = $this->filemtime($path); + if ($data['mimetype'] == 'httpd/unix-directory') { + $data['size'] = -1; //unknown + } else { + $data['size'] = $this->filesize($path); + } + $data['etag'] = $this->getETag($path); + $data['storage_mtime'] = $data['mtime']; + $data['permissions'] = $this->getPermissions($path); + + return $data; + } } diff --git a/lib/private/files/storage/storage.php b/lib/private/files/storage/storage.php index 4b75fa9da89..07b5633c908 100644 --- a/lib/private/files/storage/storage.php +++ b/lib/private/files/storage/storage.php @@ -70,4 +70,10 @@ interface Storage extends \OCP\Files\Storage { */ public function getStorageCache(); + /** + * @param string $path + * @return array + */ + public function getMetaData($path); + } diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php index 01bd861e3a2..e5c96286f09 100644 --- a/lib/private/files/storage/wrapper/encryption.php +++ b/lib/private/files/storage/wrapper/encryption.php @@ -23,6 +23,8 @@ namespace OC\Files\Storage\Wrapper; use OC\Encryption\Exceptions\ModuleDoesNotExistsException; +use OC\Encryption\File; +use OC\Files\Filesystem; use OC\Files\Storage\LocalTempFileTrait; use OCP\Files\Mount\IMountPoint; @@ -48,7 +50,7 @@ class Encryption extends Wrapper { /** @var array */ private $unencryptedSize; - /** @var \OC\Encryption\File */ + /** @var File */ private $fileHelper; /** @var IMountPoint */ @@ -59,7 +61,7 @@ class Encryption extends Wrapper { * @param \OC\Encryption\Manager $encryptionManager * @param \OC\Encryption\Util $util * @param \OC\Log $logger - * @param \OC\Encryption\File $fileHelper + * @param File $fileHelper * @param string $uid user who perform the read/write operation (null for public access) */ public function __construct( @@ -67,7 +69,7 @@ class Encryption extends Wrapper { \OC\Encryption\Manager $encryptionManager = null, \OC\Encryption\Util $util = null, \OC\Log $logger = null, - \OC\Encryption\File $fileHelper = null, + File $fileHelper = null, $uid = null ) { @@ -111,6 +113,30 @@ class Encryption extends Wrapper { } /** + * @param string $path + * @return array + */ + public function getMetaData($path) { + $data = $this->storage->getMetaData($path); + if (is_null($data)) { + return null; + } + $fullPath = $this->getFullPath($path); + + if (isset($this->unencryptedSize[$fullPath])) { + $data['encrypted'] = true; + $data['size'] = $this->unencryptedSize[$fullPath]; + } else { + $info = $this->getCache()->get($path); + if (isset($info['fileid']) && $info['encrypted']) { + $data['encrypted'] = true; + $data['size'] = $info['size']; + } + } + + return $data; + } + /** * see http://php.net/manual/en/function.file_get_contents.php * * @param string $path @@ -360,7 +386,7 @@ class Encryption extends Wrapper { * @return string full path including mount point */ protected function getFullPath($path) { - return \OC\Files\Filesystem::normalizePath($this->mountPoint . '/' . $path); + return Filesystem::normalizePath($this->mountPoint . '/' . $path); } /** diff --git a/lib/private/files/storage/wrapper/wrapper.php b/lib/private/files/storage/wrapper/wrapper.php index 2552c926e02..f3dc09db138 100644 --- a/lib/private/files/storage/wrapper/wrapper.php +++ b/lib/private/files/storage/wrapper/wrapper.php @@ -525,4 +525,12 @@ class Wrapper implements \OC\Files\Storage\Storage { public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) { return $this->storage->moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath); } + + /** + * @param string $path + * @return array + */ + public function getMetaData($path) { + return $this->storage->getMetaData($path); + } } diff --git a/lib/private/files/stream/encryption.php b/lib/private/files/stream/encryption.php index 4a1df840105..79493311a43 100644 --- a/lib/private/files/stream/encryption.php +++ b/lib/private/files/stream/encryption.php @@ -223,9 +223,8 @@ class Encryption extends Wrapper { || $mode === 'wb+' ) { // We're writing a new file so start write counter with 0 bytes - // TODO can we remove this completely? - //$this->unencryptedSize = 0; - //$this->size = 0; + $this->unencryptedSize = 0; + $this->size = 0; $this->readOnly = false; } else { $this->readOnly = true; @@ -233,7 +232,7 @@ class Encryption extends Wrapper { $sharePath = $this->fullPath; if (!$this->storage->file_exists($this->internalPath)) { - $sharePath = dirname($path); + $sharePath = dirname($sharePath); } $accessList = $this->file->getAccessList($sharePath); diff --git a/lib/private/geo.php b/lib/private/geo.php deleted file mode 100644 index cbc5074dc73..00000000000 --- a/lib/private/geo.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/** - * @author Christopher Schäpers <kondou@ts.unde.re> - * @author Georg Ehrke <georg@owncloud.com> - * @author Lukas Reschke <lukas@owncloud.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin McCorkell <rmccorkell@karoshi.org.uk> - * @author Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @copyright Copyright (c) 2015, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ -class OC_Geo{ - /** - * returns the closest timezone to coordinates - * @param float $latitude - * @param float $longitude - * @return mixed Closest timezone - */ - public static function timezone($latitude, $longitude) { - $alltimezones = DateTimeZone::listIdentifiers(); - $variances = array(); - //calculate for all timezones the system know - foreach($alltimezones as $timezone) { - $datetimezoneobj = new DateTimeZone($timezone); - $locationinformations = $datetimezoneobj->getLocation(); - $latitudeoftimezone = $locationinformations['latitude']; - $longitudeoftimezone = $locationinformations['longitude']; - $variances[abs($latitudeoftimezone - $latitude) + abs($longitudeoftimezone - $longitude)] = $timezone; - } - //sort array and return the timezone with the smallest difference - ksort($variances); - reset($variances); - return current($variances); - } -} diff --git a/lib/private/helper.php b/lib/private/helper.php index 11311d7c55f..35c5147e2fa 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -978,7 +978,6 @@ class OC_Helper { $quota = OC_Util::getUserQuota(\OCP\User::getUser()); if ($quota !== \OCP\Files\FileInfo::SPACE_UNLIMITED) { // always get free space / total space from root + mount points - $path = ''; return self::getGlobalStorageInfo(); } } diff --git a/lib/private/l10n.php b/lib/private/l10n.php index 59f26423afa..b070a299a16 100644 --- a/lib/private/l10n.php +++ b/lib/private/l10n.php @@ -391,13 +391,10 @@ class OC_L10N implements \OCP\IL10N { switch($type) { case 'date': return Punic\Calendar::formatDate($value, $width, $locale); - break; case 'datetime': return Punic\Calendar::formatDatetime($value, $width, $locale); - break; case 'time': return Punic\Calendar::formatTime($value, $width, $locale); - break; default: return false; } diff --git a/lib/private/ocs/cloud.php b/lib/private/ocs/cloud.php index 8d3ed1f1cb4..f662bde2858 100644 --- a/lib/private/ocs/cloud.php +++ b/lib/private/ocs/cloud.php @@ -25,7 +25,7 @@ class OC_OCS_Cloud { - public static function getCapabilities($parameters) { + public static function getCapabilities() { $result = array(); list($major, $minor, $micro) = OC_Util::getVersion(); $result['version'] = array( diff --git a/lib/private/ocs/config.php b/lib/private/ocs/config.php index 295da5b01d3..fc9640b6cc4 100644 --- a/lib/private/ocs/config.php +++ b/lib/private/ocs/config.php @@ -23,7 +23,7 @@ class OC_OCS_Config { - public static function apiConfig($parameters) { + public static function apiConfig() { $xml['version'] = '1.7'; $xml['website'] = 'ownCloud'; $xml['host'] = OCP\Util::getServerHost(); diff --git a/lib/private/ocs/person.php b/lib/private/ocs/person.php index 0e0d75305d1..0059982c55e 100644 --- a/lib/private/ocs/person.php +++ b/lib/private/ocs/person.php @@ -23,7 +23,7 @@ class OC_OCS_Person { - public static function check($parameters) { + public static function check() { $login = isset($_POST['login']) ? $_POST['login'] : false; $password = isset($_POST['password']) ? $_POST['password'] : false; if($login && $password) { diff --git a/lib/private/preview/txt.php b/lib/private/preview/txt.php index 80fd0c7ebb4..ea817388f86 100644 --- a/lib/private/preview/txt.php +++ b/lib/private/preview/txt.php @@ -55,7 +55,7 @@ class TXT extends Provider { $lines = preg_split("/\r\n|\n|\r/", $content); - $fontSize = 5; //5px + $fontSize = ($maxX) ? (int) ((5 / 36) * $maxX) : 5; //5px $lineSize = ceil($fontSize * 1.25); $image = imagecreate($maxX, $maxY); diff --git a/lib/private/response.php b/lib/private/response.php index 018c44d2367..5725af2b893 100644 --- a/lib/private/response.php +++ b/lib/private/response.php @@ -212,9 +212,10 @@ class OC_Response { } /** - * Send file as response, checking and setting caching headers - * @param string $filepath of file to send - */ + * Send file as response, checking and setting caching headers + * @param string $filepath of file to send + * @deprecated 8.1.0 - Use \OCP\AppFramework\Http\StreamResponse or another AppFramework controller instead + */ static public function sendFile($filepath) { $fp = fopen($filepath, 'rb'); if ($fp) { diff --git a/lib/private/route/route.php b/lib/private/route/route.php index cb864d3d73d..b33360f11ec 100644 --- a/lib/private/route/route.php +++ b/lib/private/route/route.php @@ -37,7 +37,7 @@ class Route extends SymfonyRoute implements IRoute { * @return \OC\Route\Route */ public function method($method) { - $this->setRequirement('_method', strtoupper($method)); + $this->setMethods($method); return $this; } @@ -109,7 +109,7 @@ class Route extends SymfonyRoute implements IRoute { * @return \OC\Route\Route */ public function requirements($requirements) { - $method = $this->getRequirement('_method'); + $method = $this->getMethods(); $this->setRequirements($requirements); if (isset($requirements['_method'])) { $method = $requirements['_method']; diff --git a/lib/private/security/certificate.php b/lib/private/security/certificate.php index 468427d0702..0d7fcc4148d 100644 --- a/lib/private/security/certificate.php +++ b/lib/private/security/certificate.php @@ -49,18 +49,18 @@ class Certificate implements ICertificate { */ public function __construct($data, $name) { $this->name = $name; - try { - $gmt = new \DateTimeZone('GMT'); - $info = openssl_x509_parse($data); - $this->commonName = isset($info['subject']['CN']) ? $info['subject']['CN'] : null; - $this->organization = isset($info['subject']['O']) ? $info['subject']['O'] : null; - $this->issueDate = new \DateTime('@' . $info['validFrom_time_t'], $gmt); - $this->expireDate = new \DateTime('@' . $info['validTo_time_t'], $gmt); - $this->issuerName = isset($info['issuer']['CN']) ? $info['issuer']['CN'] : null; - $this->issuerOrganization = isset($info['issuer']['O']) ? $info['issuer']['O'] : null; - } catch (\Exception $e) { + $gmt = new \DateTimeZone('GMT'); + $info = openssl_x509_parse($data); + if(!is_array($info)) { throw new \Exception('Certificate could not get parsed.'); } + + $this->commonName = isset($info['subject']['CN']) ? $info['subject']['CN'] : null; + $this->organization = isset($info['subject']['O']) ? $info['subject']['O'] : null; + $this->issueDate = new \DateTime('@' . $info['validFrom_time_t'], $gmt); + $this->expireDate = new \DateTime('@' . $info['validTo_time_t'], $gmt); + $this->issuerName = isset($info['issuer']['CN']) ? $info['issuer']['CN'] : null; + $this->issuerOrganization = isset($info['issuer']['O']) ? $info['issuer']['O'] : null; } /** diff --git a/lib/private/security/certificatemanager.php b/lib/private/security/certificatemanager.php index beeb87a8316..d61c7f29327 100644 --- a/lib/private/security/certificatemanager.php +++ b/lib/private/security/certificatemanager.php @@ -107,12 +107,12 @@ class CertificateManager implements ICertificateManager { * * @param string $certificate the certificate data * @param string $name the filename for the certificate - * @return \OCP\ICertificate|void|bool + * @return \OCP\ICertificate * @throws \Exception If the certificate could not get added */ public function addCertificate($certificate, $name) { if (!Filesystem::isValidPath($name) or Filesystem::isFileBlacklisted($name)) { - return false; + throw new \Exception('Filename is not valid'); } $dir = $this->getPathToCertificates() . 'uploads/'; diff --git a/lib/private/setup/mssql.php b/lib/private/setup/mssql.php index 8a4904b9243..f8815259af4 100644 --- a/lib/private/setup/mssql.php +++ b/lib/private/setup/mssql.php @@ -32,11 +32,9 @@ class MSSQL extends AbstractDatabase { $masterConnection = @sqlsrv_connect($this->dbhost, $masterConnectionInfo); if(!$masterConnection) { - $entry = null; + $entry = ''; if( ($errors = sqlsrv_errors() ) != null) { $entry='DB Error: "'.print_r(sqlsrv_errors()).'"<br />'; - } else { - $entry = ''; } throw new \OC\DatabaseSetupException($this->trans->t('MS SQL username and/or password not valid: %s', array($entry)), $this->trans->t('You need to enter either an existing account or the administrator.')); diff --git a/lib/private/share/hooks.php b/lib/private/share/hooks.php index 968a2d5c19b..6eff4cc246f 100644 --- a/lib/private/share/hooks.php +++ b/lib/private/share/hooks.php @@ -32,7 +32,7 @@ class Hooks extends \OC\Share\Constants { // Delete any items shared with the deleted user $query = \OC_DB::prepare('DELETE FROM `*PREFIX*share`' .' WHERE `share_with` = ? AND `share_type` = ? OR `share_type` = ?'); - $result = $query->execute(array($arguments['uid'], self::SHARE_TYPE_USER, self::$shareTypeGroupUserUnique)); + $query->execute(array($arguments['uid'], self::SHARE_TYPE_USER, self::$shareTypeGroupUserUnique)); // Delete any items the deleted user shared $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*share` WHERE `uid_owner` = ?'); $result = $query->execute(array($arguments['uid'])); diff --git a/lib/private/subadmin.php b/lib/private/subadmin.php index 10ef87bac18..ec4f9f3b899 100644 --- a/lib/private/subadmin.php +++ b/lib/private/subadmin.php @@ -43,7 +43,7 @@ class OC_SubAdmin{ */ public static function createSubAdmin($uid, $gid) { $stmt = OC_DB::prepare('INSERT INTO `*PREFIX*group_admin` (`gid`,`uid`) VALUES(?,?)'); - $result = $stmt->execute(array($gid, $uid)); + $stmt->execute(array($gid, $uid)); OC_Hook::emit( "OC_SubAdmin", "post_createSubAdmin", array( "gid" => $gid )); return true; } @@ -56,7 +56,7 @@ class OC_SubAdmin{ */ public static function deleteSubAdmin($uid, $gid) { $stmt = OC_DB::prepare('DELETE FROM `*PREFIX*group_admin` WHERE `gid` = ? AND `uid` = ?'); - $result = $stmt->execute(array($gid, $uid)); + $stmt->execute(array($gid, $uid)); OC_Hook::emit( "OC_SubAdmin", "post_deleteSubAdmin", array( "gid" => $gid )); return true; } @@ -177,7 +177,7 @@ class OC_SubAdmin{ */ public static function post_deleteUser($parameters) { $stmt = OC_DB::prepare('DELETE FROM `*PREFIX*group_admin` WHERE `uid` = ?'); - $result = $stmt->execute(array($parameters['uid'])); + $stmt->execute(array($parameters['uid'])); return true; } @@ -188,7 +188,7 @@ class OC_SubAdmin{ */ public static function post_deleteGroup($parameters) { $stmt = OC_DB::prepare('DELETE FROM `*PREFIX*group_admin` WHERE `gid` = ?'); - $result = $stmt->execute(array($parameters['gid'])); + $stmt->execute(array($parameters['gid'])); return true; } } diff --git a/lib/private/tags.php b/lib/private/tags.php index 84ee5c98dfd..6edd7b2f980 100644 --- a/lib/private/tags.php +++ b/lib/private/tags.php @@ -228,9 +228,9 @@ class Tags implements \OCP\ITags { while ($row = $result->fetch()) { $objId = (int)$row['objid']; if (!isset($entries[$objId])) { - $entry = $entries[$objId] = array(); + $entries[$objId] = array(); } - $entry = $entries[$objId][] = $row['category']; + $entries[$objId][] = $row['category']; } if (\OCP\DB::isError($result)) { \OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR); diff --git a/lib/private/template/resourcenotfoundexception.php b/lib/private/template/resourcenotfoundexception.php index a422563d541..26655b78eee 100644 --- a/lib/private/template/resourcenotfoundexception.php +++ b/lib/private/template/resourcenotfoundexception.php @@ -39,6 +39,6 @@ class ResourceNotFoundException extends \LogicException { * @return string */ public function getResourcePath() { - return $this->resource . '/' . $this->webPath; + return $this->webPath . '/' . $this->resource; } } diff --git a/lib/public/api.php b/lib/public/api.php index 7ef6902634c..6b920b6cf52 100644 --- a/lib/public/api.php +++ b/lib/public/api.php @@ -38,17 +38,35 @@ namespace OCP; class API { /** + * API authentication levels + * @since 8.1.0 + */ + const GUEST_AUTH = 0; + const USER_AUTH = 1; + const SUBADMIN_AUTH = 2; + const ADMIN_AUTH = 3; + + /** + * API Response Codes + * @since 8.1.0 + */ + const RESPOND_UNAUTHORISED = 997; + const RESPOND_SERVER_ERROR = 996; + const RESPOND_NOT_FOUND = 998; + const RESPOND_UNKNOWN_ERROR = 999; + + /** * registers an api call * @param string $method the http method * @param string $url the url to match * @param callable $action the function to run * @param string $app the id of the app registering the call - * @param int $authLevel the level of authentication required for the call (See OC_API constants) + * @param int $authLevel the level of authentication required for the call (See `self::*_AUTH` constants) * @param array $defaults * @param array $requirements * @since 5.0.0 */ - public static function register($method, $url, $action, $app, $authLevel = OC_API::USER_AUTH, + public static function register($method, $url, $action, $app, $authLevel = self::USER_AUTH, $defaults = array(), $requirements = array()){ \OC_API::register($method, $url, $action, $app, $authLevel, $defaults, $requirements); } diff --git a/lib/public/app.php b/lib/public/app.php index 3f30e0cd031..13f41025425 100644 --- a/lib/public/app.php +++ b/lib/public/app.php @@ -46,7 +46,7 @@ class App { * @param array $data with all information * @return boolean * - * @deprecated This method is deprecated. Do not call it anymore. + * @deprecated 4.5.0 This method is deprecated. Do not call it anymore. * It'll remain in our public API for compatibility reasons. * */ @@ -72,7 +72,7 @@ class App { * @param array $data containing the data * @return boolean * - * @deprecated Use \OC::$server->getNavigationManager()->add() instead to + * @deprecated 8.1.0 Use \OC::$server->getNavigationManager()->add() instead to * register a closure, this helps to speed up all requests against ownCloud * @since 4.0.0 */ @@ -90,7 +90,7 @@ class App { * property from all other entries. The templates can use this for * highlighting the current position of the user. * - * @deprecated Use \OC::$server->getNavigationManager()->setActiveEntry() instead + * @deprecated 8.1.0 Use \OC::$server->getNavigationManager()->setActiveEntry() instead * @since 4.0.0 */ public static function setActiveNavigationEntry( $id ) { diff --git a/lib/public/appframework/controller.php b/lib/public/appframework/controller.php index 7eff52649ce..b8986c0b772 100644 --- a/lib/public/appframework/controller.php +++ b/lib/public/appframework/controller.php @@ -154,7 +154,7 @@ abstract class Controller { /** * Lets you access post and get parameters by the index - * @deprecated write your parameters as method arguments instead + * @deprecated 7.0.0 write your parameters as method arguments instead * @param string $key the key which you want to access in the URL Parameter * placeholder, $_POST or $_GET array. * The priority how they're returned is the following: @@ -173,7 +173,7 @@ abstract class Controller { /** * Returns all params that were received, be it from the request * (as GET or POST) or through the URL by the route - * @deprecated use $this->request instead + * @deprecated 7.0.0 use $this->request instead * @return array the array with all parameters * @since 6.0.0 */ @@ -184,7 +184,7 @@ abstract class Controller { /** * Returns the method of the request - * @deprecated use $this->request instead + * @deprecated 7.0.0 use $this->request instead * @return string the method of the request (POST, GET, etc) * @since 6.0.0 */ @@ -195,7 +195,7 @@ abstract class Controller { /** * Shortcut for accessing an uploaded file through the $_FILES array - * @deprecated use $this->request instead + * @deprecated 7.0.0 use $this->request instead * @param string $key the key that will be taken from the $_FILES array * @return array the file in the $_FILES element * @since 6.0.0 @@ -207,7 +207,7 @@ abstract class Controller { /** * Shortcut for getting env variables - * @deprecated use $this->request instead + * @deprecated 7.0.0 use $this->request instead * @param string $key the key that will be taken from the $_ENV array * @return array the value in the $_ENV element * @since 6.0.0 @@ -219,7 +219,7 @@ abstract class Controller { /** * Shortcut for getting cookie variables - * @deprecated use $this->request instead + * @deprecated 7.0.0 use $this->request instead * @param string $key the key that will be taken from the $_COOKIE array * @return array the value in the $_COOKIE element * @since 6.0.0 @@ -231,7 +231,7 @@ abstract class Controller { /** * Shortcut for rendering a template - * @deprecated return a template response instead + * @deprecated 7.0.0 return a template response instead * @param string $templateName the name of the template * @param array $params the template parameters in key => value structure * @param string $renderAs user renders a full page, blank only your template diff --git a/lib/public/appframework/iapi.php b/lib/public/appframework/iapi.php index a8df1552b26..2de2a360453 100644 --- a/lib/public/appframework/iapi.php +++ b/lib/public/appframework/iapi.php @@ -33,7 +33,7 @@ namespace OCP\AppFramework; /** * A few very basic and frequently used API functions are combined in here - * @deprecated + * @deprecated 8.0.0 */ interface IApi { @@ -41,14 +41,14 @@ interface IApi { /** * Gets the userid of the current user * @return string the user id of the current user - * @deprecated Use \OC::$server->getUserSession()->getUser()->getUID() + * @deprecated 8.0.0 Use \OC::$server->getUserSession()->getUser()->getUID() */ function getUserId(); /** * Adds a new javascript file - * @deprecated include javascript and css in template files + * @deprecated 8.0.0 include javascript and css in template files * @param string $scriptName the name of the javascript in js/ without the suffix * @param string $appName the name of the app, defaults to the current one * @return void @@ -58,7 +58,7 @@ interface IApi { /** * Adds a new css file - * @deprecated include javascript and css in template files + * @deprecated 8.0.0 include javascript and css in template files * @param string $styleName the name of the css file in css/without the suffix * @param string $appName the name of the app, defaults to the current one * @return void @@ -67,7 +67,7 @@ interface IApi { /** - * @deprecated include javascript and css in template files + * @deprecated 8.0.0 include javascript and css in template files * shorthand for addScript for files in the 3rdparty directory * @param string $name the name of the file without the suffix * @return void @@ -76,7 +76,7 @@ interface IApi { /** - * @deprecated include javascript and css in template files + * @deprecated 8.0.0 include javascript and css in template files * shorthand for addStyle for files in the 3rdparty directory * @param string $name the name of the file without the suffix * @return void @@ -86,7 +86,7 @@ interface IApi { /** * Checks if an app is enabled - * @deprecated communication between apps should happen over built in + * @deprecated 8.0.0 communication between apps should happen over built in * callbacks or interfaces (check the contacts and calendar managers) * Checks if an app is enabled * also use \OC::$server->getAppManager()->isEnabledForUser($appName) diff --git a/lib/public/appframework/iappcontainer.php b/lib/public/appframework/iappcontainer.php index 47eba58aece..64b1082aa97 100644 --- a/lib/public/appframework/iappcontainer.php +++ b/lib/public/appframework/iappcontainer.php @@ -44,7 +44,7 @@ interface IAppContainer extends IContainer { function getAppName(); /** - * @deprecated implements only deprecated methods + * @deprecated 8.0.0 implements only deprecated methods * @return IApi * @since 6.0.0 */ @@ -64,23 +64,21 @@ interface IAppContainer extends IContainer { function registerMiddleWare($middleWare); /** - * @deprecated use IUserSession->isLoggedIn() + * @deprecated 8.0.0 use IUserSession->isLoggedIn() * @return boolean * @since 6.0.0 */ function isLoggedIn(); /** - * @deprecated use IGroupManager->isAdmin($userId) + * @deprecated 8.0.0 use IGroupManager->isAdmin($userId) * @return boolean - * @deprecated use the groupmanager instead to find out if the user is in - * the admin group * @since 6.0.0 */ function isAdminUser(); /** - * @deprecated use the ILogger instead + * @deprecated 8.0.0 use the ILogger instead * @param string $message * @param string $level * @return mixed diff --git a/lib/public/backgroundjob.php b/lib/public/backgroundjob.php index 54addd8f477..42fcf76b876 100644 --- a/lib/public/backgroundjob.php +++ b/lib/public/backgroundjob.php @@ -60,7 +60,7 @@ class BackgroundJob { * @since 5.0.0 */ public static function getExecutionType() { - return \OC_BackgroundJob::getExecutionType(); + return \OC::$server->getConfig()->getAppValue('core', 'backgroundjobs_mode', 'ajax'); } /** @@ -74,7 +74,10 @@ class BackgroundJob { * @since 5.0.0 */ public static function setExecutionType($type) { - return \OC_BackgroundJob::setExecutionType($type); + if( !in_array( $type, array('none', 'ajax', 'webcron', 'cron'))) { + return false; + } + \OC::$server->getConfig()->setAppValue('core', 'backgroundjobs_mode', $type); } /** @@ -89,7 +92,7 @@ class BackgroundJob { } /** - * @deprecated + * @deprecated 6.0.0 * creates a regular task * @param string $klass class name * @param string $method method name @@ -104,7 +107,7 @@ class BackgroundJob { } /** - * @deprecated + * @deprecated 6.0.0 * gets all regular tasks * @return array * @@ -125,7 +128,7 @@ class BackgroundJob { } /** - * @deprecated + * @deprecated 6.0.0 * Gets one queued task * @param int $id ID of the task * @return BackgroundJob\IJob|null @@ -137,7 +140,7 @@ class BackgroundJob { } /** - * @deprecated + * @deprecated 6.0.0 * Gets all queued tasks * @return array an array of associative arrays * @since 4.5.0 @@ -157,7 +160,7 @@ class BackgroundJob { } /** - * @deprecated + * @deprecated 6.0.0 * Gets all queued tasks of a specific app * @param string $app app name * @return array an array of associative arrays @@ -180,7 +183,7 @@ class BackgroundJob { } /** - * @deprecated + * @deprecated 6.0.0 * queues a task * @param string $app app name * @param string $class class name @@ -195,7 +198,7 @@ class BackgroundJob { } /** - * @deprecated + * @deprecated 6.0.0 * deletes a queued task * @param int $id id of task * @return boolean|null diff --git a/lib/public/config.php b/lib/public/config.php index acafdccd4ee..86e18de78e1 100644 --- a/lib/public/config.php +++ b/lib/public/config.php @@ -43,7 +43,7 @@ namespace OCP; /** * This class provides functions to read and write configuration data. * configuration can be on a system, application or user level - * @deprecated use methods of \OCP\IConfig + * @deprecated 8.0.0 use methods of \OCP\IConfig */ class Config { /** @@ -51,7 +51,7 @@ class Config { * @param string $key key * @param mixed $default = null default value * @return mixed the value or $default - * @deprecated use method getSystemValue of \OCP\IConfig + * @deprecated 8.0.0 use method getSystemValue of \OCP\IConfig * * This function gets the value from config.php. If it does not exist, * $default will be returned. @@ -65,7 +65,7 @@ class Config { * @param string $key key * @param mixed $value value * @return bool - * @deprecated use method setSystemValue of \OCP\IConfig + * @deprecated 8.0.0 use method setSystemValue of \OCP\IConfig * * This function sets the value and writes the config.php. If the file can * not be written, false will be returned. @@ -82,7 +82,7 @@ class Config { /** * Deletes a value from config.php * @param string $key key - * @deprecated use method deleteSystemValue of \OCP\IConfig + * @deprecated 8.0.0 use method deleteSystemValue of \OCP\IConfig * * This function deletes the value from config.php. */ @@ -96,7 +96,7 @@ class Config { * @param string $key key * @param string $default = null, default value if the key does not exist * @return string the value or $default - * @deprecated use method getAppValue of \OCP\IConfig + * @deprecated 8.0.0 use method getAppValue of \OCP\IConfig * * This function gets a value from the appconfig table. If the key does * not exist the default value will be returned @@ -111,7 +111,7 @@ class Config { * @param string $key key * @param string $value value * @return boolean true/false - * @deprecated use method setAppValue of \OCP\IConfig + * @deprecated 8.0.0 use method setAppValue of \OCP\IConfig * * Sets a value. If the key did not exist before it will be created. */ @@ -131,7 +131,7 @@ class Config { * @param string $key key * @param string $default = null, default value if the key does not exist * @return string the value or $default - * @deprecated use method getUserValue of \OCP\IConfig + * @deprecated 8.0.0 use method getUserValue of \OCP\IConfig * * This function gets a value from the preferences table. If the key does * not exist the default value will be returned @@ -147,7 +147,7 @@ class Config { * @param string $key key * @param string $value value * @return bool - * @deprecated use method setUserValue of \OCP\IConfig + * @deprecated 8.0.0 use method setUserValue of \OCP\IConfig * * Adds a value to the preferences. If the key did not exist before, it * will be added automagically. diff --git a/lib/public/constants.php b/lib/public/constants.php index e104f767c03..4d44bf24928 100644 --- a/lib/public/constants.php +++ b/lib/public/constants.php @@ -28,25 +28,25 @@ namespace OCP; -/** @deprecated Use \OCP\Constants::PERMISSION_CREATE instead */ +/** @deprecated 8.0.0 Use \OCP\Constants::PERMISSION_CREATE instead */ const PERMISSION_CREATE = 4; -/** @deprecated Use \OCP\Constants::PERMISSION_READ instead */ +/** @deprecated 8.0.0 Use \OCP\Constants::PERMISSION_READ instead */ const PERMISSION_READ = 1; -/** @deprecated Use \OCP\Constants::PERMISSION_UPDATE instead */ +/** @deprecated 8.0.0 Use \OCP\Constants::PERMISSION_UPDATE instead */ const PERMISSION_UPDATE = 2; -/** @deprecated Use \OCP\Constants::PERMISSION_DELETE instead */ +/** @deprecated 8.0.0 Use \OCP\Constants::PERMISSION_DELETE instead */ const PERMISSION_DELETE = 8; -/** @deprecated Use \OCP\Constants::PERMISSION_SHARE instead */ +/** @deprecated 8.0.0 Use \OCP\Constants::PERMISSION_SHARE instead */ const PERMISSION_SHARE = 16; -/** @deprecated Use \OCP\Constants::PERMISSION_ALL instead */ +/** @deprecated 8.0.0 Use \OCP\Constants::PERMISSION_ALL instead */ const PERMISSION_ALL = 31; -/** @deprecated Use \OCP\Constants::FILENAME_INVALID_CHARS instead */ +/** @deprecated 8.0.0 Use \OCP\Constants::FILENAME_INVALID_CHARS instead */ const FILENAME_INVALID_CHARS = "\\/<>:\"|?*\n"; /** @@ -58,6 +58,7 @@ const FILENAME_INVALID_CHARS = "\\/<>:\"|?*\n"; class Constants { /** * CRUDS permissions. + * @since 8.0.0 */ const PERMISSION_CREATE = 4; const PERMISSION_READ = 1; @@ -66,5 +67,8 @@ class Constants { const PERMISSION_SHARE = 16; const PERMISSION_ALL = 31; + /** + * @since 8.0.0 + */ const FILENAME_INVALID_CHARS = "\\/<>:\"|?*\n"; } diff --git a/lib/public/db.php b/lib/public/db.php index 44afc800abc..9c5f9424dcb 100644 --- a/lib/public/db.php +++ b/lib/public/db.php @@ -89,7 +89,7 @@ class DB { * @since 4.5.0 */ public static function insertid($table=null) { - return(\OC_DB::insertid($table)); + return \OC::$server->getDatabaseConnection()->lastInsertId($table); } /** @@ -98,7 +98,7 @@ class DB { * @since 4.5.0 */ public static function beginTransaction() { - \OC_DB::beginTransaction(); + \OC::$server->getDatabaseConnection()->beginTransaction(); } /** @@ -107,7 +107,7 @@ class DB { * @since 4.5.0 */ public static function commit() { - \OC_DB::commit(); + \OC::$server->getDatabaseConnection()->commit(); } /** @@ -116,7 +116,7 @@ class DB { * @since 8.0.0 */ public static function rollback() { - \OC_DB::rollback(); + \OC::$server->getDatabaseConnection()->rollback(); } /** @@ -127,7 +127,8 @@ class DB { * @since 4.5.0 */ public static function isError($result) { - return(\OC_DB::isError($result)); + // Doctrine returns false on error (and throws an exception) + return $result === false; } /** @@ -138,7 +139,7 @@ class DB { * @since 6.0.0 */ public static function getErrorMessage() { - return(\OC_DB::getErrorMessage()); + return \OC::$server->getDatabaseConnection()->getError(); } } diff --git a/lib/public/files.php b/lib/public/files.php index 29c65e48fd6..c1dcffcbefb 100644 --- a/lib/public/files.php +++ b/lib/public/files.php @@ -81,7 +81,7 @@ class Files { * @since 5.0.0 */ public static function streamCopy( $source, $target ) { - list($count, $result) = \OC_Helper::streamCopy( $source, $target ); + list($count, ) = \OC_Helper::streamCopy( $source, $target ); return $count; } @@ -95,7 +95,7 @@ class Files { * @since 5.0.0 */ public static function tmpFile( $postfix='' ) { - return(\OC_Helper::tmpFile( $postfix )); + return \OC::$server->getTempManager()->getTemporaryFile($postfix); } /** @@ -107,7 +107,7 @@ class Files { * @since 5.0.0 */ public static function tmpFolder() { - return(\OC_Helper::tmpFolder()); + return \OC::$server->getTempManager()->getTemporaryFolder(); } /** diff --git a/lib/public/iappconfig.php b/lib/public/iappconfig.php index 5cf704a71a3..d89ffd9194a 100644 --- a/lib/public/iappconfig.php +++ b/lib/public/iappconfig.php @@ -45,7 +45,7 @@ interface IAppConfig { * @param string $key key * @param string $default = null, default value if the key does not exist * @return string the value or $default - * @deprecated use method getAppValue of \OCP\IConfig + * @deprecated 8.0.0 use method getAppValue of \OCP\IConfig * * This function gets a value from the appconfig table. If the key does * not exist the default value will be returned @@ -58,7 +58,7 @@ interface IAppConfig { * @param string $app app * @param string $key key * @return bool - * @deprecated use method deleteAppValue of \OCP\IConfig + * @deprecated 8.0.0 use method deleteAppValue of \OCP\IConfig * @since 7.0.0 */ public function deleteKey($app, $key); @@ -67,7 +67,7 @@ interface IAppConfig { * Get the available keys for an app * @param string $app the app we are looking for * @return array an array of key names - * @deprecated use method getAppKeys of \OCP\IConfig + * @deprecated 8.0.0 use method getAppKeys of \OCP\IConfig * * This function gets all keys of an app. Please note that the values are * not returned. @@ -90,7 +90,7 @@ interface IAppConfig { * @param string $app app * @param string $key key * @param string $value value - * @deprecated use method setAppValue of \OCP\IConfig + * @deprecated 8.0.0 use method setAppValue of \OCP\IConfig * * Sets a value. If the key did not exist before it will be created. * @return void @@ -112,7 +112,7 @@ interface IAppConfig { * Remove app from appconfig * @param string $app app * @return bool - * @deprecated use method deleteAppValue of \OCP\IConfig + * @deprecated 8.0.0 use method deleteAppValue of \OCP\IConfig * * Removes all keys in appconfig belonging to the app. * @since 7.0.0 diff --git a/lib/public/iavatar.php b/lib/public/iavatar.php index 6bf2ce1f19b..fc29212a599 100644 --- a/lib/public/iavatar.php +++ b/lib/public/iavatar.php @@ -37,7 +37,7 @@ interface IAvatar { * @return boolean|\OCP\IImage containing the avatar or false if there's no image * @since 6.0.0 */ - function get($size = 64); + public function get($size = 64); /** * Check if an avatar exists for the user @@ -56,12 +56,12 @@ interface IAvatar { * @return void * @since 6.0.0 */ - function set($data); + public function set($data); /** * remove the users avatar * @return void * @since 6.0.0 */ - function remove(); + public function remove(); } diff --git a/lib/public/iavatarmanager.php b/lib/public/iavatarmanager.php index 583b7f0afca..5ad5bf6a364 100644 --- a/lib/public/iavatarmanager.php +++ b/lib/public/iavatarmanager.php @@ -38,5 +38,5 @@ interface IAvatarManager { * @return \OCP\IAvatar * @since 6.0.0 */ - function getAvatar($user); + public function getAvatar($user); } diff --git a/lib/public/icertificatemanager.php b/lib/public/icertificatemanager.php index ec88f32e291..3014cd8f633 100644 --- a/lib/public/icertificatemanager.php +++ b/lib/public/icertificatemanager.php @@ -38,7 +38,8 @@ interface ICertificateManager { /** * @param string $certificate the certificate data * @param string $name the filename for the certificate - * @return bool | \OCP\ICertificate + * @return \OCP\ICertificate + * @throws \Exception If the certificate could not get added * @since 8.0.0 */ public function addCertificate($certificate, $name); diff --git a/lib/public/icontainer.php b/lib/public/icontainer.php index 27ca544ec67..35bf6a76ce8 100644 --- a/lib/public/icontainer.php +++ b/lib/public/icontainer.php @@ -47,7 +47,7 @@ interface IContainer { * @return mixed * @since 6.0.0 */ - function query($name); + public function query($name); /** * A value is stored in the container with it's corresponding name @@ -57,7 +57,7 @@ interface IContainer { * @return void * @since 6.0.0 */ - function registerParameter($name, $value); + public function registerParameter($name, $value); /** * A service is registered in the container where a closure is passed in which will actually @@ -72,5 +72,5 @@ interface IContainer { * @return void * @since 6.0.0 */ - function registerService($name, \Closure $closure, $shared = true); + public function registerService($name, \Closure $closure, $shared = true); } diff --git a/lib/public/ilogger.php b/lib/public/ilogger.php index c36d9ff285c..43b1ef70e5b 100644 --- a/lib/public/ilogger.php +++ b/lib/public/ilogger.php @@ -39,7 +39,7 @@ interface ILogger { * @return null * @since 7.0.0 */ - function emergency($message, array $context = array()); + public function emergency($message, array $context = array()); /** * Action must be taken immediately. @@ -49,7 +49,7 @@ interface ILogger { * @return null * @since 7.0.0 */ - function alert($message, array $context = array()); + public function alert($message, array $context = array()); /** * Critical conditions. @@ -59,7 +59,7 @@ interface ILogger { * @return null * @since 7.0.0 */ - function critical($message, array $context = array()); + public function critical($message, array $context = array()); /** * Runtime errors that do not require immediate action but should typically @@ -70,7 +70,7 @@ interface ILogger { * @return null * @since 7.0.0 */ - function error($message, array $context = array()); + public function error($message, array $context = array()); /** * Exceptional occurrences that are not errors. @@ -80,7 +80,7 @@ interface ILogger { * @return null * @since 7.0.0 */ - function warning($message, array $context = array()); + public function warning($message, array $context = array()); /** * Normal but significant events. @@ -90,7 +90,7 @@ interface ILogger { * @return null * @since 7.0.0 */ - function notice($message, array $context = array()); + public function notice($message, array $context = array()); /** * Interesting events. @@ -100,7 +100,7 @@ interface ILogger { * @return null * @since 7.0.0 */ - function info($message, array $context = array()); + public function info($message, array $context = array()); /** * Detailed debug information. @@ -110,7 +110,7 @@ interface ILogger { * @return null * @since 7.0.0 */ - function debug($message, array $context = array()); + public function debug($message, array $context = array()); /** * Logs with an arbitrary level. @@ -121,5 +121,5 @@ interface ILogger { * @return mixed * @since 7.0.0 */ - function log($level, $message, array $context = array()); + public function log($level, $message, array $context = array()); } diff --git a/lib/public/irequest.php b/lib/public/irequest.php index a236c5df9a0..20fa543dd69 100644 --- a/lib/public/irequest.php +++ b/lib/public/irequest.php @@ -68,7 +68,7 @@ interface IRequest { * @return string * @since 6.0.0 */ - function getHeader($name); + public function getHeader($name); /** * Lets you access post and get parameters by the index @@ -131,7 +131,7 @@ interface IRequest { * @return array the value in the $_COOKIE element * @since 6.0.0 */ - function getCookie($key); + public function getCookie($key); /** diff --git a/lib/public/isearch.php b/lib/public/isearch.php index bb7ada86e31..f7a9b5fb55c 100644 --- a/lib/public/isearch.php +++ b/lib/public/isearch.php @@ -37,7 +37,7 @@ interface ISearch { * @param string $query * @param string[] $inApps optionally limit results to the given apps * @return array An array of OCP\Search\Result's - * @deprecated use searchPaged() with page and size + * @deprecated 8.0.0 use searchPaged() with page and size * @since 7.0.0 - parameter $inApps was added in 8.0.0 */ public function search($query, array $inApps = array()); diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php index f1eabda033c..9af1582dae9 100644 --- a/lib/public/iservercontainer.php +++ b/lib/public/iservercontainer.php @@ -175,7 +175,7 @@ interface IServerContainer { /** * Returns an instance of the db facade - * @deprecated use getDatabaseConnection, will be removed in ownCloud 10 + * @deprecated 8.1.0 use getDatabaseConnection, will be removed in ownCloud 10 * @return \OCP\IDb * @since 7.0.0 */ @@ -334,7 +334,7 @@ interface IServerContainer { /** * Returns an instance of the HTTP helper class * @return \OC\HTTPHelper - * @deprecated Use \OCP\Http\Client\IClientService + * @deprecated 8.1.0 Use \OCP\Http\Client\IClientService * @since 8.0.0 */ public function getHTTPHelper(); diff --git a/lib/public/json.php b/lib/public/json.php index d07d0014e23..ddb94dffdbe 100644 --- a/lib/public/json.php +++ b/lib/public/json.php @@ -36,14 +36,14 @@ namespace OCP; /** * This class provides convenient functions to generate and send JSON data. Useful for Ajax calls - * @deprecated Use a AppFramework JSONResponse instead + * @deprecated 8.1.0 Use a AppFramework JSONResponse instead */ class JSON { /** * Encode and print $data in JSON format * @param array $data The data to use * @param bool $setContentType the optional content type - * @deprecated Use a AppFramework JSONResponse instead + * @deprecated 8.1.0 Use a AppFramework JSONResponse instead */ public static function encodedPrint( $data, $setContentType=true ) { \OC_JSON::encodedPrint($data, $setContentType); @@ -61,7 +61,7 @@ class JSON { * * Add this call to the start of all ajax method files that requires * an authenticated user. - * @deprecated Use annotation based ACLs from the AppFramework instead + * @deprecated 8.1.0 Use annotation based ACLs from the AppFramework instead */ public static function checkLoggedIn() { \OC_JSON::checkLoggedIn(); @@ -84,7 +84,7 @@ class JSON { * a submittable form, you will need to add the requesttoken first as a * parameter to the ajax call, then assign it to the template and finally * add a hidden input field also named 'requesttoken' containing the value. - * @deprecated Use annotation based CSRF checks from the AppFramework instead + * @deprecated 8.1.0 Use annotation based CSRF checks from the AppFramework instead */ public static function callCheck() { \OC_JSON::callCheck(); @@ -98,7 +98,7 @@ class JSON { * * @param array $data The data to use * @return string json formatted string. - * @deprecated Use a AppFramework JSONResponse instead + * @deprecated 8.1.0 Use a AppFramework JSONResponse instead */ public static function success( $data = array() ) { \OC_JSON::success($data); @@ -121,7 +121,7 @@ class JSON { * * @param array $data The data to use * @return string json formatted error string. - * @deprecated Use a AppFramework JSONResponse instead + * @deprecated 8.1.0 Use a AppFramework JSONResponse instead */ public static function error( $data = array() ) { \OC_JSON::error( $data ); @@ -130,7 +130,7 @@ class JSON { /** * Set Content-Type header to jsonrequest * @param string $type The content type header - * @deprecated Use a AppFramework JSONResponse instead + * @deprecated 8.1.0 Use a AppFramework JSONResponse instead */ public static function setContentTypeHeader( $type='application/json' ) { \OC_JSON::setContentTypeHeader($type); @@ -150,7 +150,7 @@ class JSON { * a specific app to be enabled. * * @param string $app The app to check - * @deprecated Use the AppFramework instead. It will automatically check if the app is enabled. + * @deprecated 8.1.0 Use the AppFramework instead. It will automatically check if the app is enabled. */ public static function checkAppEnabled( $app ) { \OC_JSON::checkAppEnabled($app); @@ -169,7 +169,7 @@ class JSON { * Add this call to the start of all ajax method files that requires * administrative rights. * - * @deprecated Use annotation based ACLs from the AppFramework instead + * @deprecated 8.1.0 Use annotation based ACLs from the AppFramework instead */ public static function checkAdminUser() { \OC_JSON::checkAdminUser(); @@ -179,7 +179,7 @@ class JSON { * Encode JSON * @param array $data * @return string - * @deprecated Use a AppFramework JSONResponse instead + * @deprecated 8.1.0 Use a AppFramework JSONResponse instead */ public static function encode($data) { return \OC_JSON::encode($data); @@ -188,7 +188,7 @@ class JSON { /** * Check is a given user exists - send json error msg if not * @param string $user - * @deprecated Use a AppFramework JSONResponse instead + * @deprecated 8.1.0 Use a AppFramework JSONResponse instead */ public static function checkUserExists($user) { \OC_JSON::checkUserExists($user); diff --git a/lib/public/response.php b/lib/public/response.php index 1942c1ec373..42220e4cf9c 100644 --- a/lib/public/response.php +++ b/lib/public/response.php @@ -37,6 +37,7 @@ namespace OCP; /** * This class provides convenient functions to send the correct http response headers * @since 4.0.0 + * @deprecated 8.1.0 - Use AppFramework controllers instead and modify the response object */ class Response { /** @@ -103,6 +104,7 @@ class Response { * Send file as response, checking and setting caching headers * @param string $filepath of file to send * @since 4.0.0 + * @deprecated 8.1.0 - Use \OCP\AppFramework\Http\StreamResponse or another AppFramework controller instead */ static public function sendFile( $filepath ) { \OC_Response::sendFile( $filepath ); diff --git a/lib/public/template.php b/lib/public/template.php index be891369869..63079c0fc30 100644 --- a/lib/public/template.php +++ b/lib/public/template.php @@ -47,7 +47,7 @@ namespace OCP; * @return string to the image * * @see OC_Helper::imagePath - * @deprecated Use \OCP\Template::image_path() instead + * @deprecated 8.0.0 Use \OCP\Template::image_path() instead */ function image_path( $app, $image ) { return(\image_path( $app, $image )); @@ -58,7 +58,7 @@ function image_path( $app, $image ) { * Make OC_Helper::mimetypeIcon available as a simple function * @param string $mimetype * @return string to the image of this file type. - * @deprecated Use \OCP\Template::mimetype_icon() instead + * @deprecated 8.0.0 Use \OCP\Template::mimetype_icon() instead */ function mimetype_icon( $mimetype ) { return(\mimetype_icon( $mimetype )); @@ -68,7 +68,7 @@ function mimetype_icon( $mimetype ) { * Make preview_icon available as a simple function * @param string $path path to file * @return string to the preview of the image - * @deprecated Use \OCP\Template::preview_icon() instead + * @deprecated 8.0.0 Use \OCP\Template::preview_icon() instead */ function preview_icon( $path ) { return(\preview_icon( $path )); @@ -80,7 +80,7 @@ function preview_icon( $path ) { * @param string $path of file * @param string $token * @return string link to the preview - * @deprecated Use \OCP\Template::publicPreview_icon() instead + * @deprecated 8.0.0 Use \OCP\Template::publicPreview_icon() instead */ function publicPreview_icon ( $path, $token ) { return(\publicPreview_icon( $path, $token )); @@ -91,7 +91,7 @@ function publicPreview_icon ( $path, $token ) { * Example: 2048 to 2 kB. * @param int $bytes in bytes * @return string size as string - * @deprecated Use \OCP\Template::human_file_size() instead + * @deprecated 8.0.0 Use \OCP\Template::human_file_size() instead */ function human_file_size( $bytes ) { return(\human_file_size( $bytes )); @@ -104,7 +104,7 @@ function human_file_size( $bytes ) { * @param boolean $dateOnly * @return \OC_L10N_String human readable interpretation of the timestamp * - * @deprecated Use \OCP\Template::relative_modified_date() instead + * @deprecated 8.0.0 Use \OCP\Template::relative_modified_date() instead */ function relative_modified_date( $timestamp, $dateOnly = false ) { return(\relative_modified_date($timestamp, null, $dateOnly)); @@ -115,7 +115,7 @@ function relative_modified_date( $timestamp, $dateOnly = false ) { * Return a human readable outout for a file size. * @param integer $bytes size of a file in byte * @return string human readable interpretation of a file size - * @deprecated Use \OCP\Template::human_file_size() instead + * @deprecated 8.0.0 Use \OCP\Template::human_file_size() instead */ function simple_file_size($bytes) { return(\human_file_size($bytes)); @@ -128,7 +128,7 @@ function simple_file_size($bytes) { * @param mixed $selected which one is selected? * @param array $params the parameters * @return string html options - * @deprecated Use \OCP\Template::html_select_options() instead + * @deprecated 8.0.0 Use \OCP\Template::html_select_options() instead */ function html_select_options($options, $selected, $params=array()) { return(\html_select_options($options, $selected, $params)); diff --git a/lib/public/user.php b/lib/public/user.php index 24dd7690e3f..e2413e32783 100644 --- a/lib/public/user.php +++ b/lib/public/user.php @@ -48,7 +48,7 @@ class User { /** * Get the user id of the user currently logged in. * @return string uid or false - * @deprecated Use \OC::$server->getUserSession()->getUser()->getUID() + * @deprecated 8.0.0 Use \OC::$server->getUserSession()->getUser()->getUID() * @since 5.0.0 */ public static function getUser() { @@ -116,7 +116,7 @@ class User { /** * Logs the user out including all the session data * Logout, destroys session - * @deprecated Use \OC::$server->getUserSession()->logout(); + * @deprecated 8.0.0 Use \OC::$server->getUserSession()->logout(); * @since 5.0.0 */ public static function logout() { @@ -130,7 +130,7 @@ class User { * @return string|false username on success, false otherwise * * Check if the password is correct without logging in the user - * @deprecated Use \OC::$server->getUserManager()->checkPassword(); + * @deprecated 8.0.0 Use \OC::$server->getUserManager()->checkPassword(); * @since 5.0.0 */ public static function checkPassword( $uid, $password ) { diff --git a/lib/public/util.php b/lib/public/util.php index bc7f1b1f443..6eb5c6034c1 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -83,7 +83,7 @@ class Util { * @param string $ccaddress * @param string $ccname * @param string $bcc - * @deprecated Use \OCP\Mail\IMailer instead + * @deprecated 8.1.0 Use \OCP\Mail\IMailer instead * @since 4.0.0 */ public static function sendMail($toaddress, $toname, $subject, $mailtext, $fromaddress, $fromname, @@ -222,7 +222,7 @@ class Util { * @param DateTimeZone|string $timeZone where the given timestamp shall be converted to * @return string timestamp * - * @deprecated Use \OC::$server->query('DateTimeFormatter') instead + * @deprecated 8.0.0 Use \OC::$server->query('DateTimeFormatter') instead * @since 4.0.0 */ public static function formatDate($timestamp, $dateOnly=false, $timeZone = null) { @@ -233,7 +233,7 @@ class Util { * check if some encrypted files are stored * @return bool * - * @deprecated No longer required + * @deprecated 8.1.0 No longer required * @since 6.0.0 */ public static function encryptedFiles() { @@ -279,7 +279,7 @@ class Util { * @param array $parameters * @internal param array $args with param=>value, will be appended to the returned url * @return string the url - * @deprecated Use \OC::$server->getURLGenerator()->linkToRoute($route, $parameters) + * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkToRoute($route, $parameters) * @since 5.0.0 */ public static function linkToRoute( $route, $parameters = array() ) { @@ -293,7 +293,7 @@ class Util { * @param array $args array with param=>value, will be appended to the returned url * The value of $args will be urlencoded * @return string the url - * @deprecated Use \OC::$server->getURLGenerator()->linkTo($app, $file, $args) + * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkTo($app, $file, $args) * @since 4.0.0 - parameter $args was added in 4.5.0 */ public static function linkTo( $app, $file, $args = array() ) { @@ -303,7 +303,7 @@ class Util { /** * Returns the server host, even if the website uses one or more reverse proxy * @return string the server host - * @deprecated Use \OCP\IRequest::getServerHost + * @deprecated 8.1.0 Use \OCP\IRequest::getServerHost * @since 4.0.0 */ public static function getServerHost() { @@ -359,7 +359,7 @@ class Util { /** * Returns the server protocol. It respects reverse proxy servers and load balancers * @return string the server protocol - * @deprecated Use \OCP\IRequest::getServerProtocol + * @deprecated 8.1.0 Use \OCP\IRequest::getServerProtocol * @since 4.5.0 */ public static function getServerProtocol() { @@ -369,7 +369,7 @@ class Util { /** * Returns the request uri, even if the website uses one or more reverse proxies * @return string the request uri - * @deprecated Use \OCP\IRequest::getRequestUri + * @deprecated 8.1.0 Use \OCP\IRequest::getRequestUri * @since 5.0.0 */ public static function getRequestUri() { @@ -379,7 +379,7 @@ class Util { /** * Returns the script name, even if the website uses one or more reverse proxies * @return string the script name - * @deprecated Use \OCP\IRequest::getScriptName + * @deprecated 8.1.0 Use \OCP\IRequest::getScriptName * @since 5.0.0 */ public static function getScriptName() { @@ -391,11 +391,11 @@ class Util { * @param string $app app * @param string $image image name * @return string the url - * @deprecated Use \OC::$server->getURLGenerator()->imagePath($app, $image) + * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->imagePath($app, $image) * @since 4.0.0 */ public static function imagePath( $app, $image ) { - return(\OC_Helper::imagePath( $app, $image )); + return \OC::$server->getURLGenerator()->imagePath($app, $image); } /** @@ -591,7 +591,7 @@ class Util { * Returns whether the given file name is valid * @param string $file file name to check * @return bool true if the file name is valid, false otherwise - * @deprecated use \OC\Files\View::verifyPath() + * @deprecated 8.1.0 use \OC\Files\View::verifyPath() * @since 7.0.0 */ public static function isValidFileName($file) { @@ -602,7 +602,7 @@ class Util { * Generates a cryptographic secure pseudo-random string * @param int $length of the random string * @return string - * @deprecated Use \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate($length); instead + * @deprecated 8.0.0 Use \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate($length); instead * @since 7.0.0 */ public static function generateRandomBytes($length = 30) { diff --git a/lib/repair/repairlegacystorages.php b/lib/repair/repairlegacystorages.php index 7086f2a8d2d..1bc49678f0d 100644 --- a/lib/repair/repairlegacystorages.php +++ b/lib/repair/repairlegacystorages.php @@ -102,7 +102,7 @@ class RepairLegacyStorages extends BasicEmitter { $newNumericId = (int)$newNumericId; // try and resolve the conflict // check which one of "local::" or "home::" needs to be kept - $result = $this->findStorageInCacheStatement->execute(array($oldNumericId, $newNumericId)); + $this->findStorageInCacheStatement->execute(array($oldNumericId, $newNumericId)); $row1 = $this->findStorageInCacheStatement->fetch(); $row2 = $this->findStorageInCacheStatement->fetch(); $this->findStorageInCacheStatement->closeCursor(); |