X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FPsy%2FReadline%2FTransient.php;fp=vendor%2Fpsy%2Fpsysh%2Fsrc%2FPsy%2FReadline%2FTransient.php;h=0000000000000000000000000000000000000000;hp=102eaf7864f628b4d9df1b29e65a1bad22729939;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/psy/psysh/src/Psy/Readline/Transient.php b/vendor/psy/psysh/src/Psy/Readline/Transient.php deleted file mode 100644 index 102eaf786..000000000 --- a/vendor/psy/psysh/src/Psy/Readline/Transient.php +++ /dev/null @@ -1,146 +0,0 @@ -history = array(); - $this->historySize = $historySize; - $this->eraseDups = $eraseDups; - } - - /** - * {@inheritdoc} - */ - public function addHistory($line) - { - if ($this->eraseDups) { - if (($key = array_search($line, $this->history)) !== false) { - unset($this->history[$key]); - } - } - - $this->history[] = $line; - - if ($this->historySize > 0) { - $histsize = count($this->history); - if ($histsize > $this->historySize) { - $this->history = array_slice($this->history, $histsize - $this->historySize); - } - } - - $this->history = array_values($this->history); - - return true; - } - - /** - * {@inheritdoc} - */ - public function clearHistory() - { - $this->history = array(); - - return true; - } - - /** - * {@inheritdoc} - */ - public function listHistory() - { - return $this->history; - } - - /** - * {@inheritdoc} - */ - public function readHistory() - { - return true; - } - - /** - * {@inheritdoc} - * - * @throws BreakException if user hits Ctrl+D - * - * @return string - */ - public function readline($prompt = null) - { - echo $prompt; - - return rtrim(fgets($this->getStdin(), 1024)); - } - - /** - * {@inheritdoc} - */ - public function redisplay() - { - // noop - } - - /** - * {@inheritdoc} - */ - public function writeHistory() - { - return true; - } - - /** - * Get a STDIN file handle. - * - * @throws BreakException if user hits Ctrl+D - * - * @return resource - */ - private function getStdin() - { - if (!isset($this->stdin)) { - $this->stdin = fopen('php://stdin', 'r'); - } - - if (feof($this->stdin)) { - throw new BreakException('Ctrl+D'); - } - - return $this->stdin; - } -}