承接 ottosmops/consoleoutput 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

ottosmops/consoleoutput

Composer 安装命令:

composer require ottosmops/consoleoutput

包简介

Laravel Console Output Trait

README 文档

README

GitHub license Latest Stable Version Packagist Downloads

A trait you can pull into your Laravel-Commands (use \Ottosmops\Consoleoutput\ConsoleOutputTrait;). This should help to make the commands behave more like you would expect ("Silence is golden."). The effect: Errors and warnings are sent to stderr. Other messages are sent to stdout only if you call the command with -vor -vv. You can overwrite this when you call the methods. Just set another $verbosityLevel.

The trait is inspired by this blog-post: http://fideloper.com/laravel-symfony-console-commands-stderr

Installation

composer require ottosmops/consoleoutput

Usage

Just pull in the trait, and you are ready to go.

class TestCommand extents Illuminate\Console\Command
{
     use \Ottosmops\Consoleoutput\ConsoleOutputTrait;
     
     ...
     
     public function handle()
     {
        $this->info("This is only an info message."); // This message is only shown, if you call the command with '-v'. 
        $this->error("Here comes the error.");
     }
}

Methods

debug($message, $verbosityLevel = 'vv')     // black output
info($message, $verbosityLevel = 'v')       // blue output
success($message, $verbosityLevel = 'v')    // green
warn($message, $verbosityLevel = 'normal')  // orange
error($message, $verbosityLevel = 'normal') // red
fatal($message, $verbosityLevel = 'normal') //red and exits

Version 1.1

To avoid errors, the methods check if you call them from the command line. Otherwise the Laravel-Log-Methods are called.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固