OpenAPI Generator. Better DocBlock parsing [WIP]
[dokuwiki.git] / inc / deprecated.php
blob9d49392edbf251edbc0a93bbaba30af4ea1722bc
1 <?php
2 // phpcs:ignoreFile -- this file violates PSR2 by definition
3 /**
4 * These classes and functions are deprecated and will be removed in future releases
6 * Note: when adding to this file, please also add appropriate actions to _test/rector.php
7 */
9 use dokuwiki\Debug\DebugHelper;
10 use dokuwiki\Subscriptions\BulkSubscriptionSender;
11 use dokuwiki\Subscriptions\MediaSubscriptionSender;
12 use dokuwiki\Subscriptions\PageSubscriptionSender;
13 use dokuwiki\Subscriptions\RegistrationSubscriptionSender;
14 use dokuwiki\Subscriptions\SubscriberManager;
16 /**
17 * @inheritdoc
18 * @deprecated 2018-05-07
20 class RemoteAccessDeniedException extends \dokuwiki\Remote\AccessDeniedException
22 /** @inheritdoc */
23 public function __construct($message = "", $code = 0, Throwable $previous = null)
25 dbg_deprecated(\dokuwiki\Remote\AccessDeniedException::class);
26 parent::__construct($message, $code, $previous);
31 /**
32 * @inheritdoc
33 * @deprecated 2018-05-07
35 class RemoteException extends \dokuwiki\Remote\RemoteException
37 /** @inheritdoc */
38 public function __construct($message = "", $code = 0, Throwable $previous = null)
40 dbg_deprecated(\dokuwiki\Remote\RemoteException::class);
41 parent::__construct($message, $code, $previous);
46 /**
47 * Escapes regex characters other than (, ) and /
49 * @param string $str
50 * @return string
51 * @deprecated 2018-05-04
53 function Doku_Lexer_Escape($str)
55 dbg_deprecated('\\dokuwiki\\Parsing\\Lexer\\Lexer::escape()');
56 return \dokuwiki\Parsing\Lexer\Lexer::escape($str);
59 /**
60 * @inheritdoc
61 * @deprecated 2018-06-01
63 class setting extends \dokuwiki\plugin\config\core\Setting\Setting
65 /** @inheritdoc */
66 public function __construct($key, array $params = null)
68 dbg_deprecated(\dokuwiki\plugin\config\core\Setting\Setting::class);
69 parent::__construct($key, $params);
73 /**
74 * @inheritdoc
75 * @deprecated 2018-06-01
77 class setting_authtype extends \dokuwiki\plugin\config\core\Setting\SettingAuthtype
79 /** @inheritdoc */
80 public function __construct($key, array $params = null)
82 dbg_deprecated(\dokuwiki\plugin\config\core\Setting\SettingAuthtype::class);
83 parent::__construct($key, $params);
87 /**
88 * @inheritdoc
89 * @deprecated 2018-06-01
91 class setting_string extends \dokuwiki\plugin\config\core\Setting\SettingString
93 /** @inheritdoc */
94 public function __construct($key, array $params = null)
96 dbg_deprecated(\dokuwiki\plugin\config\core\Setting\SettingString::class);
97 parent::__construct($key, $params);
102 * @inheritdoc
103 * @deprecated 2018-06-15
105 class PageChangelog extends \dokuwiki\ChangeLog\PageChangeLog
107 /** @inheritdoc */
108 public function __construct($id, $chunk_size = 8192)
110 dbg_deprecated(\dokuwiki\ChangeLog\PageChangeLog::class);
111 parent::__construct($id, $chunk_size);
116 * @inheritdoc
117 * @deprecated 2018-06-15
119 class MediaChangelog extends \dokuwiki\ChangeLog\MediaChangeLog
121 /** @inheritdoc */
122 public function __construct($id, $chunk_size = 8192)
124 dbg_deprecated(\dokuwiki\ChangeLog\MediaChangeLog::class);
125 parent::__construct($id, $chunk_size);
129 /** Behavior switch for JSON::decode() */
130 define('JSON_LOOSE_TYPE', 16);
132 /** Behavior switch for JSON::decode() */
133 define('JSON_STRICT_TYPE', 0);
136 * Encode/Decode JSON
137 * @deprecated 2018-07-27
139 class JSON
141 protected $use = 0;
144 * @param int $use JSON_*_TYPE flag
145 * @deprecated 2018-07-27
147 public function __construct($use = JSON_STRICT_TYPE)
149 $this->use = $use;
153 * Encode given structure to JSON
155 * @param mixed $var
156 * @return string
157 * @deprecated 2018-07-27
159 public function encode($var)
161 dbg_deprecated('json_encode');
162 return json_encode($var);
166 * Alias for encode()
167 * @param $var
168 * @return string
169 * @deprecated 2018-07-27
171 public function enc($var) {
172 return $this->encode($var);
176 * Decode given string from JSON
178 * @param string $str
179 * @return mixed
180 * @deprecated 2018-07-27
182 public function decode($str)
184 dbg_deprecated('json_encode');
185 return json_decode($str, ($this->use == JSON_LOOSE_TYPE));
189 * Alias for decode
191 * @param $str
192 * @return mixed
193 * @deprecated 2018-07-27
195 public function dec($str) {
196 return $this->decode($str);
201 * @inheritdoc
202 * @deprecated 2019-02-19
204 class Input extends \dokuwiki\Input\Input {
206 * @inheritdoc
207 * @deprecated 2019-02-19
209 public function __construct()
211 dbg_deprecated(\dokuwiki\Input\Input::class);
212 parent::__construct();
217 * @inheritdoc
218 * @deprecated 2019-02-19
220 class PostInput extends \dokuwiki\Input\Post {
222 * @inheritdoc
223 * @deprecated 2019-02-19
225 public function __construct()
227 dbg_deprecated(\dokuwiki\Input\Post::class);
228 parent::__construct();
233 * @inheritdoc
234 * @deprecated 2019-02-19
236 class GetInput extends \dokuwiki\Input\Get {
238 * @inheritdoc
239 * @deprecated 2019-02-19
241 public function __construct()
243 dbg_deprecated(\dokuwiki\Input\Get::class);
244 parent::__construct();
249 * @inheritdoc
250 * @deprecated 2019-02-19
252 class ServerInput extends \dokuwiki\Input\Server {
254 * @inheritdoc
255 * @deprecated 2019-02-19
257 public function __construct()
259 dbg_deprecated(\dokuwiki\Input\Server::class);
260 parent::__construct();
265 * @inheritdoc
266 * @deprecated 2019-03-06
268 class PassHash extends \dokuwiki\PassHash {
270 * @inheritdoc
271 * @deprecated 2019-03-06
273 public function __construct()
275 dbg_deprecated(\dokuwiki\PassHash::class);
280 * @deprecated since 2019-03-17 use \dokuwiki\HTTP\HTTPClientException instead!
282 class HTTPClientException extends \dokuwiki\HTTP\HTTPClientException {
285 * @inheritdoc
286 * @deprecated 2019-03-17
288 public function __construct($message = '', $code = 0, $previous = null)
290 DebugHelper::dbgDeprecatedFunction(dokuwiki\HTTP\HTTPClientException::class);
291 parent::__construct($message, $code, $previous);
296 * @deprecated since 2019-03-17 use \dokuwiki\HTTP\HTTPClient instead!
298 class HTTPClient extends \dokuwiki\HTTP\HTTPClient {
301 * @inheritdoc
302 * @deprecated 2019-03-17
304 public function __construct()
306 DebugHelper::dbgDeprecatedFunction(dokuwiki\HTTP\HTTPClient::class);
307 parent::__construct();
312 * @deprecated since 2019-03-17 use \dokuwiki\HTTP\DokuHTTPClient instead!
314 class DokuHTTPClient extends \dokuwiki\HTTP\DokuHTTPClient
318 * @inheritdoc
319 * @deprecated 2019-03-17
321 public function __construct()
323 DebugHelper::dbgDeprecatedFunction(dokuwiki\HTTP\DokuHTTPClient::class);
324 parent::__construct();
329 * function wrapper to process (create, trigger and destroy) an event
331 * @param string $name name for the event
332 * @param mixed $data event data
333 * @param callback $action (optional, default=NULL) default action, a php callback function
334 * @param bool $canPreventDefault (optional, default=true) can hooks prevent the default action
336 * @return mixed the event results value after all event processing is complete
337 * by default this is the return value of the default action however
338 * it can be set or modified by event handler hooks
339 * @deprecated 2018-06-15
341 function trigger_event($name, &$data, $action=null, $canPreventDefault=true) {
342 dbg_deprecated('\dokuwiki\Extension\Event::createAndTrigger');
343 return \dokuwiki\Extension\Event::createAndTrigger($name, $data, $action, $canPreventDefault);
347 * @inheritdoc
348 * @deprecated 2018-06-15
350 class Doku_Plugin_Controller extends \dokuwiki\Extension\PluginController {
351 /** @inheritdoc */
352 public function __construct()
354 dbg_deprecated(\dokuwiki\Extension\PluginController::class);
355 parent::__construct();
361 * Class for handling (email) subscriptions
363 * @author Adrian Lang <lang@cosmocode.de>
364 * @author Andreas Gohr <andi@splitbrain.org>
365 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
367 * @deprecated 2019-04-22 Use the classes in the \dokuwiki\Subscriptions namespace instead!
369 class Subscription {
372 * Check if subscription system is enabled
374 * @return bool
376 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::isenabled
378 public function isenabled() {
379 DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::isenabled');
380 $subscriberManager = new SubscriberManager();
381 return $subscriberManager->isenabled();
385 * Recursively search for matching subscriptions
387 * This function searches all relevant subscription files for a page or
388 * namespace.
390 * @author Adrian Lang <lang@cosmocode.de>
392 * @param string $page The target object’s (namespace or page) id
393 * @param string|array $user
394 * @param string|array $style
395 * @param string|array $data
396 * @return array
398 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::subscribers
400 public function subscribers($page, $user = null, $style = null, $data = null) {
401 DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::subscribers');
402 $manager = new SubscriberManager();
403 return $manager->subscribers($page, $user, $style, $data);
407 * Adds a new subscription for the given page or namespace
409 * This will automatically overwrite any existent subscription for the given user on this
410 * *exact* page or namespace. It will *not* modify any subscription that may exist in higher namespaces.
412 * @param string $id The target page or namespace, specified by id; Namespaces
413 * are identified by appending a colon.
414 * @param string $user
415 * @param string $style
416 * @param string $data
417 * @throws Exception when user or style is empty
418 * @return bool
420 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::add
422 public function add($id, $user, $style, $data = '') {
423 DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::add');
424 $manager = new SubscriberManager();
425 return $manager->add($id, $user, $style, $data);
429 * Removes a subscription for the given page or namespace
431 * This removes all subscriptions matching the given criteria on the given page or
432 * namespace. It will *not* modify any subscriptions that may exist in higher
433 * namespaces.
435 * @param string $id The target object’s (namespace or page) id
436 * @param string|array $user
437 * @param string|array $style
438 * @param string|array $data
439 * @return bool
441 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::remove
443 public function remove($id, $user = null, $style = null, $data = null) {
444 DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::remove');
445 $manager = new SubscriberManager();
446 return $manager->remove($id, $user, $style, $data);
450 * Get data for $INFO['subscribed']
452 * $INFO['subscribed'] is either false if no subscription for the current page
453 * and user is in effect. Else it contains an array of arrays with the fields
454 * “target”, “style”, and optionally “data”.
456 * @param string $id Page ID, defaults to global $ID
457 * @param string $user User, defaults to $_SERVER['REMOTE_USER']
458 * @return array|false
459 * @author Adrian Lang <lang@cosmocode.de>
461 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::userSubscription
463 public function user_subscription($id = '', $user = '') {
464 DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::userSubscription');
465 $manager = new SubscriberManager();
466 return $manager->userSubscription($id, $user);
470 * Send digest and list subscriptions
472 * This sends mails to all subscribers that have a subscription for namespaces above
473 * the given page if the needed $conf['subscribe_time'] has passed already.
475 * This function is called form lib/exe/indexer.php
477 * @param string $page
478 * @return int number of sent mails
480 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\BulkSubscriptionSender::sendBulk
482 public function send_bulk($page) {
483 DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\BulkSubscriptionSender::sendBulk');
484 $subscriptionSender = new BulkSubscriptionSender();
485 return $subscriptionSender->sendBulk($page);
489 * Send the diff for some page change
491 * @param string $subscriber_mail The target mail address
492 * @param string $template Mail template ('subscr_digest', 'subscr_single', 'mailtext', ...)
493 * @param string $id Page for which the notification is
494 * @param int|null $rev Old revision if any
495 * @param string $summary Change summary if any
496 * @return bool true if successfully sent
498 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\PageSubscriptionSender::sendPageDiff
500 public function send_diff($subscriber_mail, $template, $id, $rev = null, $summary = '') {
501 DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\PageSubscriptionSender::sendPageDiff');
502 $subscriptionSender = new PageSubscriptionSender();
503 return $subscriptionSender->sendPageDiff($subscriber_mail, $template, $id, $rev, $summary);
507 * Send the diff for some media change
509 * @fixme this should embed thumbnails of images in HTML version
511 * @param string $subscriber_mail The target mail address
512 * @param string $template Mail template ('uploadmail', ...)
513 * @param string $id Media file for which the notification is
514 * @param int|bool $rev Old revision if any
516 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\MediaSubscriptionSender::sendMediaDiff
518 public function send_media_diff($subscriber_mail, $template, $id, $rev = false) {
519 DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\MediaSubscriptionSender::sendMediaDiff');
520 $subscriptionSender = new MediaSubscriptionSender();
521 return $subscriptionSender->sendMediaDiff($subscriber_mail, $template, $id, $rev);
525 * Send a notify mail on new registration
527 * @author Andreas Gohr <andi@splitbrain.org>
529 * @param string $login login name of the new user
530 * @param string $fullname full name of the new user
531 * @param string $email email address of the new user
532 * @return bool true if a mail was sent
534 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\RegistrationSubscriptionSender::sendRegister
536 public function send_register($login, $fullname, $email) {
537 DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\RegistrationSubscriptionSender::sendRegister');
538 $subscriptionSender = new RegistrationSubscriptionSender();
539 return $subscriptionSender->sendRegister($login, $fullname, $email);
544 * Default callback for COMMON_NOTIFY_ADDRESSLIST
546 * Aggregates all email addresses of user who have subscribed the given page with 'every' style
548 * @author Steven Danz <steven-danz@kc.rr.com>
549 * @author Adrian Lang <lang@cosmocode.de>
551 * @todo move the whole functionality into this class, trigger SUBSCRIPTION_NOTIFY_ADDRESSLIST instead,
552 * use an array for the addresses within it
554 * @param array &$data Containing the entries:
555 * - $id (the page id),
556 * - $self (whether the author should be notified,
557 * - $addresslist (current email address list)
558 * - $replacements (array of additional string substitutions, @KEY@ to be replaced by value)
560 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::notifyAddresses
562 public function notifyaddresses(&$data) {
563 DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::notifyAddresses');
564 $manager = new SubscriberManager();
565 $manager->notifyAddresses($data);
570 * @deprecated 2019-12-29 use \dokuwiki\Search\Indexer
572 class Doku_Indexer extends \dokuwiki\Search\Indexer {};
575 * @deprecated since 2021-11-11 use \dokuwiki\Remote\IXR\Client instead!
577 class IXR_Client extends \dokuwiki\Remote\IXR\Client
580 * @inheritdoc
581 * @deprecated 2021-11-11
583 public function __construct($server, $path = false, $port = 80, $timeout = 15, $timeout_io = null)
585 DebugHelper::dbgDeprecatedFunction(dokuwiki\Remote\IXR\Client::class);
586 parent::__construct($server, $path, $port, $timeout, $timeout_io);
590 * @deprecated since 2021-11-11 use \IXR\Client\ClientMulticall instead!
592 class IXR_ClientMulticall extends \IXR\Client\ClientMulticall
595 * @inheritdoc
596 * @deprecated 2021-11-11
598 public function __construct($server, $path = false, $port = 80)
600 DebugHelper::dbgDeprecatedFunction(IXR\Client\ClientMulticall::class);
601 parent::__construct($server, $path, $port);
605 * @deprecated since 2021-11-11 use \IXR\Server\Server instead!
607 class IXR_Server extends \IXR\Server\Server
610 * @inheritdoc
611 * @deprecated 2021-11-11
613 public function __construct($callbacks = false, $data = false, $wait = false)
615 DebugHelper::dbgDeprecatedFunction(IXR\Server\Server::class);
616 parent::__construct($callbacks, $data, $wait);
620 * @deprecated since 2021-11-11 use \IXR\Server\IntrospectionServer instead!
622 class IXR_IntrospectionServer extends \IXR\Server\IntrospectionServer
625 * @inheritdoc
626 * @deprecated 2021-11-11
628 public function __construct()
630 DebugHelper::dbgDeprecatedFunction(IXR\Server\IntrospectionServer::class);
631 parent::__construct();
635 * @deprecated since 2021-11-11 use \IXR\Request\Request instead!
637 class IXR_Request extends \IXR\Request\Request
640 * @inheritdoc
641 * @deprecated 2021-11-11
643 public function __construct($method, $args)
645 DebugHelper::dbgDeprecatedFunction(IXR\Request\Request::class);
646 parent::__construct($method, $args);
650 * @deprecated since 2021-11-11 use \IXR\Message\Message instead!
652 class IXR_Message extends IXR\Message\Message
655 * @inheritdoc
656 * @deprecated 2021-11-11
658 public function __construct($message)
660 DebugHelper::dbgDeprecatedFunction(IXR\Message\Message::class);
661 parent::__construct($message);
665 * @deprecated since 2021-11-11 use \IXR\Message\Error instead!
667 class IXR_Error extends \IXR\Message\Error
670 * @inheritdoc
671 * @deprecated 2021-11-11
673 public function __construct($code, $message)
675 DebugHelper::dbgDeprecatedFunction(IXR\Message\Error::class);
676 parent::__construct($code, $message);
680 * @deprecated since 2021-11-11 use \IXR\DataType\Date instead!
682 class IXR_Date extends \IXR\DataType\Date
685 * @inheritdoc
686 * @deprecated 2021-11-11
688 public function __construct($time)
690 DebugHelper::dbgDeprecatedFunction(IXR\DataType\Date::class);
691 parent::__construct($time);
695 * @deprecated since 2021-11-11 use \IXR\DataType\Base64 instead!
697 class IXR_Base64 extends \IXR\DataType\Base64
700 * @inheritdoc
701 * @deprecated 2021-11-11
703 public function __construct($data)
705 DebugHelper::dbgDeprecatedFunction(IXR\DataType\Base64::class);
706 parent::__construct($data);
710 * @deprecated since 2021-11-11 use \IXR\DataType\Value instead!
712 class IXR_Value extends \IXR\DataType\Value
715 * @inheritdoc
716 * @deprecated 2021-11-11
718 public function __construct($data, $type = null)
720 DebugHelper::dbgDeprecatedFunction(IXR\DataType\Value::class);
721 parent::__construct($data, $type);
726 * print a newline terminated string
728 * You can give an indention as optional parameter
730 * @author Andreas Gohr <andi@splitbrain.org>
732 * @param string $string line of text
733 * @param int $indent number of spaces indention
734 * @deprecated 2023-08-31 use echo instead
736 function ptln($string, $indent = 0)
738 DebugHelper::dbgDeprecatedFunction('echo');
739 echo str_repeat(' ', $indent) . "$string\n";