Skip to content

Commit 60821ee

Browse files
author
Robin McCorkell
committed
Merge pull request #15366 from rullzer/deprecate_util_links
Deprecate functions (OC_Helper + OCP\Util) that only call the urlgenerator anyway
2 parents 46e43d4 + 288da61 commit 60821ee

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/private/helper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ class OC_Helper {
132132
* @return
133133
* @internal param array $args with param=>value, will be appended to the returned url
134134
* @return string the url
135+
* @deprecated Use \OC::$server->getURLGenerator()->linkToRoute($route, $parameters)
135136
*
136137
* Returns a url to the given app and file.
137138
*/
@@ -146,6 +147,7 @@ public static function linkToRoute($route, $parameters = array()) {
146147
* @param array $args array with param=>value, will be appended to the returned url
147148
* The value of $args will be urlencoded
148149
* @return string the url
150+
* @deprecated Use \OC::$server->getURLGenerator()->linkTo($app, $file, $args)
149151
*
150152
* Returns a url to the given app and file.
151153
*/
@@ -156,6 +158,7 @@ public static function linkTo( $app, $file, $args = array() ) {
156158
/**
157159
* @param string $key
158160
* @return string url to the online documentation
161+
* @deprecated Use \OC::$server->getURLGenerator()->linkToDocs($key)
159162
*/
160163
public static function linkToDocs($key) {
161164
return OC::$server->getURLGenerator()->linkToDocs($key);
@@ -181,6 +184,7 @@ public static function linkToAbsolute($app, $file, $args = array()) {
181184
* Makes an $url absolute
182185
* @param string $url the url
183186
* @return string the absolute url
187+
* @deprecated Use \OC::$server->getURLGenerator()->getAbsoluteURL($url)
184188
*
185189
* Returns a absolute url to the given app and file.
186190
*/
@@ -236,6 +240,7 @@ public static function linkToPublic($service, $add_slash = false) {
236240
* @param string $app app
237241
* @param string $image image name
238242
* @return string the url
243+
* @deprecated Use \OC::$server->getURLGenerator()->imagePath($app, $image)
239244
*
240245
* Returns the path to the image.
241246
*/

lib/public/util.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ public static function linkToPublic($service) {
260260
* @param array $parameters
261261
* @internal param array $args with param=>value, will be appended to the returned url
262262
* @return string the url
263+
* @deprecated Use \OC::$server->getURLGenerator()->linkToRoute($route, $parameters)
263264
*/
264265
public static function linkToRoute( $route, $parameters = array() ) {
265266
return \OC_Helper::linkToRoute($route, $parameters);
@@ -272,6 +273,7 @@ public static function linkToRoute( $route, $parameters = array() ) {
272273
* @param array $args array with param=>value, will be appended to the returned url
273274
* The value of $args will be urlencoded
274275
* @return string the url
276+
* @deprecated Use \OC::$server->getURLGenerator()->linkTo($app, $file, $args)
275277
*/
276278
public static function linkTo( $app, $file, $args = array() ) {
277279
return(\OC_Helper::linkTo( $app, $file, $args ));
@@ -362,6 +364,7 @@ public static function getScriptName() {
362364
* @param string $app app
363365
* @param string $image image name
364366
* @return string the url
367+
* @deprecated Use \OC::$server->getURLGenerator()->imagePath($app, $image)
365368
*/
366369
public static function imagePath( $app, $image ) {
367370
return(\OC_Helper::imagePath( $app, $image ));

0 commit comments

Comments
 (0)