Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
PK! ..ň#php-console-highlighter/phpunit.xmlnu[ tests vendor PK!=!php-console-highlighter/README.mdnu[PHP Console Highlighter ======================= Highlight PHP code in console (terminal). Example ------- ![Example](http://jakubonderka.github.io/php-console-highlight-example.png) Install ------- Just create a `composer.json` file and run the `php composer.phar install` command to install it: ```json { "require": { "jakub-onderka/php-console-highlighter": "0.*" } } ``` Usage ------- ```php getWholeFile($fileContent); ``` ------ [![Downloads this Month](https://img.shields.io/packagist/dm/jakub-onderka/php-console-highlighter.svg)](https://packagist.org/packages/jakub-onderka/php-console-highlighter) [![Build Status](https://travis-ci.org/JakubOnderka/PHP-Console-Highlighter.svg?branch=master)](https://travis-ci.org/JakubOnderka/PHP-Console-Highlighter) [![License](https://poser.pugx.org/jakub-onderka/php-console-highlighter/license.svg)](https://packagist.org/packages/jakub-onderka/php-console-highlighter) PK!@77php-console-highlighter/LICENSEnu[The MIT License (MIT) Copyright (c) 2013 Jakub Onderka Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.PK!-a\/php-console-highlighter/tests/HigligterTest.phpnu[createMock('\JakubOnderka\PhpConsoleColor\ConsoleColor') : $this->getMock('\JakubOnderka\PhpConsoleColor\ConsoleColor'); $mock->expects($this->any()) ->method('apply') ->will($this->returnCallback(function ($style, $text) { return "<$style>$text"; })); $mock->expects($this->any()) ->method('hasTheme') ->will($this->returnValue(true)); return $mock; } protected function setUp() { $this->uut = new Highlighter($this->getConsoleColorMock()); } protected function compare($original, $expected) { $output = $this->uut->getWholeFile($original); $this->assertEquals($expected, $output); } public function testVariable() { $this->compare( << echo \$a; EOL ); } public function testInteger() { $this->compare( << echo 43; EOL ); } public function testFloat() { $this->compare( << echo 43.3; EOL ); } public function testHex() { $this->compare( << echo 0x43; EOL ); } public function testBasicFunction() { $this->compare( << function plus(\$a, \$b) { return \$a + \$b; } EOL ); } public function testStringNormal() { $this->compare( << echo 'Ahoj světe'; EOL ); } public function testStringDouble() { $this->compare( << echo "Ahoj světe"; EOL ); } public function testInstanceof() { $this->compare( << \$a instanceof stdClass; EOL ); } /* * Constants */ public function testConstant() { $constants = array( '__FILE__', '__LINE__', '__CLASS__', '__FUNCTION__', '__METHOD__', '__TRAIT__', '__DIR__', '__NAMESPACE__' ); foreach ($constants as $constant) { $this->compare( << $constant; EOL ); } } /* * Comments */ public function testComment() { $this->compare( << /* Ahoj */ EOL ); } public function testDocComment() { $this->compare( << /** Ahoj */ EOL ); } public function testInlineComment() { $this->compare( << // Ahoj EOL ); } public function testHashComment() { $this->compare( << # Ahoj EOL ); } public function testEmpty() { $this->compare( '' , '' ); } public function testWhitespace() { $this->compare( ' ' , ' ' ); } } PK!u}C#php-console-highlighter/.travis.ymlnu[language: php php: - 5.4 - 5.5 - 5.6 - 7.0 - 7.1 - 7.2 sudo: false cache: directories: - vendor - $HOME/.composer/cache before_script: - composer install --no-interaction --prefer-source script: - ant PK!GI%php-console-highlighter/composer.jsonnu[{ "name": "jakub-onderka/php-console-highlighter", "description": "Highlight PHP code in terminal", "type": "library", "license": "MIT", "authors": [ { "name": "Jakub Onderka", "email": "acci@acci.cz", "homepage": "http://www.acci.cz/" } ], "autoload": { "psr-4": {"JakubOnderka\\PhpConsoleHighlighter\\": "src/"} }, "require": { "php": ">=5.4.0", "ext-tokenizer": "*", "jakub-onderka/php-console-color": "~0.2" }, "require-dev": { "phpunit/phpunit": "~4.0", "jakub-onderka/php-parallel-lint": "~1.0", "jakub-onderka/php-var-dump-check": "~0.1", "squizlabs/php_codesniffer": "~1.5", "jakub-onderka/php-code-style": "~1.0" } } PK!e'I  +php-console-highlighter/src/Highlighter.phpnu[ 'red', self::TOKEN_COMMENT => 'yellow', self::TOKEN_KEYWORD => 'green', self::TOKEN_DEFAULT => 'default', self::TOKEN_HTML => 'cyan', self::ACTUAL_LINE_MARK => 'red', self::LINE_NUMBER => 'dark_gray', ); /** * @param ConsoleColor $color * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException */ public function __construct(ConsoleColor $color) { $this->color = $color; foreach ($this->defaultTheme as $name => $styles) { if (!$this->color->hasTheme($name)) { $this->color->addTheme($name, $styles); } } } /** * @param string $source * @param int $lineNumber * @param int $linesBefore * @param int $linesAfter * @return string * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException * @throws \InvalidArgumentException */ public function getCodeSnippet($source, $lineNumber, $linesBefore = 2, $linesAfter = 2) { $tokenLines = $this->getHighlightedLines($source); $offset = $lineNumber - $linesBefore - 1; $offset = max($offset, 0); $length = $linesAfter + $linesBefore + 1; $tokenLines = array_slice($tokenLines, $offset, $length, $preserveKeys = true); $lines = $this->colorLines($tokenLines); return $this->lineNumbers($lines, $lineNumber); } /** * @param string $source * @return string * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException * @throws \InvalidArgumentException */ public function getWholeFile($source) { $tokenLines = $this->getHighlightedLines($source); $lines = $this->colorLines($tokenLines); return implode(PHP_EOL, $lines); } /** * @param string $source * @return string * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException * @throws \InvalidArgumentException */ public function getWholeFileWithLineNumbers($source) { $tokenLines = $this->getHighlightedLines($source); $lines = $this->colorLines($tokenLines); return $this->lineNumbers($lines); } /** * @param string $source * @return array */ private function getHighlightedLines($source) { $source = str_replace(array("\r\n", "\r"), "\n", $source); $tokens = $this->tokenize($source); return $this->splitToLines($tokens); } /** * @param string $source * @return array */ private function tokenize($source) { $tokens = token_get_all($source); $output = array(); $currentType = null; $buffer = ''; foreach ($tokens as $token) { if (is_array($token)) { switch ($token[0]) { case T_WHITESPACE: break; case T_OPEN_TAG: case T_OPEN_TAG_WITH_ECHO: case T_CLOSE_TAG: case T_STRING: case T_VARIABLE: // Constants case T_DIR: case T_FILE: case T_METHOD_C: case T_DNUMBER: case T_LNUMBER: case T_NS_C: case T_LINE: case T_CLASS_C: case T_FUNC_C: case T_TRAIT_C: $newType = self::TOKEN_DEFAULT; break; case T_COMMENT: case T_DOC_COMMENT: $newType = self::TOKEN_COMMENT; break; case T_ENCAPSED_AND_WHITESPACE: case T_CONSTANT_ENCAPSED_STRING: $newType = self::TOKEN_STRING; break; case T_INLINE_HTML: $newType = self::TOKEN_HTML; break; default: $newType = self::TOKEN_KEYWORD; } } else { $newType = $token === '"' ? self::TOKEN_STRING : self::TOKEN_KEYWORD; } if ($currentType === null) { $currentType = $newType; } if ($currentType !== $newType) { $output[] = array($currentType, $buffer); $buffer = ''; $currentType = $newType; } $buffer .= is_array($token) ? $token[1] : $token; } if (isset($newType)) { $output[] = array($newType, $buffer); } return $output; } /** * @param array $tokens * @return array */ private function splitToLines(array $tokens) { $lines = array(); $line = array(); foreach ($tokens as $token) { foreach (explode("\n", $token[1]) as $count => $tokenLine) { if ($count > 0) { $lines[] = $line; $line = array(); } if ($tokenLine === '') { continue; } $line[] = array($token[0], $tokenLine); } } $lines[] = $line; return $lines; } /** * @param array $tokenLines * @return array * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException * @throws \InvalidArgumentException */ private function colorLines(array $tokenLines) { $lines = array(); foreach ($tokenLines as $lineCount => $tokenLine) { $line = ''; foreach ($tokenLine as $token) { list($tokenType, $tokenValue) = $token; if ($this->color->hasTheme($tokenType)) { $line .= $this->color->apply($tokenType, $tokenValue); } else { $line .= $tokenValue; } } $lines[$lineCount] = $line; } return $lines; } /** * @param array $lines * @param null|int $markLine * @return string * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException */ private function lineNumbers(array $lines, $markLine = null) { end($lines); $lineStrlen = strlen(key($lines) + 1); $snippet = ''; foreach ($lines as $i => $line) { if ($markLine !== null) { $snippet .= ($markLine === $i + 1 ? $this->color->apply(self::ACTUAL_LINE_MARK, ' > ') : ' '); } $snippet .= $this->color->apply(self::LINE_NUMBER, str_pad($i + 1, $lineStrlen, ' ', STR_PAD_LEFT) . '| '); $snippet .= $line . PHP_EOL; } return $snippet; } }PK!WW!php-console-highlighter/build.xmlnu[ PK!=@66<php-console-highlighter/examples/whole_file_line_numbers.phpnu[getWholeFileWithLineNumbers($fileContent);PK!b''/php-console-highlighter/examples/whole_file.phpnu[getWholeFile($fileContent);PK!7d߇,,,php-console-highlighter/examples/snippet.phpnu[getCodeSnippet($fileContent, 3);PK!a''"php-console-highlighter/.gitignorenu[/.idea/ /build/ /vendor/ /composer.lockPK!yphp-console-color/phpunit.xmlnu[ tests vendor PK!Zophp-console-color/README.mdnu[PHP Console Color ================= [![Build Status](https://travis-ci.org/JakubOnderka/PHP-Console-Color.svg?branch=master)](https://travis-ci.org/JakubOnderka/PHP-Console-Color) Simple library for creating colored console ouput. See `example.php` how to use this library. ![Example from Windows 10](https://user-images.githubusercontent.com/89590/40762008-687f909a-646c-11e8-88d6-e268a064be4c.png)PK!/{@##php-console-color/LICENSEnu[Copyright (c) 2014-2018, Jakub Onderka All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PK!°,php-console-color/tests/ConsoleColorTest.phpnu[isSupportedForce = $isSupported; } public function isSupported() { return $this->isSupportedForce; } public function setAre256ColorsSupported($are256ColorsSupported) { $this->are256ColorsSupportedForce = $are256ColorsSupported; } public function are256ColorsSupported() { return $this->are256ColorsSupportedForce; } } class ConsoleColorTest extends \PHPUnit_Framework_TestCase { /** @var ConsoleColorWithForceSupport */ private $uut; protected function setUp() { $this->uut = new ConsoleColorWithForceSupport(); } public function testNone() { $output = $this->uut->apply('none', 'text'); $this->assertEquals("text", $output); } public function testBold() { $output = $this->uut->apply('bold', 'text'); $this->assertEquals("\033[1mtext\033[0m", $output); } public function testBoldColorsAreNotSupported() { $this->uut->setIsSupported(false); $output = $this->uut->apply('bold', 'text'); $this->assertEquals("text", $output); } public function testBoldColorsAreNotSupportedButAreForced() { $this->uut->setIsSupported(false); $this->uut->setForceStyle(true); $output = $this->uut->apply('bold', 'text'); $this->assertEquals("\033[1mtext\033[0m", $output); } public function testDark() { $output = $this->uut->apply('dark', 'text'); $this->assertEquals("\033[2mtext\033[0m", $output); } public function testBoldAndDark() { $output = $this->uut->apply(array('bold', 'dark'), 'text'); $this->assertEquals("\033[1;2mtext\033[0m", $output); } public function test256ColorForeground() { $output = $this->uut->apply('color_255', 'text'); $this->assertEquals("\033[38;5;255mtext\033[0m", $output); } public function test256ColorWithoutSupport() { $this->uut->setAre256ColorsSupported(false); $output = $this->uut->apply('color_255', 'text'); $this->assertEquals("text", $output); } public function test256ColorBackground() { $output = $this->uut->apply('bg_color_255', 'text'); $this->assertEquals("\033[48;5;255mtext\033[0m", $output); } public function test256ColorForegroundAndBackground() { $output = $this->uut->apply(array('color_200', 'bg_color_255'), 'text'); $this->assertEquals("\033[38;5;200;48;5;255mtext\033[0m", $output); } public function testSetOwnTheme() { $this->uut->setThemes(array('bold_dark' => array('bold', 'dark'))); $output = $this->uut->apply(array('bold_dark'), 'text'); $this->assertEquals("\033[1;2mtext\033[0m", $output); } public function testAddOwnTheme() { $this->uut->addTheme('bold_own', 'bold'); $output = $this->uut->apply(array('bold_own'), 'text'); $this->assertEquals("\033[1mtext\033[0m", $output); } public function testAddOwnThemeArray() { $this->uut->addTheme('bold_dark', array('bold', 'dark')); $output = $this->uut->apply(array('bold_dark'), 'text'); $this->assertEquals("\033[1;2mtext\033[0m", $output); } public function testOwnWithStyle() { $this->uut->addTheme('bold_dark', array('bold', 'dark')); $output = $this->uut->apply(array('bold_dark', 'italic'), 'text'); $this->assertEquals("\033[1;2;3mtext\033[0m", $output); } public function testHasAndRemoveTheme() { $this->assertFalse($this->uut->hasTheme('bold_dark')); $this->uut->addTheme('bold_dark', array('bold', 'dark')); $this->assertTrue($this->uut->hasTheme('bold_dark')); $this->uut->removeTheme('bold_dark'); $this->assertFalse($this->uut->hasTheme('bold_dark')); } public function testApplyInvalidArgument() { $this->setExpectedException('\InvalidArgumentException'); $this->uut->apply(new stdClass(), 'text'); } public function testApplyInvalidStyleName() { $this->setExpectedException('\JakubOnderka\PhpConsoleColor\InvalidStyleException'); $this->uut->apply('invalid', 'text'); } public function testApplyInvalid256Color() { $this->setExpectedException('\JakubOnderka\PhpConsoleColor\InvalidStyleException'); $this->uut->apply('color_2134', 'text'); } public function testThemeInvalidStyle() { $this->setExpectedException('\JakubOnderka\PhpConsoleColor\InvalidStyleException'); $this->uut->addTheme('invalid', array('invalid')); } public function testForceStyle() { $this->assertFalse($this->uut->isStyleForced()); $this->uut->setForceStyle(true); $this->assertTrue($this->uut->isStyleForced()); } public function testGetPossibleStyles() { $this->assertInternalType('array', $this->uut->getPossibleStyles()); $this->assertNotEmpty($this->uut->getPossibleStyles()); } } PK!cbphp-console-color/.travis.ymlnu[language: php php: - 5.4 - 5.5 - 5.6 - 7.0 - 7.1 - 7.2 sudo: false cache: directories: - vendor - $HOME/.composer/cache before_script: - composer install --no-interaction --prefer-source script: - ant phplint - ant phpcs - ant phpunit PK! VVphp-console-color/composer.jsonnu[{ "name": "jakub-onderka/php-console-color", "license": "BSD-2-Clause", "authors": [ { "name": "Jakub Onderka", "email": "jakub.onderka@gmail.com" } ], "autoload": { "psr-4": {"JakubOnderka\\PhpConsoleColor\\": "src/"} }, "require": { "php": ">=5.4.0" }, "require-dev": { "phpunit/phpunit": "~4.3", "jakub-onderka/php-parallel-lint": "1.0", "jakub-onderka/php-var-dump-check": "0.*", "squizlabs/php_codesniffer": "1.*", "jakub-onderka/php-code-style": "1.0" } } PK!șiphp-console-color/example.phpnu[isSupported() ? 'Yes' : 'No') . "\n"; echo "256 colors are supported: " . ($consoleColor->are256ColorsSupported() ? 'Yes' : 'No') . "\n\n"; if ($consoleColor->isSupported()) { foreach ($consoleColor->getPossibleStyles() as $style) { echo $consoleColor->apply($style, $style) . "\n"; } } echo "\n"; if ($consoleColor->are256ColorsSupported()) { echo "Foreground colors:\n"; for ($i = 1; $i <= 255; $i++) { echo $consoleColor->apply("color_$i", str_pad($i, 6, ' ', STR_PAD_BOTH)); if ($i % 15 === 0) { echo "\n"; } } echo "\nBackground colors:\n"; for ($i = 1; $i <= 255; $i++) { echo $consoleColor->apply("bg_color_$i", str_pad($i, 6, ' ', STR_PAD_BOTH)); if ($i % 15 === 0) { echo "\n"; } } echo "\n"; } PK! z/php-console-color/src/InvalidStyleException.phpnu[\\&php-console-color/src/ConsoleColor.phpnu[ null, 'bold' => '1', 'dark' => '2', 'italic' => '3', 'underline' => '4', 'blink' => '5', 'reverse' => '7', 'concealed' => '8', 'default' => '39', 'black' => '30', 'red' => '31', 'green' => '32', 'yellow' => '33', 'blue' => '34', 'magenta' => '35', 'cyan' => '36', 'light_gray' => '37', 'dark_gray' => '90', 'light_red' => '91', 'light_green' => '92', 'light_yellow' => '93', 'light_blue' => '94', 'light_magenta' => '95', 'light_cyan' => '96', 'white' => '97', 'bg_default' => '49', 'bg_black' => '40', 'bg_red' => '41', 'bg_green' => '42', 'bg_yellow' => '43', 'bg_blue' => '44', 'bg_magenta' => '45', 'bg_cyan' => '46', 'bg_light_gray' => '47', 'bg_dark_gray' => '100', 'bg_light_red' => '101', 'bg_light_green' => '102', 'bg_light_yellow' => '103', 'bg_light_blue' => '104', 'bg_light_magenta' => '105', 'bg_light_cyan' => '106', 'bg_white' => '107', ); /** @var array */ private $themes = array(); public function __construct() { $this->isSupported = $this->isSupported(); } /** * @param string|array $style * @param string $text * @return string * @throws InvalidStyleException * @throws \InvalidArgumentException */ public function apply($style, $text) { if (!$this->isStyleForced() && !$this->isSupported()) { return $text; } if (is_string($style)) { $style = array($style); } if (!is_array($style)) { throw new \InvalidArgumentException("Style must be string or array."); } $sequences = array(); foreach ($style as $s) { if (isset($this->themes[$s])) { $sequences = array_merge($sequences, $this->themeSequence($s)); } else if ($this->isValidStyle($s)) { $sequences[] = $this->styleSequence($s); } else { throw new InvalidStyleException($s); } } $sequences = array_filter($sequences, function ($val) { return $val !== null; }); if (empty($sequences)) { return $text; } return $this->escSequence(implode(';', $sequences)) . $text . $this->escSequence(self::RESET_STYLE); } /** * @param bool $forceStyle */ public function setForceStyle($forceStyle) { $this->forceStyle = (bool) $forceStyle; } /** * @return bool */ public function isStyleForced() { return $this->forceStyle; } /** * @param array $themes * @throws InvalidStyleException * @throws \InvalidArgumentException */ public function setThemes(array $themes) { $this->themes = array(); foreach ($themes as $name => $styles) { $this->addTheme($name, $styles); } } /** * @param string $name * @param array|string $styles * @throws \InvalidArgumentException * @throws InvalidStyleException */ public function addTheme($name, $styles) { if (is_string($styles)) { $styles = array($styles); } if (!is_array($styles)) { throw new \InvalidArgumentException("Style must be string or array."); } foreach ($styles as $style) { if (!$this->isValidStyle($style)) { throw new InvalidStyleException($style); } } $this->themes[$name] = $styles; } /** * @return array */ public function getThemes() { return $this->themes; } /** * @param string $name * @return bool */ public function hasTheme($name) { return isset($this->themes[$name]); } /** * @param string $name */ public function removeTheme($name) { unset($this->themes[$name]); } /** * @return bool */ public function isSupported() { if (DIRECTORY_SEPARATOR === '\\') { if (function_exists('sapi_windows_vt100_support') && @sapi_windows_vt100_support(STDOUT)) { return true; } elseif (getenv('ANSICON') !== false || getenv('ConEmuANSI') === 'ON') { return true; } return false; } else { return function_exists('posix_isatty') && @posix_isatty(STDOUT); } } /** * @return bool */ public function are256ColorsSupported() { if (DIRECTORY_SEPARATOR === '\\') { return function_exists('sapi_windows_vt100_support') && @sapi_windows_vt100_support(STDOUT); } else { return strpos(getenv('TERM'), '256color') !== false; } } /** * @return array */ public function getPossibleStyles() { return array_keys($this->styles); } /** * @param string $name * @return string[] */ private function themeSequence($name) { $sequences = array(); foreach ($this->themes[$name] as $style) { $sequences[] = $this->styleSequence($style); } return $sequences; } /** * @param string $style * @return string */ private function styleSequence($style) { if (array_key_exists($style, $this->styles)) { return $this->styles[$style]; } if (!$this->are256ColorsSupported()) { return null; } preg_match(self::COLOR256_REGEXP, $style, $matches); $type = $matches[1] === 'bg_' ? self::BACKGROUND : self::FOREGROUND; $value = $matches[2]; return "$type;5;$value"; } /** * @param string $style * @return bool */ private function isValidStyle($style) { return array_key_exists($style, $this->styles) || preg_match(self::COLOR256_REGEXP, $style); } /** * @param string|int $value * @return string */ private function escSequence($value) { return "\033[{$value}m"; } } PK!nDDphp-console-color/build.xmlnu[ PK!/rphp-console-color/.gitignorenu[build vendor composer.lock PK!r;$$Dphp-console-highlighter/b07eac94158d047f377959dd8c014085dd1240ae.zipnuIwPK ^=M- JakubOnderka-PHP-Console-Highlighter-9f7a229/UTɯ[PK ^=Ma&'7 JakubOnderka-PHP-Console-Highlighter-9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Io|߰/ `\r[N3u-˗RY#-ViWNG[:zݍLPfvܿٗA(Ӵ~M> PK ^=MGIf: JakubOnderka-PHP-Console-Highlighter-9f7a229/composer.jsonUTɯ[AO  G#fib37R@2?Pnn@ǣ^4N)9V2SL3V 3.)K ׎+VL'ӄ./$5+ >7Ĭ۰O(SKc~?)7N%"6,)*A:sNlZ:CzW^J({ ik0"X5M: ܻ&ϊ8Jt\a?/*@%8PK ^=M=@6Q JakubOnderka-PHP-Console-Highlighter-9f7a229/examples/whole_file_line_numbers.phpUTɯ[}@{  !jlhH6N_%^efYmG>zvBvz[_d+wJNj.]Et4> Ȅ(~l+k]ɽ0[3oY0Cw1kiP :4|OSfp/ Y NĔr0<Q&PK ^=M ..8 JakubOnderka-PHP-Console-Highlighter-9f7a229/phpunit.xmlUTɯ[u=n0 w.2V {z٢]hHt>J7@4G19 ԟ0d]}[k+=Lsp 'fjD,Eef&OֹIRdWn]Ğ) FrghhYɩȮ}H 1PD(ia oR"51y{3"Hyg+Λ׻rEM̗qZVgPK ^=M1 JakubOnderka-PHP-Console-Highlighter-9f7a229/src/UTɯ[PK ^=Me'Ix @ JakubOnderka-PHP-Console-Highlighter-9f7a229/src/Highlighter.phpUTɯ[Y}o8«-]= \)T:SQM%N;nw?%'u.RՀch&A{M۫u$DpֈaI-0?$<a`O/3 z{8 tS҇Kk"pA8gɇVо5ޠ f:{} EVaksG˹4gz8u:7T35H 3/_?/`.$+n T^ $6;@<9Qsw1\H^ˠ5<! jp9Z~ɋF`֥JJ)j#Q@͒"9+$( 91d<_A#쇁P! !4pƴ8pGc˄O),tP]hVZ 1J/All&LdeWGgb! SE@}{+ DK, -:&lՍ&!LĒp q#@Bxe.<ȇ!o(~f/ߘb(x!be_^W"[+\.\8R8oO5KG|2-^gJTJlt:Bb5aD1L`/YƇԴ0~le /BR/Yvެs+ޥ(UDLʱl:oSX/S9Z鮦GFr~j*M#VF4TƷ.G?hÒ %}\I"c;s'❖)ludm2I"R8BxiBۈ&7HN.?qUѵ)ɣ |ց4d;7Ñmͯ̾u8y/yQ3"ݭm~+)=tpskR7B>~L"ԢYS'MjYѸ&pi7oČ30D;ow)9w@90iQLͩ9GO͸ܳ|&}jn s29&sۜHMӠ!.,GvG۽S3.}{[g''Ns ,%zdQ?lwƟBn%=hꞓ9BRky>绞,nd{[Sug_@y7$$P&){iBY51 .ާluQ)EYAѱS9oNr$"qe^=n {FN5 ՇW4SݮA1̼)h+R5+c=8D Xt HHI%9qi ?,E)1ګ` ̵iճљEh[덆udFc[Mr򩨉fkV=X!~c7GZ"5Lod3q, !Lj+4ҹ I-!% GdAyh{H"t%olkUڀd>o5z+.8\h!ZoΕ9pֹA[ .0@\5r\e,PK ^=M3 JakubOnderka-PHP-Console-Highlighter-9f7a229/tests/UTɯ[PK ^=M-a\D JakubOnderka-PHP-Console-Highlighter-9f7a229/tests/HigligterTest.phpUTɯ[Xݎ:SX[ʖJUᤇÂeW]AB&̒8]Pœu`% )8XB"3[)[k Ii\-Oy)s]{/̇٘jۤ"L*qh;^')0C.c}||fG*)亂1(ԪȴkeAQ;`jHz_6Y N(q-n F{<ᮨqU!n|NXqP>fZߜ7ǨkbuPB9zwŇ@/2T2M=php-console-color/fc51518233d11b43ef6ed5846bd9b655f95031dc.zipnuIwPK R=M' JakubOnderka-PHP-Console-Color-d5deaec/UT[PK R=M/r1 JakubOnderka-PHP-Console-Color-d5deaec/.gitignoreUT[build vendor composer.lock PK R=Mcb2 JakubOnderka-PHP-Console-Color-d5deaec/.travis.ymlUT[MA 0 =xv?Ajm 74e3aA)TUW^}`q)M,"i`bw{ܯmc8k# >E9x&֎1EQt,l/q2_PK R=M/{@#. JakubOnderka-PHP-Console-Color-d5deaec/LICENSEUT[RKS0WpKC[IX$'4$L}W"ڋhw*?{w{7ys?~>_^O;]kblhKƔm0n7wPw-L৾f纺 7? <|4oݍk@[xmxW'Bօ1j߼i|K0&P:@]c@^ j` ^Tv"eCQFPo}3l7/k@TPw~xM;qy3KԠl@R5f"R@*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lS7×ZrkGv倏=Һ4/ט#EyyvX 5@۶zZ.I@@%CA :`X0_jLō2d&3h8\T#)z>dzo^w PK R=My2 JakubOnderka-PHP-Console-Color-d5deaec/phpunit.xmlUT[un0 } {q!-7$-!/kV!>zwxbLB# =YF|u{)vm4w$L: E4c4\ xlE< ֈ.+ң՟de^V cPş!0#yƸ :zӟKnx]moPK R=M+ JakubOnderka-PHP-Console-Color-d5deaec/src/UT[PK R=M>E\; JakubOnderka-PHP-Console-Color-d5deaec/src/ConsoleColor.phpUT[Ymo6_A%n+NZ7Kun]Zm!#I(Hr(? WaÇkC +JfC+xq /N ǃq琣|_>EIo9H*.ãcyNo|lsj=]޶[7C<{2'WdoNύ!atŎc70BG$$i<0"mFι#Le]L1/\"wNVD6sR$9-?WQpGCsEdMB2BۚIE]s@"%x@j w?) Im?$a\&s`W+ 5M TS][WNDA%wJiA,X=}vUڭtn~˽/-J`g,絻N0j~J׭Z+TF;PPͥmz;"6h)xQ!R =)iŅKLn\c0tkןzaobW٘i44OL #ҍ7)$Ӑ1g.%7pw2r?$e"5a;%%7ao9JQKvP7 `GU,y<&F +(D}4kcwQر m)N;N/e 枛l$_28ߔ;FewTYȥJ.[+pZyy$,/V|14eW/+l:x:-F(;+(_)Khz 6L6m_0[x HQªtK$i'=m<9:a&ʥQ kޝiyͯ_s'͕Ippt~PK R=M zD JakubOnderka-PHP-Console-Color-d5deaec/src/InvalidStyleException.phpUT[M @{%XH` p٬$;G"w\p#7^Vy:mub .;%ܚOTⲿ."NsWJ*-4&_`w_ :6ӟ+<&v1"JFbFa+CJBlߎtfI}hk_r @niM~ 9"% rJUYICAqWLUdYDVr|~?LܔۺS71v\4]7{云Q̰d[t7  x$`-iߘ8H@4ߨM bbZ} Brk:b;l#iPn,?ݗLOEy&{[E\; zJakubOnderka-PHP-Console-Color-d5deaec/src/ConsoleColor.phpUT[PK R=M zD !JakubOnderka-PHP-Console-Color-d5deaec/src/InvalidStyleException.phpUT[PK R=M- $JakubOnderka-PHP-Console-Color-d5deaec/tests/UT[PK R=M°hA xJakubOnderka-PHP-Console-Color-d5deaec/tests/ConsoleColorTest.phpUT[PKH(d5deaecff52a0d61ccb613bb3804088da0307191PK! ..ň#php-console-highlighter/phpunit.xmlnu[PK!=!php-console-highlighter/README.mdnu[PK!@77php-console-highlighter/LICENSEnu[PK!-a\/m php-console-highlighter/tests/HigligterTest.phpnu[PK!u}C#"php-console-highlighter/.travis.ymlnu[PK!GI%#php-console-highlighter/composer.jsonnu[PK!e'I  +6'php-console-highlighter/src/Highlighter.phpnu[PK!WW!Dphp-console-highlighter/build.xmlnu[PK!=@66<DTphp-console-highlighter/examples/whole_file_line_numbers.phpnu[PK!b''/Uphp-console-highlighter/examples/whole_file.phpnu[PK!7d߇,,,lWphp-console-highlighter/examples/snippet.phpnu[PK!a''"Xphp-console-highlighter/.gitignorenu[PK!ymYphp-console-color/phpunit.xmlnu[PK!ZoF[php-console-color/README.mdnu[PK!/{@##$]php-console-color/LICENSEnu[PK!°,bphp-console-color/tests/ConsoleColorTest.phpnu[PK!cbwphp-console-color/.travis.ymlnu[PK! VV0yphp-console-color/composer.jsonnu[PK!și{php-console-color/example.phpnu[PK! z/php-console-color/src/InvalidStyleException.phpnu[PK!>\\&Bphp-console-color/src/ConsoleColor.phpnu[PK!nDDphp-console-color/build.xmlnu[PK!/rphp-console-color/.gitignorenu[PK!r;$$Dphp-console-highlighter/b07eac94158d047f377959dd8c014085dd1240ae.zipnuIwPK!NŠP P >php-console-color/fc51518233d11b43ef6ed5846bd9b655f95031dc.zipnuIwPK