Subversion-Projekte lars-tiefland.laravel_shop

Revision

Zur aktuellen Revision | Details | 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
 *
6
 * (c) 2012-2022 Justin Hileman
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
     * @return bool
30
     */
31
    public static function isSupported(): bool;
32
 
33
    /**
34
     * Check whether this Readline class supports bracketed paste.
35
     *
36
     * @return bool
37
     */
38
    public static function supportsBracketedPaste(): bool;
39
 
40
    /**
41
     * Add a line to the command history.
42
     *
43
     * @param string $line
44
     *
45
     * @return bool Success
46
     */
47
    public function addHistory(string $line): bool;
48
 
49
    /**
50
     * Clear the command history.
51
     *
52
     * @return bool Success
53
     */
54
    public function clearHistory(): bool;
55
 
56
    /**
57
     * List the command history.
58
     *
59
     * @return array
60
     */
61
    public function listHistory(): array;
62
 
63
    /**
64
     * Read the command history.
65
     *
66
     * @return bool Success
67
     */
68
    public function readHistory(): bool;
69
 
70
    /**
71
     * Read a single line of input from the user.
72
     *
73
     * @param string|null $prompt
74
     *
75
     * @return false|string
76
     */
77
    public function readline(string $prompt = null);
78
 
79
    /**
80
     * Redraw readline to redraw the display.
81
     */
82
    public function redisplay();
83
 
84
    /**
85
     * Write the command history to a file.
86
     *
87
     * @return bool Success
88
     */
89
    public function writeHistory(): bool;
90
}