summaryrefslogtreecommitdiff
path: root/platform/www/inc/deprecated.php
blob: 2050373447d875f98a8f4d2bf054cccec664e807 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
<?php
// phpcs:ignoreFile -- this file violates PSR2 by definition
/**
 * These classes and functions are deprecated and will be removed in future releases
 */

use dokuwiki\Debug\DebugHelper;
use dokuwiki\Subscriptions\BulkSubscriptionSender;
use dokuwiki\Subscriptions\MediaSubscriptionSender;
use dokuwiki\Subscriptions\PageSubscriptionSender;
use dokuwiki\Subscriptions\RegistrationSubscriptionSender;
use dokuwiki\Subscriptions\SubscriberManager;

/**
 * @inheritdoc
 * @deprecated 2018-05-07
 */
class RemoteAccessDeniedException extends \dokuwiki\Remote\AccessDeniedException
{
    /** @inheritdoc */
    public function __construct($message = "", $code = 0, Throwable $previous = null)
    {
        dbg_deprecated(\dokuwiki\Remote\AccessDeniedException::class);
        parent::__construct($message, $code, $previous);
    }

}

/**
 * @inheritdoc
 * @deprecated 2018-05-07
 */
class RemoteException extends \dokuwiki\Remote\RemoteException
{
    /** @inheritdoc */
    public function __construct($message = "", $code = 0, Throwable $previous = null)
    {
        dbg_deprecated(\dokuwiki\Remote\RemoteException::class);
        parent::__construct($message, $code, $previous);
    }

}

/**
 * Escapes regex characters other than (, ) and /
 *
 * @param string $str
 * @return string
 * @deprecated 2018-05-04
 */
function Doku_Lexer_Escape($str)
{
    dbg_deprecated('\\dokuwiki\\Parsing\\Lexer\\Lexer::escape()');
    return \dokuwiki\Parsing\Lexer\Lexer::escape($str);
}

/**
 * @inheritdoc
 * @deprecated 2018-06-01
 */
class setting extends \dokuwiki\plugin\config\core\Setting\Setting
{
    /** @inheritdoc */
    public function __construct($key, array $params = null)
    {
        dbg_deprecated(\dokuwiki\plugin\config\core\Setting\Setting::class);
        parent::__construct($key, $params);
    }
}

/**
 * @inheritdoc
 * @deprecated 2018-06-01
 */
class setting_authtype extends \dokuwiki\plugin\config\core\Setting\SettingAuthtype
{
    /** @inheritdoc */
    public function __construct($key, array $params = null)
    {
        dbg_deprecated(\dokuwiki\plugin\config\core\Setting\SettingAuthtype::class);
        parent::__construct($key, $params);
    }
}

/**
 * @inheritdoc
 * @deprecated 2018-06-01
 */
class setting_string extends \dokuwiki\plugin\config\core\Setting\SettingString
{
    /** @inheritdoc */
    public function __construct($key, array $params = null)
    {
        dbg_deprecated(\dokuwiki\plugin\config\core\Setting\SettingString::class);
        parent::__construct($key, $params);
    }
}

/**
 * @inheritdoc
 * @deprecated 2018-06-15
 */
class PageChangelog extends \dokuwiki\ChangeLog\PageChangeLog
{
    /** @inheritdoc */
    public function __construct($id, $chunk_size = 8192)
    {
        dbg_deprecated(\dokuwiki\ChangeLog\PageChangeLog::class);
        parent::__construct($id, $chunk_size);
    }
}

/**
 * @inheritdoc
 * @deprecated 2018-06-15
 */
class MediaChangelog extends \dokuwiki\ChangeLog\MediaChangeLog
{
    /** @inheritdoc */
    public function __construct($id, $chunk_size = 8192)
    {
        dbg_deprecated(\dokuwiki\ChangeLog\MediaChangeLog::class);
        parent::__construct($id, $chunk_size);
    }
}

/** Behavior switch for JSON::decode() */
define('JSON_LOOSE_TYPE', 16);

/** Behavior switch for JSON::decode() */
define('JSON_STRICT_TYPE', 0);

/**
 * Encode/Decode JSON
 * @deprecated 2018-07-27
 */
class JSON
{
    protected $use = 0;

    /**
     * @param int $use JSON_*_TYPE flag
     * @deprecated  2018-07-27
     */
    public function __construct($use = JSON_STRICT_TYPE)
    {
        $this->use = $use;
    }

    /**
     * Encode given structure to JSON
     *
     * @param mixed $var
     * @return string
     * @deprecated  2018-07-27
     */
    public function encode($var)
    {
        dbg_deprecated('json_encode');
        return json_encode($var);
    }

    /**
     * Alias for encode()
     * @param $var
     * @return string
     * @deprecated  2018-07-27
     */
    public function enc($var) {
        return $this->encode($var);
    }

    /**
     * Decode given string from JSON
     *
     * @param string $str
     * @return mixed
     * @deprecated  2018-07-27
     */
    public function decode($str)
    {
        dbg_deprecated('json_encode');
        return json_decode($str, ($this->use == JSON_LOOSE_TYPE));
    }

    /**
     * Alias for decode
     *
     * @param $str
     * @return mixed
     * @deprecated  2018-07-27
     */
    public function dec($str) {
        return $this->decode($str);
    }
}

/**
 * @inheritdoc
 * @deprecated 2019-02-19
 */
class Input extends \dokuwiki\Input\Input {
    /**
     * @inheritdoc
     * @deprecated 2019-02-19
     */
    public function __construct()
    {
        dbg_deprecated(\dokuwiki\Input\Input::class);
        parent::__construct();
    }
}

/**
 * @inheritdoc
 * @deprecated 2019-02-19
 */
class PostInput extends \dokuwiki\Input\Post {
    /**
     * @inheritdoc
     * @deprecated 2019-02-19
     */
    public function __construct()
    {
        dbg_deprecated(\dokuwiki\Input\Post::class);
        parent::__construct();
    }
}

/**
 * @inheritdoc
 * @deprecated 2019-02-19
 */
class GetInput extends \dokuwiki\Input\Get {
    /**
     * @inheritdoc
     * @deprecated 2019-02-19
     */
    public function __construct()
    {
        dbg_deprecated(\dokuwiki\Input\Get::class);
        parent::__construct();
    }
}

/**
 * @inheritdoc
 * @deprecated 2019-02-19
 */
class ServerInput extends \dokuwiki\Input\Server {
    /**
     * @inheritdoc
     * @deprecated 2019-02-19
     */
    public function __construct()
    {
        dbg_deprecated(\dokuwiki\Input\Server::class);
        parent::__construct();
    }
}

/**
 * @inheritdoc
 * @deprecated 2019-03-06
 */
class PassHash extends \dokuwiki\PassHash {
    /**
     * @inheritdoc
     * @deprecated 2019-03-06
     */
    public function __construct()
    {
        dbg_deprecated(\dokuwiki\PassHash::class);
    }
}

/**
 * @deprecated since 2019-03-17 use \dokuwiki\HTTP\HTTPClientException instead!
 */
class HTTPClientException extends \dokuwiki\HTTP\HTTPClientException {

    /**
     * @inheritdoc
     * @deprecated 2019-03-17
     */
    public function __construct($message = '', $code = 0, $previous = null)
    {
        DebugHelper::dbgDeprecatedFunction(dokuwiki\HTTP\HTTPClientException::class);
        parent::__construct($message, $code, $previous);
    }
}

/**
 * @deprecated since 2019-03-17 use \dokuwiki\HTTP\HTTPClient instead!
 */
class HTTPClient extends \dokuwiki\HTTP\HTTPClient {

    /**
     * @inheritdoc
     * @deprecated 2019-03-17
     */
    public function __construct()
    {
        DebugHelper::dbgDeprecatedFunction(dokuwiki\HTTP\HTTPClient::class);
        parent::__construct();
    }
}

/**
 * @deprecated since 2019-03-17 use \dokuwiki\HTTP\DokuHTTPClient instead!
 */
class DokuHTTPClient extends \dokuwiki\HTTP\DokuHTTPClient
{

    /**
     * @inheritdoc
     * @deprecated 2019-03-17
     */
    public function __construct()
    {
        DebugHelper::dbgDeprecatedFunction(dokuwiki\HTTP\DokuHTTPClient::class);
        parent::__construct();
    }
}

/**
 * function wrapper to process (create, trigger and destroy) an event
 *
 * @param  string   $name               name for the event
 * @param  mixed    $data               event data
 * @param  callback $action             (optional, default=NULL) default action, a php callback function
 * @param  bool     $canPreventDefault  (optional, default=true) can hooks prevent the default action
 *
 * @return mixed                        the event results value after all event processing is complete
 *                                      by default this is the return value of the default action however
 *                                      it can be set or modified by event handler hooks
 * @deprecated 2018-06-15
 */
function trigger_event($name, &$data, $action=null, $canPreventDefault=true) {
    dbg_deprecated('\dokuwiki\Extension\Event::createAndTrigger');
    return \dokuwiki\Extension\Event::createAndTrigger($name, $data, $action, $canPreventDefault);
}

/**
 * @inheritdoc
 * @deprecated 2018-06-15
 */
class Doku_Plugin_Controller extends \dokuwiki\Extension\PluginController {
    /** @inheritdoc */
    public function __construct()
    {
        dbg_deprecated(\dokuwiki\Extension\PluginController::class);
        parent::__construct();
    }
}


/**
 * Class for handling (email) subscriptions
 *
 * @author  Adrian Lang <lang@cosmocode.de>
 * @author  Andreas Gohr <andi@splitbrain.org>
 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
 *
 * @deprecated 2019-04-22 Use the classes in the \dokuwiki\Subscriptions namespace instead!
 */
class Subscription {

    /**
     * Check if subscription system is enabled
     *
     * @return bool
     *
     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::isenabled
     */
    public function isenabled() {
        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::isenabled');
        $subscriberManager = new SubscriberManager();
        return $subscriberManager->isenabled();
    }

    /**
     * Recursively search for matching subscriptions
     *
     * This function searches all relevant subscription files for a page or
     * namespace.
     *
     * @author Adrian Lang <lang@cosmocode.de>
     *
     * @param string         $page The target object’s (namespace or page) id
     * @param string|array   $user
     * @param string|array   $style
     * @param string|array   $data
     * @return array
     *
     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::subscribers
     */
    public function subscribers($page, $user = null, $style = null, $data = null) {
        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::subscribers');
        $manager = new SubscriberManager();
        return $manager->subscribers($page, $user, $style, $data);
    }

    /**
     * Adds a new subscription for the given page or namespace
     *
     * This will automatically overwrite any existent subscription for the given user on this
     * *exact* page or namespace. It will *not* modify any subscription that may exist in higher namespaces.
     *
     * @param string $id The target page or namespace, specified by id; Namespaces
     *                   are identified by appending a colon.
     * @param string $user
     * @param string $style
     * @param string $data
     * @throws Exception when user or style is empty
     * @return bool
     *
     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::add
     */
    public function add($id, $user, $style, $data = '') {
        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::add');
        $manager = new SubscriberManager();
        return $manager->add($id, $user, $style, $data);
    }

    /**
     * Removes a subscription for the given page or namespace
     *
     * This removes all subscriptions matching the given criteria on the given page or
     * namespace. It will *not* modify any subscriptions that may exist in higher
     * namespaces.
     *
     * @param string         $id   The target object’s (namespace or page) id
     * @param string|array   $user
     * @param string|array   $style
     * @param string|array   $data
     * @return bool
     *
     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::remove
     */
    public function remove($id, $user = null, $style = null, $data = null) {
        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::remove');
        $manager = new SubscriberManager();
        return $manager->remove($id, $user, $style, $data);
    }

    /**
     * Get data for $INFO['subscribed']
     *
     * $INFO['subscribed'] is either false if no subscription for the current page
     * and user is in effect. Else it contains an array of arrays with the fields
     * “target”, “style”, and optionally “data”.
     *
     * @param string $id  Page ID, defaults to global $ID
     * @param string $user User, defaults to $_SERVER['REMOTE_USER']
     * @return array|false
     * @author Adrian Lang <lang@cosmocode.de>
     *
     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::userSubscription
     */
    public function user_subscription($id = '', $user = '') {
        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::userSubscription');
        $manager = new SubscriberManager();
        return $manager->userSubscription($id, $user);
    }

    /**
     * Send digest and list subscriptions
     *
     * This sends mails to all subscribers that have a subscription for namespaces above
     * the given page if the needed $conf['subscribe_time'] has passed already.
     *
     * This function is called form lib/exe/indexer.php
     *
     * @param string $page
     * @return int number of sent mails
     *
     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\BulkSubscriptionSender::sendBulk
     */
    public function send_bulk($page) {
        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\BulkSubscriptionSender::sendBulk');
        $subscriptionSender = new BulkSubscriptionSender();
        return $subscriptionSender->sendBulk($page);
    }

    /**
     * Send the diff for some page change
     *
     * @param string   $subscriber_mail The target mail address
     * @param string   $template        Mail template ('subscr_digest', 'subscr_single', 'mailtext', ...)
     * @param string   $id              Page for which the notification is
     * @param int|null $rev             Old revision if any
     * @param string   $summary         Change summary if any
     * @return bool                     true if successfully sent
     *
     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\PageSubscriptionSender::sendPageDiff
     */
    public function send_diff($subscriber_mail, $template, $id, $rev = null, $summary = '') {
        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\PageSubscriptionSender::sendPageDiff');
        $subscriptionSender = new PageSubscriptionSender();
        return $subscriptionSender->sendPageDiff($subscriber_mail, $template, $id, $rev, $summary);
    }

    /**
     * Send the diff for some media change
     *
     * @fixme this should embed thumbnails of images in HTML version
     *
     * @param string   $subscriber_mail The target mail address
     * @param string   $template        Mail template ('uploadmail', ...)
     * @param string   $id              Media file for which the notification is
     * @param int|bool $rev             Old revision if any
     *
     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\MediaSubscriptionSender::sendMediaDiff
     */
    public function send_media_diff($subscriber_mail, $template, $id, $rev = false) {
        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\MediaSubscriptionSender::sendMediaDiff');
        $subscriptionSender = new MediaSubscriptionSender();
        return $subscriptionSender->sendMediaDiff($subscriber_mail, $template, $id, $rev);
    }

    /**
     * Send a notify mail on new registration
     *
     * @author Andreas Gohr <andi@splitbrain.org>
     *
     * @param string $login    login name of the new user
     * @param string $fullname full name of the new user
     * @param string $email    email address of the new user
     * @return bool true if a mail was sent
     *
     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\RegistrationSubscriptionSender::sendRegister
     */
    public function send_register($login, $fullname, $email) {
        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\RegistrationSubscriptionSender::sendRegister');
        $subscriptionSender = new RegistrationSubscriptionSender();
        return $subscriptionSender->sendRegister($login, $fullname, $email);
    }


    /**
     * Default callback for COMMON_NOTIFY_ADDRESSLIST
     *
     * Aggregates all email addresses of user who have subscribed the given page with 'every' style
     *
     * @author Steven Danz <steven-danz@kc.rr.com>
     * @author Adrian Lang <lang@cosmocode.de>
     *
     * @todo move the whole functionality into this class, trigger SUBSCRIPTION_NOTIFY_ADDRESSLIST instead,
     *       use an array for the addresses within it
     *
     * @param array &$data Containing the entries:
     *    - $id (the page id),
     *    - $self (whether the author should be notified,
     *    - $addresslist (current email address list)
     *    - $replacements (array of additional string substitutions, @KEY@ to be replaced by value)
     *
     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::notifyAddresses
     */
    public function notifyaddresses(&$data) {
        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::notifyAddresses');
        $manager = new SubscriberManager();
        $manager->notifyAddresses($data);
    }
}

/**
 * @deprecated 2019-12-29 use \dokuwiki\Search\Indexer
 */
class Doku_Indexer extends \dokuwiki\Search\Indexer {};