xref: /dokuwiki/inc/deprecated.php (revision 73dc0a8919857718a3b64a4c0741b57580a34b2a)
14cdb6842SAndreas Gohr<?php
2b4c31a26SSatoshi Sahara// phpcs:ignoreFile -- this file violates PSR-12 by definition
34cdb6842SAndreas Gohr/**
44cdb6842SAndreas Gohr * These classes and functions are deprecated and will be removed in future releases
5a0aeafaaSAndreas Gohr *
6a0aeafaaSAndreas Gohr * Note: when adding to this file, please also add appropriate actions to _test/rector.php
74cdb6842SAndreas Gohr */
84cdb6842SAndreas Gohr
9451969abSMichael Großeuse dokuwiki\Debug\DebugHelper;
10*73dc0a89SAndreas Gohruse dokuwiki\MailUtils;
11451969abSMichael Große
124cdb6842SAndreas Gohr/**
13723f2b49SGerrit Uitslag * @deprecated since 2021-11-11 use \dokuwiki\Remote\IXR\Client instead!
14723f2b49SGerrit Uitslag */
15723f2b49SGerrit Uitslagclass IXR_Client extends \dokuwiki\Remote\IXR\Client
16723f2b49SGerrit Uitslag{
17723f2b49SGerrit Uitslag    /**
184cdb6842SAndreas Gohr     * @inheritdoc
19723f2b49SGerrit Uitslag     * @deprecated 2021-11-11
204cdb6842SAndreas Gohr     */
21723f2b49SGerrit Uitslag    public function __construct($server, $path = false, $port = 80, $timeout = 15, $timeout_io = null)
22d443762bSAndreas Gohr    {
23723f2b49SGerrit Uitslag        DebugHelper::dbgDeprecatedFunction(dokuwiki\Remote\IXR\Client::class);
24723f2b49SGerrit Uitslag        parent::__construct($server, $path, $port, $timeout, $timeout_io);
25723f2b49SGerrit Uitslag    }
26723f2b49SGerrit Uitslag}
27723f2b49SGerrit Uitslag/**
28723f2b49SGerrit Uitslag * @deprecated since 2021-11-11 use \IXR\Client\ClientMulticall instead!
29723f2b49SGerrit Uitslag */
30723f2b49SGerrit Uitslagclass IXR_ClientMulticall extends \IXR\Client\ClientMulticall
31d443762bSAndreas Gohr{
324cdb6842SAndreas Gohr    /**
334cdb6842SAndreas Gohr     * @inheritdoc
34723f2b49SGerrit Uitslag     * @deprecated 2021-11-11
354cdb6842SAndreas Gohr     */
36723f2b49SGerrit Uitslag    public function __construct($server, $path = false, $port = 80)
37d443762bSAndreas Gohr    {
38723f2b49SGerrit Uitslag        DebugHelper::dbgDeprecatedFunction(IXR\Client\ClientMulticall::class);
39723f2b49SGerrit Uitslag        parent::__construct($server, $path, $port);
404cdb6842SAndreas Gohr    }
414cdb6842SAndreas Gohr}
424cdb6842SAndreas Gohr/**
43723f2b49SGerrit Uitslag * @deprecated since 2021-11-11 use \IXR\Server\Server instead!
444cdb6842SAndreas Gohr */
45723f2b49SGerrit Uitslagclass IXR_Server extends \IXR\Server\Server
46d443762bSAndreas Gohr{
47a6e1db4aSAndreas Gohr    /**
48a6e1db4aSAndreas Gohr     * @inheritdoc
49723f2b49SGerrit Uitslag     * @deprecated 2021-11-11
50a6e1db4aSAndreas Gohr     */
51723f2b49SGerrit Uitslag    public function __construct($callbacks = false, $data = false, $wait = false)
52d443762bSAndreas Gohr    {
53723f2b49SGerrit Uitslag        DebugHelper::dbgDeprecatedFunction(IXR\Server\Server::class);
54723f2b49SGerrit Uitslag        parent::__construct($callbacks, $data, $wait);
55a6e1db4aSAndreas Gohr    }
56a6e1db4aSAndreas Gohr}
57723f2b49SGerrit Uitslag/**
58723f2b49SGerrit Uitslag * @deprecated since 2021-11-11 use \IXR\Server\IntrospectionServer instead!
59723f2b49SGerrit Uitslag */
60723f2b49SGerrit Uitslagclass IXR_IntrospectionServer extends \IXR\Server\IntrospectionServer
61723f2b49SGerrit Uitslag{
62a6e1db4aSAndreas Gohr    /**
63a6e1db4aSAndreas Gohr     * @inheritdoc
64723f2b49SGerrit Uitslag     * @deprecated 2021-11-11
65ccc4c71cSAndreas Gohr     */
66ccc4c71cSAndreas Gohr    public function __construct()
67ccc4c71cSAndreas Gohr    {
68723f2b49SGerrit Uitslag        DebugHelper::dbgDeprecatedFunction(IXR\Server\IntrospectionServer::class);
69ccc4c71cSAndreas Gohr        parent::__construct();
70ccc4c71cSAndreas Gohr    }
71ccc4c71cSAndreas Gohr}
72ccc4c71cSAndreas Gohr/**
73723f2b49SGerrit Uitslag * @deprecated since 2021-11-11 use \IXR\Request\Request instead!
74ccc4c71cSAndreas Gohr */
75723f2b49SGerrit Uitslagclass IXR_Request extends \IXR\Request\Request
76ccc4c71cSAndreas Gohr{
77ccc4c71cSAndreas Gohr    /**
78ccc4c71cSAndreas Gohr     * @inheritdoc
79723f2b49SGerrit Uitslag     * @deprecated 2021-11-11
80ccc4c71cSAndreas Gohr     */
81723f2b49SGerrit Uitslag    public function __construct($method, $args)
82ccc4c71cSAndreas Gohr    {
83723f2b49SGerrit Uitslag        DebugHelper::dbgDeprecatedFunction(IXR\Request\Request::class);
84723f2b49SGerrit Uitslag        parent::__construct($method, $args);
85ccc4c71cSAndreas Gohr    }
86ccc4c71cSAndreas Gohr}
87ccc4c71cSAndreas Gohr/**
88723f2b49SGerrit Uitslag * @deprecated since 2021-11-11 use \IXR\Message\Message instead!
89ccc4c71cSAndreas Gohr */
90723f2b49SGerrit Uitslagclass IXR_Message extends IXR\Message\Message
91ccc4c71cSAndreas Gohr{
92c3cc6e05SAndreas Gohr    /**
93c3cc6e05SAndreas Gohr     * @inheritdoc
94723f2b49SGerrit Uitslag     * @deprecated 2021-11-11
95c3cc6e05SAndreas Gohr     */
96723f2b49SGerrit Uitslag    public function __construct($message)
97723f2b49SGerrit Uitslag    {
98723f2b49SGerrit Uitslag        DebugHelper::dbgDeprecatedFunction(IXR\Message\Message::class);
99723f2b49SGerrit Uitslag        parent::__construct($message);
100723f2b49SGerrit Uitslag    }
101723f2b49SGerrit Uitslag}
102723f2b49SGerrit Uitslag/**
103723f2b49SGerrit Uitslag * @deprecated since 2021-11-11 use \IXR\Message\Error instead!
104723f2b49SGerrit Uitslag */
105723f2b49SGerrit Uitslagclass IXR_Error extends \IXR\Message\Error
106723f2b49SGerrit Uitslag{
107c3cc6e05SAndreas Gohr    /**
108c3cc6e05SAndreas Gohr     * @inheritdoc
109723f2b49SGerrit Uitslag     * @deprecated 2021-11-11
110c3cc6e05SAndreas Gohr     */
111723f2b49SGerrit Uitslag    public function __construct($code, $message)
112c3cc6e05SAndreas Gohr    {
113723f2b49SGerrit Uitslag        DebugHelper::dbgDeprecatedFunction(IXR\Message\Error::class);
114723f2b49SGerrit Uitslag        parent::__construct($code, $message);
115c3cc6e05SAndreas Gohr    }
116c3cc6e05SAndreas Gohr}
11760b9af73SMichael Große/**
118723f2b49SGerrit Uitslag * @deprecated since 2021-11-11 use \IXR\DataType\Date instead!
11960b9af73SMichael Große */
120723f2b49SGerrit Uitslagclass IXR_Date extends \IXR\DataType\Date
121723f2b49SGerrit Uitslag{
12260b9af73SMichael Große    /**
12360b9af73SMichael Große     * @inheritdoc
124723f2b49SGerrit Uitslag     * @deprecated 2021-11-11
12560b9af73SMichael Große     */
126723f2b49SGerrit Uitslag    public function __construct($time)
12760b9af73SMichael Große    {
128723f2b49SGerrit Uitslag        DebugHelper::dbgDeprecatedFunction(IXR\DataType\Date::class);
129723f2b49SGerrit Uitslag        parent::__construct($time);
13060b9af73SMichael Große    }
13160b9af73SMichael Große}
13260b9af73SMichael Große/**
133723f2b49SGerrit Uitslag * @deprecated since 2021-11-11 use \IXR\DataType\Base64 instead!
13460b9af73SMichael Große */
135723f2b49SGerrit Uitslagclass IXR_Base64 extends \IXR\DataType\Base64
136723f2b49SGerrit Uitslag{
13760b9af73SMichael Große    /**
13860b9af73SMichael Große     * @inheritdoc
139723f2b49SGerrit Uitslag     * @deprecated 2021-11-11
14060b9af73SMichael Große     */
141723f2b49SGerrit Uitslag    public function __construct($data)
14260b9af73SMichael Große    {
143723f2b49SGerrit Uitslag        DebugHelper::dbgDeprecatedFunction(IXR\DataType\Base64::class);
144723f2b49SGerrit Uitslag        parent::__construct($data);
14560b9af73SMichael Große    }
14660b9af73SMichael Große}
14760b9af73SMichael Große/**
148723f2b49SGerrit Uitslag * @deprecated since 2021-11-11 use \IXR\DataType\Value instead!
14960b9af73SMichael Große */
150723f2b49SGerrit Uitslagclass IXR_Value extends \IXR\DataType\Value
151cbb44eabSAndreas Gohr{
15260b9af73SMichael Große    /**
15360b9af73SMichael Große     * @inheritdoc
154723f2b49SGerrit Uitslag     * @deprecated 2021-11-11
15560b9af73SMichael Große     */
156723f2b49SGerrit Uitslag    public function __construct($data, $type = null)
15760b9af73SMichael Große    {
158723f2b49SGerrit Uitslag        DebugHelper::dbgDeprecatedFunction(IXR\DataType\Value::class);
159723f2b49SGerrit Uitslag        parent::__construct($data, $type);
16060b9af73SMichael Große    }
161cbb44eabSAndreas Gohr}
16260b9af73SMichael Große
163cbb44eabSAndreas Gohr/**
164c8dd1b9dSAndreas Gohr * returns all available parser syntax modes in correct order
165c8dd1b9dSAndreas Gohr *
166c8dd1b9dSAndreas Gohr * @return array[] with for each plugin the array('sort' => sortnumber, 'mode' => mode string, 'obj'  => plugin object)
167c8dd1b9dSAndreas Gohr * @author Andreas Gohr <andi@splitbrain.org>
168c8dd1b9dSAndreas Gohr * @deprecated 2026-04-16 use \dokuwiki\Parsing\ModeRegistry::getModes() instead
169c8dd1b9dSAndreas Gohr */
170c8dd1b9dSAndreas Gohrfunction p_get_parsermodes()
171c8dd1b9dSAndreas Gohr{
172c8dd1b9dSAndreas Gohr    DebugHelper::dbgDeprecatedFunction(\dokuwiki\Parsing\ModeRegistry::class . '::getModes()');
173c8dd1b9dSAndreas Gohr    return \dokuwiki\Parsing\ModeRegistry::getInstance()->getModes();
174c8dd1b9dSAndreas Gohr}
175c8dd1b9dSAndreas Gohr
176c8dd1b9dSAndreas Gohr/**
177c8dd1b9dSAndreas Gohr * Callback function for usort
178c8dd1b9dSAndreas Gohr *
179c8dd1b9dSAndreas Gohr * @param array $a
180c8dd1b9dSAndreas Gohr * @param array $b
181c8dd1b9dSAndreas Gohr * @return int $a is lower/equal/higher than $b
182c8dd1b9dSAndreas Gohr * @author Andreas Gohr <andi@splitbrain.org>
183c8dd1b9dSAndreas Gohr * @deprecated 2026-04-16 use \dokuwiki\Parsing\ModeRegistry::sortModes() instead
184c8dd1b9dSAndreas Gohr */
185c8dd1b9dSAndreas Gohrfunction p_sort_modes($a, $b)
186c8dd1b9dSAndreas Gohr{
187c8dd1b9dSAndreas Gohr    DebugHelper::dbgDeprecatedFunction(\dokuwiki\Parsing\ModeRegistry::class . '::sortModes()');
188c8dd1b9dSAndreas Gohr    return \dokuwiki\Parsing\ModeRegistry::sortModes($a, $b);
189c8dd1b9dSAndreas Gohr}
190c8dd1b9dSAndreas Gohr
191c8dd1b9dSAndreas Gohr/**
192f9a94e78SAndreas Gohr * print a newline terminated string
193cbb44eabSAndreas Gohr *
194f9a94e78SAndreas Gohr * You can give an indention as optional parameter
195451969abSMichael Große *
196451969abSMichael Große * @author Andreas Gohr <andi@splitbrain.org>
197451969abSMichael Große *
198f9a94e78SAndreas Gohr * @param string $string  line of text
199f9a94e78SAndreas Gohr * @param int    $indent  number of spaces indention
200f9a94e78SAndreas Gohr * @deprecated 2023-08-31 use echo instead
201451969abSMichael Große */
202f9a94e78SAndreas Gohrfunction ptln($string, $indent = 0)
203f9a94e78SAndreas Gohr{
204f9a94e78SAndreas Gohr    DebugHelper::dbgDeprecatedFunction('echo');
205f9a94e78SAndreas Gohr    echo str_repeat(' ', $indent) . "$string\n";
206451969abSMichael Große}
2076225b270SMichael Große
2086225b270SMichael Große/**
2099df9f0c8SAndreas Gohr * Adds/updates the search index for the given page
2106f58ff65SSatoshi Sahara *
2119df9f0c8SAndreas Gohr * Locking is handled internally.
212b4c31a26SSatoshi Sahara *
2139df9f0c8SAndreas Gohr * @param string        $page   name of the page to index
2149df9f0c8SAndreas Gohr * @param boolean       $verbose    print status messages
2159df9f0c8SAndreas Gohr * @param boolean       $force  force reindexing even when the index is up to date
2169df9f0c8SAndreas Gohr * @return string|boolean  the function completed successfully
2176f58ff65SSatoshi Sahara *
218e1272c08SAndreas Gohr * @deprecated 2026-04-07 use Indexer class instead
2196f58ff65SSatoshi Sahara */
2209df9f0c8SAndreas Gohrfunction idx_addPage($page, $verbose = false, $force = false)
2219df9f0c8SAndreas Gohr{
22283b3acccSAndreas Gohr    DebugHelper::dbgDeprecatedFunction('dokuwiki\Search\Indexer::addPage()');
2239df9f0c8SAndreas Gohr    try {
22483b3acccSAndreas Gohr        (new dokuwiki\Search\Indexer())->addPage($page, $force);
2259df9f0c8SAndreas Gohr        return true;
2269df9f0c8SAndreas Gohr    } catch (\dokuwiki\Search\Exception\SearchException $e) {
2279df9f0c8SAndreas Gohr        return false;
2286f58ff65SSatoshi Sahara    }
2296f58ff65SSatoshi Sahara}
230e1272c08SAndreas Gohr
231e1272c08SAndreas Gohr/**
232e1272c08SAndreas Gohr * Create an instance of the indexer.
233e1272c08SAndreas Gohr *
234e1272c08SAndreas Gohr * @return dokuwiki\Search\Indexer
235e1272c08SAndreas Gohr *
236e1272c08SAndreas Gohr * @deprecated 2026-04-07 use dokuwiki\Search\Indexer directly
237e1272c08SAndreas Gohr */
238e1272c08SAndreas Gohrfunction idx_get_indexer()
239e1272c08SAndreas Gohr{
240e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(dokuwiki\Search\Indexer::class);
241e1272c08SAndreas Gohr    return new dokuwiki\Search\Indexer();
242e1272c08SAndreas Gohr}
243e1272c08SAndreas Gohr
244e1272c08SAndreas Gohr/**
245e1272c08SAndreas Gohr * Read the list of words in an index (if it exists).
246e1272c08SAndreas Gohr *
247e1272c08SAndreas Gohr * @param string $idx
248e1272c08SAndreas Gohr * @param string $suffix
249e1272c08SAndreas Gohr * @return array
250e1272c08SAndreas Gohr *
251e1272c08SAndreas Gohr * @deprecated 2026-04-07 use Index classes directly
252e1272c08SAndreas Gohr */
253e1272c08SAndreas Gohrfunction idx_getIndex($idx, $suffix)
254e1272c08SAndreas Gohr{
255e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction('Index classes');
256e1272c08SAndreas Gohr    global $conf;
257e1272c08SAndreas Gohr    $fn = $conf['indexdir'] . '/' . $idx . $suffix . '.idx';
258e1272c08SAndreas Gohr    if (!file_exists($fn)) return [];
259e1272c08SAndreas Gohr    return file($fn);
260e1272c08SAndreas Gohr}
261e1272c08SAndreas Gohr
262e1272c08SAndreas Gohr/**
263e1272c08SAndreas Gohr * Find tokens in the fulltext index
264e1272c08SAndreas Gohr *
265e1272c08SAndreas Gohr * @param array $words list of words to search for
266e1272c08SAndreas Gohr * @return array list of pages found
267e1272c08SAndreas Gohr *
268e1272c08SAndreas Gohr * @deprecated 2026-04-07 use CollectionSearch on PageFulltextCollection instead
269e1272c08SAndreas Gohr */
270e1272c08SAndreas Gohrfunction idx_lookup(&$words)
271e1272c08SAndreas Gohr{
272e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(dokuwiki\Search\Collection\CollectionSearch::class);
273e1272c08SAndreas Gohr    return (new dokuwiki\Search\Indexer())->lookup($words);
274e1272c08SAndreas Gohr}
275e1272c08SAndreas Gohr
276e1272c08SAndreas Gohr/**
277e1272c08SAndreas Gohr * Get the list of lengths indexed in the wiki.
278e1272c08SAndreas Gohr *
279e1272c08SAndreas Gohr * @return array
280e1272c08SAndreas Gohr *
281e1272c08SAndreas Gohr * @deprecated 2026-04-07 use PageFulltextCollection::getTokenIndexMaximum() instead
282e1272c08SAndreas Gohr */
283e1272c08SAndreas Gohrfunction idx_listIndexLengths()
284e1272c08SAndreas Gohr{
285e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction('PageFulltextCollection::getTokenIndexMaximum()');
286e1272c08SAndreas Gohr    global $conf;
287e1272c08SAndreas Gohr    $idx = [];
288e1272c08SAndreas Gohr    $files = glob($conf['indexdir'] . '/i*.idx');
289e1272c08SAndreas Gohr    if ($files) {
290e1272c08SAndreas Gohr        foreach ($files as $file) {
291e1272c08SAndreas Gohr            if (preg_match('/i(\d+)\.idx$/', $file, $match)) {
292e1272c08SAndreas Gohr                $idx[] = (int)$match[1];
293e1272c08SAndreas Gohr            }
294e1272c08SAndreas Gohr        }
295e1272c08SAndreas Gohr        sort($idx);
296e1272c08SAndreas Gohr    }
297e1272c08SAndreas Gohr    return $idx;
298e1272c08SAndreas Gohr}
299e1272c08SAndreas Gohr
300e1272c08SAndreas Gohr/**
301e1272c08SAndreas Gohr * Get the word lengths that have been indexed.
302e1272c08SAndreas Gohr *
303e1272c08SAndreas Gohr * @param array|int $filter
304e1272c08SAndreas Gohr * @return array
305e1272c08SAndreas Gohr *
306e1272c08SAndreas Gohr * @deprecated 2026-04-07 use PageFulltextCollection::getTokenIndexMaximum() instead
307e1272c08SAndreas Gohr */
308e1272c08SAndreas Gohrfunction idx_indexLengths($filter)
309e1272c08SAndreas Gohr{
310e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction('PageFulltextCollection::getTokenIndexMaximum()');
311e1272c08SAndreas Gohr    global $conf;
312e1272c08SAndreas Gohr    $idx = [];
313e1272c08SAndreas Gohr    if (is_array($filter)) {
314e1272c08SAndreas Gohr        $path = $conf['indexdir'] . "/i";
315e1272c08SAndreas Gohr        foreach (array_keys($filter) as $key) {
316e1272c08SAndreas Gohr            if (file_exists($path . $key . '.idx'))
317e1272c08SAndreas Gohr                $idx[] = $key;
318e1272c08SAndreas Gohr        }
319e1272c08SAndreas Gohr    } else {
320e1272c08SAndreas Gohr        $lengths = idx_listIndexLengths();
321e1272c08SAndreas Gohr        foreach ($lengths as $length) {
322e1272c08SAndreas Gohr            if ((int)$length >= (int)$filter)
323e1272c08SAndreas Gohr                $idx[] = $length;
324e1272c08SAndreas Gohr        }
325e1272c08SAndreas Gohr    }
326e1272c08SAndreas Gohr    return $idx;
327e1272c08SAndreas Gohr}
328e1272c08SAndreas Gohr
329e1272c08SAndreas Gohr/**
330e1272c08SAndreas Gohr * Execute a fulltext search
331e1272c08SAndreas Gohr *
332e1272c08SAndreas Gohr * @param string $query search query
333e1272c08SAndreas Gohr * @param array $highlight words to highlight
334e1272c08SAndreas Gohr * @param string|null $sort sorting order
335e1272c08SAndreas Gohr * @param int|string|null $after only show results after this date
336e1272c08SAndreas Gohr * @param int|string|null $before only show results before this date
337e1272c08SAndreas Gohr * @return array
338e1272c08SAndreas Gohr *
339e1272c08SAndreas Gohr * @deprecated 2026-04-07 use dokuwiki\Search\FulltextSearch::pageSearch() instead
340e1272c08SAndreas Gohr */
341e1272c08SAndreas Gohrfunction ft_pageSearch($query, &$highlight, $sort = null, $after = null, $before = null)
342e1272c08SAndreas Gohr{
343e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(dokuwiki\Search\FulltextSearch::class . '::pageSearch()');
3449313ce6dSAndreas Gohr    if (!is_array($highlight)) $highlight = [];
345e1272c08SAndreas Gohr    return (new dokuwiki\Search\FulltextSearch())->pageSearch($query, $highlight, $sort, $after, $before);
346e1272c08SAndreas Gohr}
347e1272c08SAndreas Gohr
348e1272c08SAndreas Gohr/**
349e1272c08SAndreas Gohr * Returns the backlinks for a given page
350e1272c08SAndreas Gohr *
351e1272c08SAndreas Gohr * @param string $id page id
352e1272c08SAndreas Gohr * @param bool $ignore_perms
353e1272c08SAndreas Gohr * @return string[]
354e1272c08SAndreas Gohr *
355e1272c08SAndreas Gohr * @deprecated 2026-04-07 use dokuwiki\Search\MetadataSearch::backlinks() instead
356e1272c08SAndreas Gohr */
357e1272c08SAndreas Gohrfunction ft_backlinks($id, $ignore_perms = false)
358e1272c08SAndreas Gohr{
359e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(dokuwiki\Search\MetadataSearch::class . '::backlinks()');
360e1272c08SAndreas Gohr    return (new dokuwiki\Search\MetadataSearch())->backlinks($id, $ignore_perms);
361e1272c08SAndreas Gohr}
362e1272c08SAndreas Gohr
363e1272c08SAndreas Gohr/**
364e1272c08SAndreas Gohr * Returns the pages that use a given media file
365e1272c08SAndreas Gohr *
366e1272c08SAndreas Gohr * @param string $id media id
367e1272c08SAndreas Gohr * @param bool $ignore_perms
368e1272c08SAndreas Gohr * @return string[]
369e1272c08SAndreas Gohr *
370e1272c08SAndreas Gohr * @deprecated 2026-04-07 use dokuwiki\Search\MetadataSearch::mediause() instead
371e1272c08SAndreas Gohr */
372e1272c08SAndreas Gohrfunction ft_mediause($id, $ignore_perms = false)
373e1272c08SAndreas Gohr{
374e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(dokuwiki\Search\MetadataSearch::class . '::mediause()');
375e1272c08SAndreas Gohr    return (new dokuwiki\Search\MetadataSearch())->mediause($id, $ignore_perms);
376e1272c08SAndreas Gohr}
377e1272c08SAndreas Gohr
378e1272c08SAndreas Gohr/**
379e1272c08SAndreas Gohr * Quicksearch for pagenames
380e1272c08SAndreas Gohr *
381e1272c08SAndreas Gohr * @param string $id page id
382e1272c08SAndreas Gohr * @param bool $in_ns match namespace
383e1272c08SAndreas Gohr * @param bool $in_title search in title
384e1272c08SAndreas Gohr * @param int|string|null $after
385e1272c08SAndreas Gohr * @param int|string|null $before
386e1272c08SAndreas Gohr * @return string[]
387e1272c08SAndreas Gohr *
388e1272c08SAndreas Gohr * @deprecated 2026-04-07 use dokuwiki\Search\MetadataSearch::pageLookup() instead
389e1272c08SAndreas Gohr */
390e1272c08SAndreas Gohrfunction ft_pageLookup($id, $in_ns = false, $in_title = false, $after = null, $before = null)
391e1272c08SAndreas Gohr{
392e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(dokuwiki\Search\MetadataSearch::class . '::pageLookup()');
393e1272c08SAndreas Gohr    return (new dokuwiki\Search\MetadataSearch())->pageLookup($id, $in_ns, $in_title, $after, $before);
394e1272c08SAndreas Gohr}
395e1272c08SAndreas Gohr
396e1272c08SAndreas Gohr/**
397e1272c08SAndreas Gohr * Creates a snippet extract
398e1272c08SAndreas Gohr *
399e1272c08SAndreas Gohr * @param string $id page id
400e1272c08SAndreas Gohr * @param array $highlight words to highlight
401e1272c08SAndreas Gohr * @return string
402e1272c08SAndreas Gohr *
403e1272c08SAndreas Gohr * @deprecated 2026-04-07 use dokuwiki\Search\FulltextSearch::snippet() instead
404e1272c08SAndreas Gohr */
405e1272c08SAndreas Gohrfunction ft_snippet($id, $highlight)
406e1272c08SAndreas Gohr{
407e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(dokuwiki\Search\FulltextSearch::class . '::snippet()');
408e1272c08SAndreas Gohr    return (new dokuwiki\Search\FulltextSearch())->snippet($id, $highlight);
409e1272c08SAndreas Gohr}
410e1272c08SAndreas Gohr
411e1272c08SAndreas Gohr/**
412e1272c08SAndreas Gohr * Sort pages based on their namespace level first, then alphabetically
413e1272c08SAndreas Gohr *
414e1272c08SAndreas Gohr * @param string $a
415e1272c08SAndreas Gohr * @param string $b
416e1272c08SAndreas Gohr * @return int
417e1272c08SAndreas Gohr *
418e1272c08SAndreas Gohr * @deprecated 2026-04-07 use Utf8\Sort functions directly
419e1272c08SAndreas Gohr */
420e1272c08SAndreas Gohrfunction ft_pagesorter($a, $b)
421e1272c08SAndreas Gohr{
422e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction('Utf8\\Sort');
423e1272c08SAndreas Gohr    $diff = substr_count($a, ':') - substr_count($b, ':');
424e1272c08SAndreas Gohr    return $diff ?: dokuwiki\Utf8\Sort::strcmp($a, $b);
425e1272c08SAndreas Gohr}
426e1272c08SAndreas Gohr
427e1272c08SAndreas Gohr/**
428e1272c08SAndreas Gohr * Wrap a search term in regex boundary checks
429e1272c08SAndreas Gohr *
430e1272c08SAndreas Gohr * @param string $term
431e1272c08SAndreas Gohr * @return string
432e1272c08SAndreas Gohr *
433e1272c08SAndreas Gohr * @deprecated 2026-04-07 use dokuwiki\Search\FulltextSearch::snippetRePreprocess() instead
434e1272c08SAndreas Gohr */
435e1272c08SAndreas Gohrfunction ft_snippet_re_preprocess($term)
436e1272c08SAndreas Gohr{
437e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(dokuwiki\Search\FulltextSearch::class . '::snippetRePreprocess()');
438e1272c08SAndreas Gohr    return (new dokuwiki\Search\FulltextSearch())->snippetRePreprocess($term);
439e1272c08SAndreas Gohr}
440e1272c08SAndreas Gohr
441e1272c08SAndreas Gohr/**
442e1272c08SAndreas Gohr * Parse a search query into its components
443e1272c08SAndreas Gohr *
444e1272c08SAndreas Gohr * @param mixed $Indexer ignored (legacy parameter)
445e1272c08SAndreas Gohr * @param string $query search query
446e1272c08SAndreas Gohr * @return array parsed query structure
447e1272c08SAndreas Gohr *
448e1272c08SAndreas Gohr * @deprecated 2026-04-07 use dokuwiki\Search\Query\QueryParser::convert() instead
449e1272c08SAndreas Gohr */
450e1272c08SAndreas Gohrfunction ft_queryParser($Indexer, $query)
451e1272c08SAndreas Gohr{
452e1272c08SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(dokuwiki\Search\Query\QueryParser::class . '::convert()');
453e1272c08SAndreas Gohr    return (new dokuwiki\Search\Query\QueryParser())->convert($query);
454e1272c08SAndreas Gohr}
4559db5ea06SAndreas Gohr
4569db5ea06SAndreas Gohr/**
45771096e46SAndreas Gohr * @deprecated 2026-04-16 use \dokuwiki\Parsing\ParserMode\Media::parseMedia() instead
45871096e46SAndreas Gohr */
45971096e46SAndreas Gohrfunction Doku_Handler_Parse_Media($match)
46071096e46SAndreas Gohr{
46171096e46SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(\dokuwiki\Parsing\ParserMode\Media::class . '::parseMedia()');
46271096e46SAndreas Gohr    return \dokuwiki\Parsing\ParserMode\Media::parseMedia($match);
46371096e46SAndreas Gohr}
464*73dc0a89SAndreas Gohr
465*73dc0a89SAndreas Gohr/**
466*73dc0a89SAndreas Gohr * @deprecated 2026-05-06 use \dokuwiki\MailUtils::PREG_PATTERN_VALID_EMAIL instead!
467*73dc0a89SAndreas Gohr */
468*73dc0a89SAndreas Gohrif (!defined('PREG_PATTERN_VALID_EMAIL')) define('PREG_PATTERN_VALID_EMAIL', MailUtils::PREG_PATTERN_VALID_EMAIL);
469*73dc0a89SAndreas Gohr
470*73dc0a89SAndreas Gohr/**
471*73dc0a89SAndreas Gohr * @deprecated 2026-05-06 use \dokuwiki\MailUtils::obfuscate() instead!
472*73dc0a89SAndreas Gohr */
473*73dc0a89SAndreas Gohrfunction obfuscate($email)
474*73dc0a89SAndreas Gohr{
475*73dc0a89SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(MailUtils::class . '::obfuscate');
476*73dc0a89SAndreas Gohr    return MailUtils::obfuscate($email);
477*73dc0a89SAndreas Gohr}
478*73dc0a89SAndreas Gohr
479*73dc0a89SAndreas Gohr/**
480*73dc0a89SAndreas Gohr * @deprecated 2026-05-06 use \dokuwiki\MailUtils::isValid() instead!
481*73dc0a89SAndreas Gohr */
482*73dc0a89SAndreas Gohrfunction mail_isvalid($email)
483*73dc0a89SAndreas Gohr{
484*73dc0a89SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(MailUtils::class . '::isValid');
485*73dc0a89SAndreas Gohr    return MailUtils::isValid($email);
486*73dc0a89SAndreas Gohr}
487*73dc0a89SAndreas Gohr
488*73dc0a89SAndreas Gohr/**
489*73dc0a89SAndreas Gohr * @deprecated 2026-05-06 use \dokuwiki\MailUtils::quotedPrintableEncode() instead!
490*73dc0a89SAndreas Gohr */
491*73dc0a89SAndreas Gohrfunction mail_quotedprintable_encode($sText, $maxlen = 74, $bEmulate_imap_8bit = true)
492*73dc0a89SAndreas Gohr{
493*73dc0a89SAndreas Gohr    DebugHelper::dbgDeprecatedFunction(MailUtils::class . '::quotedPrintableEncode');
494*73dc0a89SAndreas Gohr    return MailUtils::quotedPrintableEncode($sText, $maxlen, $bEmulate_imap_8bit);
495*73dc0a89SAndreas Gohr}
496