定制 irfantoor/terminal 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

irfantoor/terminal

Composer 安装命令:

composer require irfantoor/terminal

包简介

Irfan's Terminal : A terminal for your cli or html clients

README 文档

README

A terminal for your cli or html clients.

Usage

See different examples in the examples folder.

<?php

require dirname(__DIR__) . "/vendor/autoload.php";

use IrfanTOOR\Terminal;

$t = new Terminal;

# printing with style
$t->write("Hello ", "green");
$t->writeln("World ", "red");

# use writeMultiple to write multiple lines.
$t->writeMultiple(
    [
        'These are multiple lines',
        'with a common style applied',
        'to all lines'
    ], 
    'bg_blue, white'
);

# reading from console
$response = $t->read("Are you ok? [Y/N] ", "info");

$t->write("you responded with: ");
$t->writeln($response, "info, reverse");

Styles

Foreground Styles

  • none
  • bold
  • dark
  • italic
  • underline
  • blink
  • reverse
  • concealed
  • default
  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • light_gray
  • dark_gray
  • light_red
  • light_green
  • light_yellow
  • light_blue
  • light_magenta
  • light_cyan
  • white

Background Styles

  • bg_default
  • bg_black
  • bg_red
  • bg_green
  • bg_yellow
  • bg_blue
  • bg_magenta
  • bg_cyan
  • bg_light_gray
  • bg_dark_gray
  • bg_light_red
  • bg_light_green
  • bg_light_yellow
  • bg_light_blue
  • bg_light_magenta
  • bg_light_cyan
  • bg_white

Theme Styles

  • info
  • error
  • warning
  • success
  • note
  • footnote
  • url

Note: All the theme styles can be modiied by providing the definition while creating the console. or by using the function setTheme.

<?php
 
require dirname(__DIR__) . "/vendor/autoload.php";

$t = new IrfanTOOR\Terminal();
$t->setTheme(
    [
        'info' => 'bg_black, yellow',
        'url'  => 'red, underline',
    ]
);

# Theme
$t->writeln("Modified theme >> info", "info");
$t->writeln("https://github.com/irfantoor/console", "url");

$t->setTheme(
    [
        'url' => 'red, bg_light_yellow, underline'
    ]
);

$t->writeln("https://github.com/irfantoor/console", "url");

统计信息

  • 总下载量: 273
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固