xref: /dokuwiki/inc/deprecated.php (revision 451969ab7559b14e82720d165019a94010752965)
14cdb6842SAndreas Gohr<?php
2b78f68bcSAndreas Gohr// phpcs:ignoreFile -- this file violates PSR2 by definition
34cdb6842SAndreas Gohr/**
44cdb6842SAndreas Gohr * These classes and functions are deprecated and will be removed in future releases
54cdb6842SAndreas Gohr */
64cdb6842SAndreas Gohr
7*451969abSMichael Großeuse dokuwiki\Debug\DebugHelper;
8*451969abSMichael Großeuse dokuwiki\Subscriptions\BulkSubscriptionSender;
9*451969abSMichael Großeuse dokuwiki\Subscriptions\MediaSubscriptionSender;
10*451969abSMichael Großeuse dokuwiki\Subscriptions\PageSubscriptionSender;
11*451969abSMichael Großeuse dokuwiki\Subscriptions\RegistrationSubscriptionSender;
12*451969abSMichael Großeuse dokuwiki\Subscriptions\SubscriberManager;
13*451969abSMichael Große
144cdb6842SAndreas Gohr/**
154cdb6842SAndreas Gohr * @inheritdoc
164cdb6842SAndreas Gohr * @deprecated 2018-05-07
174cdb6842SAndreas Gohr */
18d443762bSAndreas Gohrclass RemoteAccessDeniedException extends \dokuwiki\Remote\AccessDeniedException
19d443762bSAndreas Gohr{
204cdb6842SAndreas Gohr    /** @inheritdoc */
21d443762bSAndreas Gohr    public function __construct($message = "", $code = 0, Throwable $previous = null)
22d443762bSAndreas Gohr    {
23a6e1db4aSAndreas Gohr        dbg_deprecated(\dokuwiki\Remote\AccessDeniedException::class);
244cdb6842SAndreas Gohr        parent::__construct($message, $code, $previous);
254cdb6842SAndreas Gohr    }
264cdb6842SAndreas Gohr
274cdb6842SAndreas Gohr}
284cdb6842SAndreas Gohr
294cdb6842SAndreas Gohr/**
304cdb6842SAndreas Gohr * @inheritdoc
314cdb6842SAndreas Gohr * @deprecated 2018-05-07
324cdb6842SAndreas Gohr */
33d443762bSAndreas Gohrclass RemoteException extends \dokuwiki\Remote\RemoteException
34d443762bSAndreas Gohr{
354cdb6842SAndreas Gohr    /** @inheritdoc */
36d443762bSAndreas Gohr    public function __construct($message = "", $code = 0, Throwable $previous = null)
37d443762bSAndreas Gohr    {
38a6e1db4aSAndreas Gohr        dbg_deprecated(\dokuwiki\Remote\RemoteException::class);
394cdb6842SAndreas Gohr        parent::__construct($message, $code, $previous);
404cdb6842SAndreas Gohr    }
414cdb6842SAndreas Gohr
424cdb6842SAndreas Gohr}
434cdb6842SAndreas Gohr
444cdb6842SAndreas Gohr/**
454cdb6842SAndreas Gohr * Escapes regex characters other than (, ) and /
464cdb6842SAndreas Gohr *
474cdb6842SAndreas Gohr * @param string $str
484cdb6842SAndreas Gohr * @return string
494cdb6842SAndreas Gohr * @deprecated 2018-05-04
504cdb6842SAndreas Gohr */
51d443762bSAndreas Gohrfunction Doku_Lexer_Escape($str)
52d443762bSAndreas Gohr{
53a6e1db4aSAndreas Gohr    dbg_deprecated('\\dokuwiki\\Parsing\\Lexer\\Lexer::escape()');
544cdb6842SAndreas Gohr    return \dokuwiki\Parsing\Lexer\Lexer::escape($str);
554cdb6842SAndreas Gohr}
56a6e1db4aSAndreas Gohr
57a6e1db4aSAndreas Gohr/**
58a6e1db4aSAndreas Gohr * @inheritdoc
59a6e1db4aSAndreas Gohr * @deprecated 2018-06-01
60a6e1db4aSAndreas Gohr */
61d443762bSAndreas Gohrclass setting extends \dokuwiki\plugin\config\core\Setting\Setting
62d443762bSAndreas Gohr{
63a6e1db4aSAndreas Gohr    /** @inheritdoc */
64d443762bSAndreas Gohr    public function __construct($key, array $params = null)
65d443762bSAndreas Gohr    {
66a6e1db4aSAndreas Gohr        dbg_deprecated(\dokuwiki\plugin\config\core\Setting\Setting::class);
67a6e1db4aSAndreas Gohr        parent::__construct($key, $params);
68a6e1db4aSAndreas Gohr    }
69a6e1db4aSAndreas Gohr}
70a6e1db4aSAndreas Gohr
71a6e1db4aSAndreas Gohr/**
72a6e1db4aSAndreas Gohr * @inheritdoc
73a6e1db4aSAndreas Gohr * @deprecated 2018-06-01
74a6e1db4aSAndreas Gohr */
75d443762bSAndreas Gohrclass setting_authtype extends \dokuwiki\plugin\config\core\Setting\SettingAuthtype
76d443762bSAndreas Gohr{
77a6e1db4aSAndreas Gohr    /** @inheritdoc */
78d443762bSAndreas Gohr    public function __construct($key, array $params = null)
79d443762bSAndreas Gohr    {
80a6e1db4aSAndreas Gohr        dbg_deprecated(\dokuwiki\plugin\config\core\Setting\SettingAuthtype::class);
81a6e1db4aSAndreas Gohr        parent::__construct($key, $params);
82a6e1db4aSAndreas Gohr    }
83a6e1db4aSAndreas Gohr}
84a6e1db4aSAndreas Gohr
85a6e1db4aSAndreas Gohr/**
86a6e1db4aSAndreas Gohr * @inheritdoc
87a6e1db4aSAndreas Gohr * @deprecated 2018-06-01
88a6e1db4aSAndreas Gohr */
89d443762bSAndreas Gohrclass setting_string extends \dokuwiki\plugin\config\core\Setting\SettingString
90d443762bSAndreas Gohr{
91a6e1db4aSAndreas Gohr    /** @inheritdoc */
92d443762bSAndreas Gohr    public function __construct($key, array $params = null)
93d443762bSAndreas Gohr    {
94a6e1db4aSAndreas Gohr        dbg_deprecated(\dokuwiki\plugin\config\core\Setting\SettingString::class);
95a6e1db4aSAndreas Gohr        parent::__construct($key, $params);
96a6e1db4aSAndreas Gohr    }
97a6e1db4aSAndreas Gohr}
980c3a5702SAndreas Gohr
990c3a5702SAndreas Gohr/**
1000c3a5702SAndreas Gohr * @inheritdoc
1010c3a5702SAndreas Gohr * @deprecated 2018-06-15
1020c3a5702SAndreas Gohr */
103d443762bSAndreas Gohrclass PageChangelog extends \dokuwiki\ChangeLog\PageChangeLog
104d443762bSAndreas Gohr{
1050c3a5702SAndreas Gohr    /** @inheritdoc */
1060c3a5702SAndreas Gohr    public function __construct($id, $chunk_size = 8192)
1070c3a5702SAndreas Gohr    {
1080c3a5702SAndreas Gohr        dbg_deprecated(\dokuwiki\ChangeLog\PageChangeLog::class);
1090c3a5702SAndreas Gohr        parent::__construct($id, $chunk_size);
1100c3a5702SAndreas Gohr    }
1110c3a5702SAndreas Gohr}
1120c3a5702SAndreas Gohr
1130c3a5702SAndreas Gohr/**
1140c3a5702SAndreas Gohr * @inheritdoc
1150c3a5702SAndreas Gohr * @deprecated 2018-06-15
1160c3a5702SAndreas Gohr */
117d443762bSAndreas Gohrclass MediaChangelog extends \dokuwiki\ChangeLog\MediaChangeLog
118d443762bSAndreas Gohr{
1190c3a5702SAndreas Gohr    /** @inheritdoc */
1200c3a5702SAndreas Gohr    public function __construct($id, $chunk_size = 8192)
1210c3a5702SAndreas Gohr    {
1220c3a5702SAndreas Gohr        dbg_deprecated(\dokuwiki\ChangeLog\MediaChangeLog::class);
1230c3a5702SAndreas Gohr        parent::__construct($id, $chunk_size);
1240c3a5702SAndreas Gohr    }
1250c3a5702SAndreas Gohr}
126d443762bSAndreas Gohr
127d443762bSAndreas Gohr/** Behavior switch for JSON::decode() */
128d443762bSAndreas Gohrdefine('JSON_LOOSE_TYPE', 16);
129d443762bSAndreas Gohr
130d443762bSAndreas Gohr/** Behavior switch for JSON::decode() */
131d443762bSAndreas Gohrdefine('JSON_STRICT_TYPE', 0);
132d443762bSAndreas Gohr
133d443762bSAndreas Gohr/**
134d443762bSAndreas Gohr * Encode/Decode JSON
135d443762bSAndreas Gohr * @deprecated 2018-07-27
136d443762bSAndreas Gohr */
137d443762bSAndreas Gohrclass JSON
138d443762bSAndreas Gohr{
139d443762bSAndreas Gohr    protected $use = 0;
140d443762bSAndreas Gohr
141d443762bSAndreas Gohr    /**
142d443762bSAndreas Gohr     * @param int $use JSON_*_TYPE flag
143d443762bSAndreas Gohr     * @deprecated  2018-07-27
144d443762bSAndreas Gohr     */
145d443762bSAndreas Gohr    public function __construct($use = JSON_STRICT_TYPE)
146d443762bSAndreas Gohr    {
147d443762bSAndreas Gohr        $this->use = $use;
148d443762bSAndreas Gohr    }
149d443762bSAndreas Gohr
150d443762bSAndreas Gohr    /**
151d443762bSAndreas Gohr     * Encode given structure to JSON
152d443762bSAndreas Gohr     *
153d443762bSAndreas Gohr     * @param mixed $var
154d443762bSAndreas Gohr     * @return string
155d443762bSAndreas Gohr     * @deprecated  2018-07-27
156d443762bSAndreas Gohr     */
157d443762bSAndreas Gohr    public function encode($var)
158d443762bSAndreas Gohr    {
159d443762bSAndreas Gohr        dbg_deprecated('json_encode');
160d443762bSAndreas Gohr        return json_encode($var);
161d443762bSAndreas Gohr    }
162d443762bSAndreas Gohr
163d443762bSAndreas Gohr    /**
164d443762bSAndreas Gohr     * Alias for encode()
165d443762bSAndreas Gohr     * @param $var
166d443762bSAndreas Gohr     * @return string
167d443762bSAndreas Gohr     * @deprecated  2018-07-27
168d443762bSAndreas Gohr     */
169d443762bSAndreas Gohr    public function enc($var) {
170d443762bSAndreas Gohr        return $this->encode($var);
171d443762bSAndreas Gohr    }
172d443762bSAndreas Gohr
173d443762bSAndreas Gohr    /**
174d443762bSAndreas Gohr     * Decode given string from JSON
175d443762bSAndreas Gohr     *
176d443762bSAndreas Gohr     * @param string $str
177d443762bSAndreas Gohr     * @return mixed
178d443762bSAndreas Gohr     * @deprecated  2018-07-27
179d443762bSAndreas Gohr     */
180d443762bSAndreas Gohr    public function decode($str)
181d443762bSAndreas Gohr    {
182d443762bSAndreas Gohr        dbg_deprecated('json_encode');
183d443762bSAndreas Gohr        return json_decode($str, ($this->use == JSON_LOOSE_TYPE));
184d443762bSAndreas Gohr    }
185d443762bSAndreas Gohr
186d443762bSAndreas Gohr    /**
187d443762bSAndreas Gohr     * Alias for decode
188d443762bSAndreas Gohr     *
189d443762bSAndreas Gohr     * @param $str
190d443762bSAndreas Gohr     * @return mixed
191d443762bSAndreas Gohr     * @deprecated  2018-07-27
192d443762bSAndreas Gohr     */
193d443762bSAndreas Gohr    public function dec($str) {
194d443762bSAndreas Gohr        return $this->decode($str);
195d443762bSAndreas Gohr    }
196d443762bSAndreas Gohr}
197ccc4c71cSAndreas Gohr
198ccc4c71cSAndreas Gohr/**
199ccc4c71cSAndreas Gohr * @inheritdoc
200ccc4c71cSAndreas Gohr * @deprecated 2019-02-19
201ccc4c71cSAndreas Gohr */
202ccc4c71cSAndreas Gohrclass Input extends \dokuwiki\Input\Input {
203ccc4c71cSAndreas Gohr    /**
204ccc4c71cSAndreas Gohr     * @inheritdoc
205ccc4c71cSAndreas Gohr     * @deprecated 2019-02-19
206ccc4c71cSAndreas Gohr     */
207ccc4c71cSAndreas Gohr    public function __construct()
208ccc4c71cSAndreas Gohr    {
209ccc4c71cSAndreas Gohr        dbg_deprecated(\dokuwiki\Input\Input::class);
210ccc4c71cSAndreas Gohr        parent::__construct();
211ccc4c71cSAndreas Gohr    }
212ccc4c71cSAndreas Gohr}
213ccc4c71cSAndreas Gohr
214ccc4c71cSAndreas Gohr/**
215ccc4c71cSAndreas Gohr * @inheritdoc
216ccc4c71cSAndreas Gohr * @deprecated 2019-02-19
217ccc4c71cSAndreas Gohr */
218ccc4c71cSAndreas Gohrclass PostInput extends \dokuwiki\Input\Post {
219ccc4c71cSAndreas Gohr    /**
220ccc4c71cSAndreas Gohr     * @inheritdoc
221ccc4c71cSAndreas Gohr     * @deprecated 2019-02-19
222ccc4c71cSAndreas Gohr     */
223ccc4c71cSAndreas Gohr    public function __construct()
224ccc4c71cSAndreas Gohr    {
225ccc4c71cSAndreas Gohr        dbg_deprecated(\dokuwiki\Input\Post::class);
226ccc4c71cSAndreas Gohr        parent::__construct();
227ccc4c71cSAndreas Gohr    }
228ccc4c71cSAndreas Gohr}
229ccc4c71cSAndreas Gohr
230ccc4c71cSAndreas Gohr/**
231ccc4c71cSAndreas Gohr * @inheritdoc
232ccc4c71cSAndreas Gohr * @deprecated 2019-02-19
233ccc4c71cSAndreas Gohr */
234ccc4c71cSAndreas Gohrclass GetInput extends \dokuwiki\Input\Get {
235ccc4c71cSAndreas Gohr    /**
236ccc4c71cSAndreas Gohr     * @inheritdoc
237ccc4c71cSAndreas Gohr     * @deprecated 2019-02-19
238ccc4c71cSAndreas Gohr     */
239ccc4c71cSAndreas Gohr    public function __construct()
240ccc4c71cSAndreas Gohr    {
241ccc4c71cSAndreas Gohr        dbg_deprecated(\dokuwiki\Input\Get::class);
242ccc4c71cSAndreas Gohr        parent::__construct();
243ccc4c71cSAndreas Gohr    }
244ccc4c71cSAndreas Gohr}
245ccc4c71cSAndreas Gohr
246ccc4c71cSAndreas Gohr/**
247ccc4c71cSAndreas Gohr * @inheritdoc
248ccc4c71cSAndreas Gohr * @deprecated 2019-02-19
249ccc4c71cSAndreas Gohr */
250ccc4c71cSAndreas Gohrclass ServerInput extends \dokuwiki\Input\Server {
251ccc4c71cSAndreas Gohr    /**
252ccc4c71cSAndreas Gohr     * @inheritdoc
253ccc4c71cSAndreas Gohr     * @deprecated 2019-02-19
254ccc4c71cSAndreas Gohr     */
255ccc4c71cSAndreas Gohr    public function __construct()
256ccc4c71cSAndreas Gohr    {
257ccc4c71cSAndreas Gohr        dbg_deprecated(\dokuwiki\Input\Server::class);
258ccc4c71cSAndreas Gohr        parent::__construct();
259ccc4c71cSAndreas Gohr    }
260ccc4c71cSAndreas Gohr}
261c3cc6e05SAndreas Gohr
262c3cc6e05SAndreas Gohr/**
263c3cc6e05SAndreas Gohr * @inheritdoc
264c3cc6e05SAndreas Gohr * @deprecated 2019-03-06
265c3cc6e05SAndreas Gohr */
266c3cc6e05SAndreas Gohrclass PassHash extends \dokuwiki\PassHash {
267c3cc6e05SAndreas Gohr    /**
268c3cc6e05SAndreas Gohr     * @inheritdoc
269c3cc6e05SAndreas Gohr     * @deprecated 2019-03-06
270c3cc6e05SAndreas Gohr     */
271c3cc6e05SAndreas Gohr    public function __construct()
272c3cc6e05SAndreas Gohr    {
273c3cc6e05SAndreas Gohr        dbg_deprecated(\dokuwiki\PassHash::class);
274c3cc6e05SAndreas Gohr    }
275c3cc6e05SAndreas Gohr}
27660b9af73SMichael Große
27760b9af73SMichael Große/**
2785a8d6e48SMichael Große * @deprecated since 2019-03-17 use \dokuwiki\HTTP\HTTPClientException instead!
27960b9af73SMichael Große */
2805a8d6e48SMichael Großeclass HTTPClientException extends \dokuwiki\HTTP\HTTPClientException {
28160b9af73SMichael Große
28260b9af73SMichael Große    /**
28360b9af73SMichael Große     * @inheritdoc
28460b9af73SMichael Große     * @deprecated 2019-03-17
28560b9af73SMichael Große     */
28660b9af73SMichael Große    public function __construct($message = '', $code = 0, $previous = null)
28760b9af73SMichael Große    {
2885a8d6e48SMichael Große        DebugHelper::dbgDeprecatedFunction(dokuwiki\HTTP\HTTPClientException::class);
28960b9af73SMichael Große        parent::__construct($message, $code, $previous);
29060b9af73SMichael Große    }
29160b9af73SMichael Große}
29260b9af73SMichael Große
29360b9af73SMichael Große/**
2945a8d6e48SMichael Große * @deprecated since 2019-03-17 use \dokuwiki\HTTP\HTTPClient instead!
29560b9af73SMichael Große */
2965a8d6e48SMichael Großeclass HTTPClient extends \dokuwiki\HTTP\HTTPClient {
29760b9af73SMichael Große
29860b9af73SMichael Große    /**
29960b9af73SMichael Große     * @inheritdoc
30060b9af73SMichael Große     * @deprecated 2019-03-17
30160b9af73SMichael Große     */
30260b9af73SMichael Große    public function __construct()
30360b9af73SMichael Große    {
3045a8d6e48SMichael Große        DebugHelper::dbgDeprecatedFunction(dokuwiki\HTTP\HTTPClient::class);
30560b9af73SMichael Große        parent::__construct();
30660b9af73SMichael Große    }
30760b9af73SMichael Große}
30860b9af73SMichael Große
30960b9af73SMichael Große/**
3105a8d6e48SMichael Große * @deprecated since 2019-03-17 use \dokuwiki\HTTP\DokuHTTPClient instead!
31160b9af73SMichael Große */
3125a8d6e48SMichael Großeclass DokuHTTPClient extends \dokuwiki\HTTP\DokuHTTPClient {
31360b9af73SMichael Große
31460b9af73SMichael Große    /**
31560b9af73SMichael Große     * @inheritdoc
31660b9af73SMichael Große     * @deprecated 2019-03-17
31760b9af73SMichael Große     */
31860b9af73SMichael Große    public function __construct()
31960b9af73SMichael Große    {
3205a8d6e48SMichael Große        DebugHelper::dbgDeprecatedFunction(dokuwiki\HTTP\DokuHTTPClient::class);
32160b9af73SMichael Große        parent::__construct();
32260b9af73SMichael Große    }
32360b9af73SMichael Große
32460b9af73SMichael Große}
325*451969abSMichael Große
326*451969abSMichael Große
327*451969abSMichael Große/**
328*451969abSMichael Große * Class for handling (email) subscriptions
329*451969abSMichael Große *
330*451969abSMichael Große * @author  Adrian Lang <lang@cosmocode.de>
331*451969abSMichael Große * @author  Andreas Gohr <andi@splitbrain.org>
332*451969abSMichael Große * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
333*451969abSMichael Große *
334*451969abSMichael Große * @deprecated 2019-04-22 Use the classes in the \dokuwiki\Subscriptions namespace instead!
335*451969abSMichael Große */
336*451969abSMichael Großeclass Subscription {
337*451969abSMichael Große
338*451969abSMichael Große    /**
339*451969abSMichael Große     * Check if subscription system is enabled
340*451969abSMichael Große     *
341*451969abSMichael Große     * @return bool
342*451969abSMichael Große     *
343*451969abSMichael Große     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::isenabled
344*451969abSMichael Große     */
345*451969abSMichael Große    public function isenabled() {
346*451969abSMichael Große        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::isenabled');
347*451969abSMichael Große        $subscriberManager = new SubscriberManager();
348*451969abSMichael Große        return $subscriberManager->isenabled();
349*451969abSMichael Große    }
350*451969abSMichael Große
351*451969abSMichael Große    /**
352*451969abSMichael Große     * Recursively search for matching subscriptions
353*451969abSMichael Große     *
354*451969abSMichael Große     * This function searches all relevant subscription files for a page or
355*451969abSMichael Große     * namespace.
356*451969abSMichael Große     *
357*451969abSMichael Große     * @author Adrian Lang <lang@cosmocode.de>
358*451969abSMichael Große     *
359*451969abSMichael Große     * @param string         $page The target object’s (namespace or page) id
360*451969abSMichael Große     * @param string|array   $user
361*451969abSMichael Große     * @param string|array   $style
362*451969abSMichael Große     * @param string|array   $data
363*451969abSMichael Große     * @return array
364*451969abSMichael Große     *
365*451969abSMichael Große     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::subscribers
366*451969abSMichael Große     */
367*451969abSMichael Große    public function subscribers($page, $user = null, $style = null, $data = null) {
368*451969abSMichael Große        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::subscribers');
369*451969abSMichael Große        $manager = new SubscriberManager();
370*451969abSMichael Große        return $manager->subscribers($page, $user, $style, $data);
371*451969abSMichael Große    }
372*451969abSMichael Große
373*451969abSMichael Große    /**
374*451969abSMichael Große     * Adds a new subscription for the given page or namespace
375*451969abSMichael Große     *
376*451969abSMichael Große     * This will automatically overwrite any existent subscription for the given user on this
377*451969abSMichael Große     * *exact* page or namespace. It will *not* modify any subscription that may exist in higher namespaces.
378*451969abSMichael Große     *
379*451969abSMichael Große     * @param string $id The target page or namespace, specified by id; Namespaces
380*451969abSMichael Große     *                   are identified by appending a colon.
381*451969abSMichael Große     * @param string $user
382*451969abSMichael Große     * @param string $style
383*451969abSMichael Große     * @param string $data
384*451969abSMichael Große     * @throws Exception when user or style is empty
385*451969abSMichael Große     * @return bool
386*451969abSMichael Große     *
387*451969abSMichael Große     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::add
388*451969abSMichael Große     */
389*451969abSMichael Große    public function add($id, $user, $style, $data = '') {
390*451969abSMichael Große        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::add');
391*451969abSMichael Große        $manager = new SubscriberManager();
392*451969abSMichael Große        return $manager->add($id, $user, $style, $data);
393*451969abSMichael Große    }
394*451969abSMichael Große
395*451969abSMichael Große    /**
396*451969abSMichael Große     * Removes a subscription for the given page or namespace
397*451969abSMichael Große     *
398*451969abSMichael Große     * This removes all subscriptions matching the given criteria on the given page or
399*451969abSMichael Große     * namespace. It will *not* modify any subscriptions that may exist in higher
400*451969abSMichael Große     * namespaces.
401*451969abSMichael Große     *
402*451969abSMichael Große     * @param string         $id   The target object’s (namespace or page) id
403*451969abSMichael Große     * @param string|array   $user
404*451969abSMichael Große     * @param string|array   $style
405*451969abSMichael Große     * @param string|array   $data
406*451969abSMichael Große     * @return bool
407*451969abSMichael Große     *
408*451969abSMichael Große     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::remove
409*451969abSMichael Große     */
410*451969abSMichael Große    public function remove($id, $user = null, $style = null, $data = null) {
411*451969abSMichael Große        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::remove');
412*451969abSMichael Große        $manager = new SubscriberManager();
413*451969abSMichael Große        return $manager->remove($id, $user, $style, $data);
414*451969abSMichael Große    }
415*451969abSMichael Große
416*451969abSMichael Große    /**
417*451969abSMichael Große     * Get data for $INFO['subscribed']
418*451969abSMichael Große     *
419*451969abSMichael Große     * $INFO['subscribed'] is either false if no subscription for the current page
420*451969abSMichael Große     * and user is in effect. Else it contains an array of arrays with the fields
421*451969abSMichael Große     * “target”, “style”, and optionally “data”.
422*451969abSMichael Große     *
423*451969abSMichael Große     * @param string $id  Page ID, defaults to global $ID
424*451969abSMichael Große     * @param string $user User, defaults to $_SERVER['REMOTE_USER']
425*451969abSMichael Große     * @return array|false
426*451969abSMichael Große     * @author Adrian Lang <lang@cosmocode.de>
427*451969abSMichael Große     *
428*451969abSMichael Große     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::userSubscription
429*451969abSMichael Große     */
430*451969abSMichael Große    public function user_subscription($id = '', $user = '') {
431*451969abSMichael Große        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::userSubscription');
432*451969abSMichael Große        $manager = new SubscriberManager();
433*451969abSMichael Große        return $manager->userSubscription($id, $user);
434*451969abSMichael Große    }
435*451969abSMichael Große
436*451969abSMichael Große    /**
437*451969abSMichael Große     * Send digest and list subscriptions
438*451969abSMichael Große     *
439*451969abSMichael Große     * This sends mails to all subscribers that have a subscription for namespaces above
440*451969abSMichael Große     * the given page if the needed $conf['subscribe_time'] has passed already.
441*451969abSMichael Große     *
442*451969abSMichael Große     * This function is called form lib/exe/indexer.php
443*451969abSMichael Große     *
444*451969abSMichael Große     * @param string $page
445*451969abSMichael Große     * @return int number of sent mails
446*451969abSMichael Große     *
447*451969abSMichael Große     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\BulkSubscriptionSender::sendBulk
448*451969abSMichael Große     */
449*451969abSMichael Große    public function send_bulk($page) {
450*451969abSMichael Große        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\BulkSubscriptionSender::sendBulk');
451*451969abSMichael Große        $subscriptionSender = new BulkSubscriptionSender();
452*451969abSMichael Große        return $subscriptionSender->sendBulk($page);
453*451969abSMichael Große    }
454*451969abSMichael Große
455*451969abSMichael Große    /**
456*451969abSMichael Große     * Send the diff for some page change
457*451969abSMichael Große     *
458*451969abSMichael Große     * @param string   $subscriber_mail The target mail address
459*451969abSMichael Große     * @param string   $template        Mail template ('subscr_digest', 'subscr_single', 'mailtext', ...)
460*451969abSMichael Große     * @param string   $id              Page for which the notification is
461*451969abSMichael Große     * @param int|null $rev             Old revision if any
462*451969abSMichael Große     * @param string   $summary         Change summary if any
463*451969abSMichael Große     * @return bool                     true if successfully sent
464*451969abSMichael Große     *
465*451969abSMichael Große     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\PageSubscriptionSender::sendPageDiff
466*451969abSMichael Große     */
467*451969abSMichael Große    public function send_diff($subscriber_mail, $template, $id, $rev = null, $summary = '') {
468*451969abSMichael Große        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\PageSubscriptionSender::sendPageDiff');
469*451969abSMichael Große        $subscriptionSender = new PageSubscriptionSender();
470*451969abSMichael Große        return $subscriptionSender->sendPageDiff($subscriber_mail, $template, $id, $rev, $summary);
471*451969abSMichael Große    }
472*451969abSMichael Große
473*451969abSMichael Große    /**
474*451969abSMichael Große     * Send the diff for some media change
475*451969abSMichael Große     *
476*451969abSMichael Große     * @fixme this should embed thumbnails of images in HTML version
477*451969abSMichael Große     *
478*451969abSMichael Große     * @param string   $subscriber_mail The target mail address
479*451969abSMichael Große     * @param string   $template        Mail template ('uploadmail', ...)
480*451969abSMichael Große     * @param string   $id              Media file for which the notification is
481*451969abSMichael Große     * @param int|bool $rev             Old revision if any
482*451969abSMichael Große     *
483*451969abSMichael Große     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\MediaSubscriptionSender::sendMediaDiff
484*451969abSMichael Große     */
485*451969abSMichael Große    public function send_media_diff($subscriber_mail, $template, $id, $rev = false) {
486*451969abSMichael Große        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\MediaSubscriptionSender::sendMediaDiff');
487*451969abSMichael Große        $subscriptionSender = new MediaSubscriptionSender();
488*451969abSMichael Große        return $subscriptionSender->sendMediaDiff($subscriber_mail, $template, $id, $rev);
489*451969abSMichael Große    }
490*451969abSMichael Große
491*451969abSMichael Große    /**
492*451969abSMichael Große     * Send a notify mail on new registration
493*451969abSMichael Große     *
494*451969abSMichael Große     * @author Andreas Gohr <andi@splitbrain.org>
495*451969abSMichael Große     *
496*451969abSMichael Große     * @param string $login    login name of the new user
497*451969abSMichael Große     * @param string $fullname full name of the new user
498*451969abSMichael Große     * @param string $email    email address of the new user
499*451969abSMichael Große     * @return bool true if a mail was sent
500*451969abSMichael Große     *
501*451969abSMichael Große     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\RegistrationSubscriptionSender::sendRegister
502*451969abSMichael Große     */
503*451969abSMichael Große    public function send_register($login, $fullname, $email) {
504*451969abSMichael Große        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\RegistrationSubscriptionSender::sendRegister');
505*451969abSMichael Große        $subscriptionSender = new RegistrationSubscriptionSender();
506*451969abSMichael Große        return $subscriptionSender->sendRegister($login, $fullname, $email);
507*451969abSMichael Große    }
508*451969abSMichael Große
509*451969abSMichael Große
510*451969abSMichael Große    /**
511*451969abSMichael Große     * Default callback for COMMON_NOTIFY_ADDRESSLIST
512*451969abSMichael Große     *
513*451969abSMichael Große     * Aggregates all email addresses of user who have subscribed the given page with 'every' style
514*451969abSMichael Große     *
515*451969abSMichael Große     * @author Steven Danz <steven-danz@kc.rr.com>
516*451969abSMichael Große     * @author Adrian Lang <lang@cosmocode.de>
517*451969abSMichael Große     *
518*451969abSMichael Große     * @todo move the whole functionality into this class, trigger SUBSCRIPTION_NOTIFY_ADDRESSLIST instead,
519*451969abSMichael Große     *       use an array for the addresses within it
520*451969abSMichael Große     *
521*451969abSMichael Große     * @param array &$data Containing the entries:
522*451969abSMichael Große     *    - $id (the page id),
523*451969abSMichael Große     *    - $self (whether the author should be notified,
524*451969abSMichael Große     *    - $addresslist (current email address list)
525*451969abSMichael Große     *    - $replacements (array of additional string substitutions, @KEY@ to be replaced by value)
526*451969abSMichael Große     *
527*451969abSMichael Große     * @deprecated 2019-04-20 \dokuwiki\Subscriptions\SubscriberManager::notifyAddresses
528*451969abSMichael Große     */
529*451969abSMichael Große    public function notifyaddresses(&$data) {
530*451969abSMichael Große        DebugHelper::dbgDeprecatedFunction('\dokuwiki\Subscriptions\SubscriberManager::notifyAddresses');
531*451969abSMichael Große        $manager = new SubscriberManager();
532*451969abSMichael Große        $manager->notifyAddresses($data);
533*451969abSMichael Große    }
534*451969abSMichael Große}
535