Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/*
4
 * This file is part of Psy Shell.
5
 *
200 lars 6
 * (c) 2012-2023 Justin Hileman
148 lars 7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
 
12
namespace Psy\Readline;
13
 
14
/**
15
 * An interface abstracting the various readline_* functions.
16
 */
17
interface Readline
18
{
19
    /**
20
     * @param string|false $historyFile
21
     * @param int|null     $historySize
22
     * @param bool|null    $eraseDups
23
     */
24
    public function __construct($historyFile = null, $historySize = 0, $eraseDups = false);
25
 
26
    /**
27
     * Check whether this Readline class is supported by the current system.
28
     */
29
    public static function isSupported(): bool;
30
 
31
    /**
32
     * Check whether this Readline class supports bracketed paste.
33
     */
34
    public static function supportsBracketedPaste(): bool;
35
 
36
    /**
37
     * Add a line to the command history.
38
     *
39
     * @param string $line
40
     *
41
     * @return bool Success
42
     */
43
    public function addHistory(string $line): bool;
44
 
45
    /**
46
     * Clear the command history.
47
     *
48
     * @return bool Success
49
     */
50
    public function clearHistory(): bool;
51
 
52
    /**
53
     * List the command history.
54
     *
200 lars 55
     * @return string[]
148 lars 56
     */
57
    public function listHistory(): array;
58
 
59
    /**
60
     * Read the command history.
61
     *
62
     * @return bool Success
63
     */
64
    public function readHistory(): bool;
65
 
66
    /**
67
     * Read a single line of input from the user.
68
     *
69
     * @param string|null $prompt
70
     *
71
     * @return false|string
72
     */
73
    public function readline(string $prompt = null);
74
 
75
    /**
76
     * Redraw readline to redraw the display.
77
     */
78
    public function redisplay();
79
 
80
    /**
81
     * Write the command history to a file.
82
     *
83
     * @return bool Success
84
     */
85
    public function writeHistory(): bool;
86
}