diff options
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/api.php | 22 | ||||
-rw-r--r-- | lib/public/app.php | 6 | ||||
-rw-r--r-- | lib/public/appframework/controller.php | 14 | ||||
-rw-r--r-- | lib/public/appframework/iapi.php | 14 | ||||
-rw-r--r-- | lib/public/appframework/iappcontainer.php | 10 | ||||
-rw-r--r-- | lib/public/backgroundjob.php | 21 | ||||
-rw-r--r-- | lib/public/config.php | 16 | ||||
-rw-r--r-- | lib/public/constants.php | 18 | ||||
-rw-r--r-- | lib/public/db.php | 13 | ||||
-rw-r--r-- | lib/public/files.php | 6 | ||||
-rw-r--r-- | lib/public/iappconfig.php | 10 | ||||
-rw-r--r-- | lib/public/iavatar.php | 6 | ||||
-rw-r--r-- | lib/public/iavatarmanager.php | 2 | ||||
-rw-r--r-- | lib/public/icertificatemanager.php | 3 | ||||
-rw-r--r-- | lib/public/icontainer.php | 6 | ||||
-rw-r--r-- | lib/public/ilogger.php | 18 | ||||
-rw-r--r-- | lib/public/irequest.php | 4 | ||||
-rw-r--r-- | lib/public/isearch.php | 2 | ||||
-rw-r--r-- | lib/public/iservercontainer.php | 4 | ||||
-rw-r--r-- | lib/public/json.php | 22 | ||||
-rw-r--r-- | lib/public/response.php | 2 | ||||
-rw-r--r-- | lib/public/template.php | 16 | ||||
-rw-r--r-- | lib/public/user.php | 6 | ||||
-rw-r--r-- | lib/public/util.php | 26 |
24 files changed, 147 insertions, 120 deletions
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) { |