From b2a4e85a952e1f0989233d5e4afac90781ff91e6 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Fri, 19 Oct 2018 12:37:37 +0200 Subject: [PATCH] Use kevinlebron/colors.php in monitor pane --- Blacklight/TmuxOutput.php | 32 +++++++++---------- Changelog | 1 + app/Extensions/helper/helpers.php | 13 ++++++++ composer.json | 1 + composer.lock | 53 ++++++++++++++++++++++++++++++- 5 files changed, 83 insertions(+), 17 deletions(-) diff --git a/Blacklight/TmuxOutput.php b/Blacklight/TmuxOutput.php index cdb5e6870..8d1197ba0 100755 --- a/Blacklight/TmuxOutput.php +++ b/Blacklight/TmuxOutput.php @@ -509,16 +509,16 @@ class TmuxOutput extends Tmux ); $pieces = explode(' ', $this->pdo->getAttribute(\PDO::ATTR_SERVER_INFO)); - $buffer .= ColorCLI::primaryOver("\nThreads = "). - ColorCLI::headerOver($pieces[4]). - ColorCLI::primaryOver(', Opens = '). - ColorCLI::headerOver($pieces[14]). - ColorCLI::primaryOver(', Tables = '). - ColorCLI::headerOver($pieces[22]). - ColorCLI::primaryOver(', Slow = '). - ColorCLI::headerOver($pieces[11]). - ColorCLI::primaryOver(', QPS = '). - ColorCLI::header($pieces[28]); + $buffer .= color("\nThreads = ")->green. + color($pieces[4])->yellow. + color(', Opens = ')->green. + color($pieces[14])->yellow. + color(', Tables = ')->green. + color($pieces[22])->yellow. + color(', Slow = ')->green. + color($pieces[11])->yellow. + color(', QPS = ')->green. + color($pieces[28])->yellow.PHP_EOL; return $buffer; } @@ -555,11 +555,11 @@ class TmuxOutput extends Tmux protected function _setColourMasks(): void { - $this->_colourMasks[1] = ColorCLI::headerOver('%-18s').' '.ColorCLI::tmuxOrange('%-48.48s'); - $this->_colourMasks['2.0'] = ColorCLI::alternateOver('%-20s').' '.ColorCLI::tmuxOrange('%-33.33s'); - $this->_colourMasks['2.1'] = ColorCLI::headerOver('%-20s').' '.ColorCLI::tmuxOrange('%-33.33s'); - $this->_colourMasks[3] = ColorCLI::header('%-16.16s %25.25s %25.25s'); - $this->_colourMasks[4] = ColorCLI::primaryOver('%-16.16s').' '.ColorCLI::tmuxOrange('%25.25s %25.25s'); - $this->_colourMasks[5] = ColorCLI::tmuxOrange('%-16.16s %25.25s %25.25s'); + $this->_colourMasks[1] = color('%-18s')->yellow.' '.color('%-48.48s')->yellow->dark; + $this->_colourMasks['2.0'] = color('%-20s')->magenta->dark.' '.color('%-33.33s')->yellow->dark.PHP_EOL; + $this->_colourMasks['2.1'] = color('%-20s')->yellow.' '.color('%-33.33s')->yellow->dark.PHP_EOL; + $this->_colourMasks[3] = color('%-16.16s %25.25s %25.25s')->yellow.PHP_EOL; + $this->_colourMasks[4] = color('%-16.16s')->green.' '.color('%25.25s %25.25s')->yellow->dark; + $this->_colourMasks[5] = color('%-16.16s %25.25s %25.25s')->yellow->dark; } } diff --git a/Changelog b/Changelog index 88d2123ec..280463f13 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-10-19 DariusIII + * Chg: Use kevinlebron/colors.php in monitor pane * Chg: Use league/climate in ColorCLI class * Chg: Check for empty filename before processing filename matching * Chg: Increase matching percentage for matchPreDbFiles function diff --git a/app/Extensions/helper/helpers.php b/app/Extensions/helper/helpers.php index be1628370..6e0ef674d 100644 --- a/app/Extensions/helper/helpers.php +++ b/app/Extensions/helper/helpers.php @@ -1,6 +1,7 @@ =5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*", + "satooshi/php-coveralls": "1.0.*", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-0": { + "Colors": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kevin Le Brun", + "email": "lebrun.k@gmail.com", + "homepage": "http://kevinlebrun.fr", + "role": "developer" + } + ], + "description": "Colors for PHP CLI scripts", + "homepage": "https://github.com/kevinlebrun/colors.php", + "keywords": [ + "cli", + "color", + "colors", + "console", + "shell" + ], + "time": "2018-05-30T08:34:23+00:00" + }, { "name": "kevinrob/guzzle-cache-middleware", "version": "v2.1.1",