"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/helpers/BaseConsole.php" between
yii2-2.0.35.tar.gz and yii2-2.0.36.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

BaseConsole.php  (yii2-2.0.35):BaseConsole.php  (yii2-2.0.36)
<?php <?php
/** /**
* @link http://www.yiiframework.com/ * @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC * @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/ * @license http://www.yiiframework.com/license/
*/ */
namespace yii\helpers; namespace yii\helpers;
use Yii;
use yii\console\Markdown as ConsoleMarkdown; use yii\console\Markdown as ConsoleMarkdown;
use yii\base\Model; use yii\base\Model;
/** /**
* BaseConsole provides concrete implementation for [[Console]]. * BaseConsole provides concrete implementation for [[Console]].
* *
* Do not use BaseConsole. Use [[Console]] instead. * Do not use BaseConsole. Use [[Console]] instead.
* *
* @author Carsten Brandt <mail@cebe.cc> * @author Carsten Brandt <mail@cebe.cc>
* @since 2.0 * @since 2.0
skipping to change at line 346 skipping to change at line 347
* Returns the length of the string without ANSI color codes. * Returns the length of the string without ANSI color codes.
* @param string $string the string to measure * @param string $string the string to measure
* @return int the length of the string not counting ANSI format characters * @return int the length of the string not counting ANSI format characters
*/ */
public static function ansiStrlen($string) public static function ansiStrlen($string)
{ {
return mb_strlen(static::stripAnsiFormat($string)); return mb_strlen(static::stripAnsiFormat($string));
} }
/** /**
* Returns the width of the string without ANSI color codes.
* @param string $string the string to measure
* @return int the width of the string not counting ANSI format characters
* @since 2.0.36
*/
public static function ansiStrwidth($string)
{
return mb_strwidth(static::stripAnsiFormat($string), Yii::$app->charset)
;
}
/**
* Converts an ANSI formatted string to HTML. * Converts an ANSI formatted string to HTML.
* *
* Note: xTerm 256 bit colors are currently not supported. * Note: xTerm 256 bit colors are currently not supported.
* *
* @param string $string the string to convert. * @param string $string the string to convert.
* @param array $styleMap an optional mapping of ANSI control codes such as * @param array $styleMap an optional mapping of ANSI control codes such as
* FG\_*COLOR* or [[BOLD]] to a set of css style definitions. * FG\_*COLOR* or [[BOLD]] to a set of css style definitions.
* The CSS style definitions are represented as an array where the array key s correspond * The CSS style definitions are represented as an array where the array key s correspond
* to the css style attribute names and the values are the css values. * to the css style attribute names and the values are the css values.
* values may be arrays that will be merged and imploded with `' '` when ren dered. * values may be arrays that will be merged and imploded with `' '` when ren dered.
 End of changes. 2 change blocks. 
0 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)