X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FReadline%2FHoaConsole.php;fp=vendor%2Fpsy%2Fpsysh%2Fsrc%2FReadline%2FHoaConsole.php;h=9330d259eebb90b0678296428caa8f1b37d9a139;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=0000000000000000000000000000000000000000;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/psy/psysh/src/Readline/HoaConsole.php b/vendor/psy/psysh/src/Readline/HoaConsole.php new file mode 100644 index 000000000..9330d259e --- /dev/null +++ b/vendor/psy/psysh/src/Readline/HoaConsole.php @@ -0,0 +1,107 @@ +hoaReadline = new HoaReadline(); + } + + /** + * {@inheritdoc} + */ + public function addHistory($line) + { + $this->hoaReadline->addHistory($line); + + return true; + } + + /** + * {@inheritdoc} + */ + public function clearHistory() + { + $this->hoaReadline->clearHistory(); + + return true; + } + + /** + * {@inheritdoc} + */ + public function listHistory() + { + $i = 0; + $list = []; + while (($item = $this->hoaReadline->getHistory($i++)) !== null) { + $list[] = $item; + } + + return $list; + } + + /** + * {@inheritdoc} + */ + public function readHistory() + { + return true; + } + + /** + * {@inheritdoc} + * + * @throws BreakException if user hits Ctrl+D + * + * @return string + */ + public function readline($prompt = null) + { + return $this->hoaReadline->readLine($prompt); + } + + /** + * {@inheritdoc} + */ + public function redisplay() + { + // noop + } + + /** + * {@inheritdoc} + */ + public function writeHistory() + { + return true; + } +}