2 // phpcs:ignoreFile -- this file violates PSR2 by definition
4 * These classes and functions are deprecated and will be removed in future releases
7 use dokuwiki\Debug\DebugHelper
;
8 use dokuwiki\Subscriptions\BulkSubscriptionSender
;
9 use dokuwiki\Subscriptions\MediaSubscriptionSender
;
10 use dokuwiki\Subscriptions\PageSubscriptionSender
;
11 use dokuwiki\Subscriptions\RegistrationSubscriptionSender
;
12 use dokuwiki\Subscriptions\SubscriberManager
;
16 * @deprecated 2018-05-07
18 class RemoteAccessDeniedException
extends \dokuwiki\Remote\AccessDeniedException
21 public function __construct($message = "", $code = 0, Throwable
$previous = null)
23 dbg_deprecated(\dokuwiki\Remote\AccessDeniedException
::class);
24 parent
::__construct($message, $code, $previous);
31 * @deprecated 2018-05-07
33 class RemoteException
extends \dokuwiki\Remote\RemoteException
36 public function __construct($message = "", $code = 0, Throwable
$previous = null)
38 dbg_deprecated(\dokuwiki\Remote\RemoteException
::class);
39 parent
::__construct($message, $code, $previous);
45 * Escapes regex characters other than (, ) and /
49 * @deprecated 2018-05-04
51 function Doku_Lexer_Escape($str)
53 dbg_deprecated('\\dokuwiki\\Parsing\\Lexer\\Lexer::escape()');
54 return \dokuwiki\Parsing\Lexer\Lexer
::escape($str);
59 * @deprecated 2018-06-01
61 class setting
extends \dokuwiki\plugin\config\core\Setting\Setting
64 public function __construct($key, array $params = null)
66 dbg_deprecated(\dokuwiki\plugin\config\core\Setting\Setting
::class);
67 parent
::__construct($key, $params);
73 * @deprecated 2018-06-01
75 class setting_authtype
extends \dokuwiki\plugin\config\core\Setting\SettingAuthtype
78 public function __construct($key, array $params = null)
80 dbg_deprecated(\dokuwiki\plugin\config\core\Setting\SettingAuthtype
::class);
81 parent
::__construct($key, $params);
87 * @deprecated 2018-06-01
89 class setting_string
extends \dokuwiki\plugin\config\core\Setting\SettingString
92 public function __construct($key, array $params = null)
94 dbg_deprecated(\dokuwiki\plugin\config\core\Setting\SettingString
::class);
95 parent
::__construct($key, $params);
101 * @deprecated 2018-06-15
103 class PageChangelog
extends \dokuwiki\ChangeLog\PageChangeLog
106 public function __construct($id, $chunk_size = 8192)
108 dbg_deprecated(\dokuwiki\ChangeLog\PageChangeLog
::class);
109 parent
::__construct($id, $chunk_size);
115 * @deprecated 2018-06-15
117 class MediaChangelog
extends \dokuwiki\ChangeLog\MediaChangeLog
120 public function __construct($id, $chunk_size = 8192)
122 dbg_deprecated(\dokuwiki\ChangeLog\MediaChangeLog
::class);
123 parent
::__construct($id, $chunk_size);
127 /** Behavior switch for JSON::decode() */
128 define('JSON_LOOSE_TYPE', 16);
130 /** Behavior switch for JSON::decode() */
131 define('JSON_STRICT_TYPE', 0);
135 * @deprecated 2018-07-27
142 * @param int $use JSON_*_TYPE flag
143 * @deprecated 2018-07-27
145 public function __construct($use = JSON_STRICT_TYPE
)
151 * Encode given structure to JSON
155 * @deprecated 2018-07-27
157 public function encode($var)
159 dbg_deprecated('json_encode');
160 return json_encode($var);
167 * @deprecated 2018-07-27
169 public function enc($var) {
170 return $this->encode($var);
174 * Decode given string from JSON
178 * @deprecated 2018-07-27
180 public function decode($str)
182 dbg_deprecated('json_encode');
183 return json_decode($str, ($this->use == JSON_LOOSE_TYPE
));
191 * @deprecated 2018-07-27
193 public function dec($str) {
194 return $this->decode($str);
200 * @deprecated 2019-02-19
202 class Input
extends \dokuwiki\Input\Input
{
205 * @deprecated 2019-02-19
207 public function __construct()
209 dbg_deprecated(\dokuwiki\Input\Input
::class);
210 parent
::__construct();
216 * @deprecated 2019-02-19
218 class PostInput
extends \dokuwiki\Input\Post
{
221 * @deprecated 2019-02-19
223 public function __construct()
225 dbg_deprecated(\dokuwiki\Input\Post
::class);
226 parent
::__construct();
232 * @deprecated 2019-02-19
234 class GetInput
extends \dokuwiki\Input\Get
{
237 * @deprecated 2019-02-19
239 public function __construct()
241 dbg_deprecated(\dokuwiki\Input\Get
::class);
242 parent
::__construct();
248 * @deprecated 2019-02-19
250 class ServerInput
extends \dokuwiki\Input\Server
{
253 * @deprecated 2019-02-19
255 public function __construct()
257 dbg_deprecated(\dokuwiki\Input\Server
::class);
258 parent
::__construct();
264 * @deprecated 2019-03-06
266 class PassHash
extends \dokuwiki\PassHash
{
269 * @deprecated 2019-03-06
271 public function __construct()
273 dbg_deprecated(\dokuwiki\PassHash
::class);
278 * @deprecated since 2019-03-17 use \dokuwiki\HTTP\HTTPClientException instead!
280 class HTTPClientException
extends \dokuwiki\HTTP\HTTPClientException
{
284 * @deprecated 2019-03-17
286 public function __construct($message = '', $code = 0, $previous = null)
288 DebugHelper
::dbgDeprecatedFunction(dokuwiki\HTTP\HTTPClientException
::class);
289 parent
::__construct($message, $code, $previous);
294 * @deprecated since 2019-03-17 use \dokuwiki\HTTP\HTTPClient instead!
296 class HTTPClient
extends \dokuwiki\HTTP\HTTPClient
{
300 * @deprecated 2019-03-17
302 public function __construct()
304 DebugHelper
::dbgDeprecatedFunction(dokuwiki\HTTP\HTTPClient
::class);
305 parent
::__construct();
310 * @deprecated since 2019-03-17 use \dokuwiki\HTTP\DokuHTTPClient instead!
312 class DokuHTTPClient
extends \dokuwiki\HTTP\DokuHTTPClient
317 * @deprecated 2019-03-17
319 public function __construct()
321 DebugHelper
::dbgDeprecatedFunction(dokuwiki\HTTP\DokuHTTPClient
::class);
322 parent
::__construct();
327 * function wrapper to process (create, trigger and destroy) an event
329 * @param string $name name for the event
330 * @param mixed $data event data
331 * @param callback $action (optional, default=NULL) default action, a php callback function
332 * @param bool $canPreventDefault (optional, default=true) can hooks prevent the default action
334 * @return mixed the event results value after all event processing is complete
335 * by default this is the return value of the default action however
336 * it can be set or modified by event handler hooks
337 * @deprecated 2018-06-15
339 function trigger_event($name, &$data, $action=null, $canPreventDefault=true) {
340 dbg_deprecated('\dokuwiki\Extension\Event::createAndTrigger');
341 return \dokuwiki\Extension\Event
::createAndTrigger($name, $data, $action, $canPreventDefault);
346 * @deprecated 2018-06-15
348 class Doku_Plugin_Controller
extends \dokuwiki\Extension\PluginController
{
350 public function __construct()
352 dbg_deprecated(\dokuwiki\Extension\PluginController
::class);
353 parent
::__construct();
359 * Class for handling (email) subscriptions
361 * @author Adrian Lang <lang@cosmocode.de>
362 * @author Andreas Gohr <andi@splitbrain.org>
363 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
365 * @deprecated 2019-04-22 Use the classes in the \dokuwiki\Subscriptions namespace instead!
370 * Check if subscription system is enabled
374 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::isenabled
376 public function isenabled() {
377 DebugHelper
::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::isenabled');
378 $subscriberManager = new SubscriberManager();
379 return $subscriberManager->isenabled();
383 * Recursively search for matching subscriptions
385 * This function searches all relevant subscription files for a page or
388 * @author Adrian Lang <lang@cosmocode.de>
390 * @param string $page The target object’s (namespace or page) id
391 * @param string|array $user
392 * @param string|array $style
393 * @param string|array $data
396 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::subscribers
398 public function subscribers($page, $user = null, $style = null, $data = null) {
399 DebugHelper
::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::subscribers');
400 $manager = new SubscriberManager();
401 return $manager->subscribers($page, $user, $style, $data);
405 * Adds a new subscription for the given page or namespace
407 * This will automatically overwrite any existent subscription for the given user on this
408 * *exact* page or namespace. It will *not* modify any subscription that may exist in higher namespaces.
410 * @param string $id The target page or namespace, specified by id; Namespaces
411 * are identified by appending a colon.
412 * @param string $user
413 * @param string $style
414 * @param string $data
415 * @throws Exception when user or style is empty
418 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::add
420 public function add($id, $user, $style, $data = '') {
421 DebugHelper
::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::add');
422 $manager = new SubscriberManager();
423 return $manager->add($id, $user, $style, $data);
427 * Removes a subscription for the given page or namespace
429 * This removes all subscriptions matching the given criteria on the given page or
430 * namespace. It will *not* modify any subscriptions that may exist in higher
433 * @param string $id The target object’s (namespace or page) id
434 * @param string|array $user
435 * @param string|array $style
436 * @param string|array $data
439 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::remove
441 public function remove($id, $user = null, $style = null, $data = null) {
442 DebugHelper
::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::remove');
443 $manager = new SubscriberManager();
444 return $manager->remove($id, $user, $style, $data);
448 * Get data for $INFO['subscribed']
450 * $INFO['subscribed'] is either false if no subscription for the current page
451 * and user is in effect. Else it contains an array of arrays with the fields
452 * “target”, “style”, and optionally “data”.
454 * @param string $id Page ID, defaults to global $ID
455 * @param string $user User, defaults to $_SERVER['REMOTE_USER']
456 * @return array|false
457 * @author Adrian Lang <lang@cosmocode.de>
459 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::userSubscription
461 public function user_subscription($id = '', $user = '') {
462 DebugHelper
::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::userSubscription');
463 $manager = new SubscriberManager();
464 return $manager->userSubscription($id, $user);
468 * Send digest and list subscriptions
470 * This sends mails to all subscribers that have a subscription for namespaces above
471 * the given page if the needed $conf['subscribe_time'] has passed already.
473 * This function is called form lib/exe/indexer.php
475 * @param string $page
476 * @return int number of sent mails
478 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\BulkSubscriptionSender::sendBulk
480 public function send_bulk($page) {
481 DebugHelper
::dbgDeprecatedFunction('\dokuwiki\Subscriptions\BulkSubscriptionSender::sendBulk');
482 $subscriptionSender = new BulkSubscriptionSender();
483 return $subscriptionSender->sendBulk($page);
487 * Send the diff for some page change
489 * @param string $subscriber_mail The target mail address
490 * @param string $template Mail template ('subscr_digest', 'subscr_single', 'mailtext', ...)
491 * @param string $id Page for which the notification is
492 * @param int|null $rev Old revision if any
493 * @param string $summary Change summary if any
494 * @return bool true if successfully sent
496 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\PageSubscriptionSender::sendPageDiff
498 public function send_diff($subscriber_mail, $template, $id, $rev = null, $summary = '') {
499 DebugHelper
::dbgDeprecatedFunction('\dokuwiki\Subscriptions\PageSubscriptionSender::sendPageDiff');
500 $subscriptionSender = new PageSubscriptionSender();
501 return $subscriptionSender->sendPageDiff($subscriber_mail, $template, $id, $rev, $summary);
505 * Send the diff for some media change
507 * @fixme this should embed thumbnails of images in HTML version
509 * @param string $subscriber_mail The target mail address
510 * @param string $template Mail template ('uploadmail', ...)
511 * @param string $id Media file for which the notification is
512 * @param int|bool $rev Old revision if any
514 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\MediaSubscriptionSender::sendMediaDiff
516 public function send_media_diff($subscriber_mail, $template, $id, $rev = false) {
517 DebugHelper
::dbgDeprecatedFunction('\dokuwiki\Subscriptions\MediaSubscriptionSender::sendMediaDiff');
518 $subscriptionSender = new MediaSubscriptionSender();
519 return $subscriptionSender->sendMediaDiff($subscriber_mail, $template, $id, $rev);
523 * Send a notify mail on new registration
525 * @author Andreas Gohr <andi@splitbrain.org>
527 * @param string $login login name of the new user
528 * @param string $fullname full name of the new user
529 * @param string $email email address of the new user
530 * @return bool true if a mail was sent
532 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\RegistrationSubscriptionSender::sendRegister
534 public function send_register($login, $fullname, $email) {
535 DebugHelper
::dbgDeprecatedFunction('\dokuwiki\Subscriptions\RegistrationSubscriptionSender::sendRegister');
536 $subscriptionSender = new RegistrationSubscriptionSender();
537 return $subscriptionSender->sendRegister($login, $fullname, $email);
542 * Default callback for COMMON_NOTIFY_ADDRESSLIST
544 * Aggregates all email addresses of user who have subscribed the given page with 'every' style
546 * @author Steven Danz <steven-danz@kc.rr.com>
547 * @author Adrian Lang <lang@cosmocode.de>
549 * @todo move the whole functionality into this class, trigger SUBSCRIPTION_NOTIFY_ADDRESSLIST instead,
550 * use an array for the addresses within it
552 * @param array &$data Containing the entries:
553 * - $id (the page id),
554 * - $self (whether the author should be notified,
555 * - $addresslist (current email address list)
556 * - $replacements (array of additional string substitutions, @KEY@ to be replaced by value)
558 * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::notifyAddresses
560 public function notifyaddresses(&$data) {
561 DebugHelper
::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::notifyAddresses');
562 $manager = new SubscriberManager();
563 $manager->notifyAddresses($data);
568 * @deprecated 2019-12-29 use \dokuwiki\Search\Indexer
570 class Doku_Indexer
extends \dokuwiki\Search\Indexer
{};