End a started action.
@param string $message
@param string $color
@return string
423128
public function endAction($message = 'done', $color = self::CLIGHT_GREEN) {
        $r = '';
        if (empty($this->currentAction)) {
            return $this->output($r);
        }
        $r .= $this->currentAction['message'];
        $time = $this->timeItTook($this->currentAction['time']);
        $length = ($this->currentActionHadLogs ? 0 : $this->currentAction['length']) + $this->lastTimeLenght + $this->getTextLength(' [' . $message . '] ');
        $spaceLength = $this->getScreen('columns') - $length - 2;
        $r .= ' ';
        if ($spaceLength > 0) {
            $r .= $this->color(str_repeat('.', $spaceLength), self::CDARK_GRAY);
        }
        $r .= $this->color(' [' . $message . '] ', $color) . $this->color($time) . "\n";
        $this->currentAction = null;
        if ($this->pendingActionLogs) {
            $r .= implode("\n", $this->pendingActionLogs) . "\n";
        }
        return $this->output($r);
    }
1368904
public static function outputAsSuccess(string $message, string $exit = "yes")
    {
        $colors = self::getManagerColorInstance();
        echo "\n\n".$colors->getColoredString($message, "green", "transparent");
        if ($exit == "yes") {
            exit();
        }
    }
674196
public static function output($message, $color = null)
    {
        if (is_string($color)) {
            $message = sprintf($color, $message);
        }

        if (is_null(self::$map)) {
            self::setMap();
        }

        call_user_func(self::$map, $message);
    }
316042
function finish(cb) {
      clearTimeout(timer);
      timer = null;
      return subscriber.unsubscribe(
        'message/' + id + '/' + getIndex, cb);
    }
857603
public function end()
    {
        // Already ended, skip
        if ($this->ended === true) {
            return;
        }

        if (function_exists('fastcgi_finish_request')) {
            fastcgi_finish_request();
        }

        $this->ended = true;

        $this->completeContext();
        $this->completeResponse();

        // We really want to avoid throwing exceptions there
        try {
            $this->log();
        } catch (Exception $e) {
            error_log($e->getMessage());
        }
    }
1079390
public function abort($message = 'Not authorized.', $config = '', $code = 'error')
	{
		return response()->json([
			'code' => $code,
			'errors' => [
				$code => [
					0 => $message,
				],
			],
			'config' => $config,
		], 430);
	}
6439
public function end($message)
    {
        $this->info($message);

        if ($this->progressBar instanceof ProgressBar) {
            $this->progressBar->setMessage($message);
            $this->progressBar->finish();
        }
    }
681843
protected function log($msg, $color = 'default')
    {
        if (!$this->quiet) {
            if ('default' !== $color) {
                $msg = $this->colorize($color, $msg);
            }
            fwrite($this->stderr, $msg."\n");
        }
    }
818964
static public function endsWith($string, $needle, $message = null, $propertyPath = null, $encoding = 'utf8')
        {
            static::string($string);

            $stringPosition = mb_strlen($string, $encoding) - mb_strlen($needle, $encoding);

            if (mb_strripos($string, $needle, null, $encoding) !== $stringPosition) {
                $message = $message ?: sprintf(
                    'Value "%s" does not end with "%s".',
                    static::stringify($string),
                    static::stringify($needle)
                );

                $constraints = array('needle' => $needle, 'encoding' => $encoding);

                throw static::createException($string, $message, static::INVALID_STRING_END, $propertyPath, $constraints);
            }
        }
396063
public function colorize(string $startColor, string $text, string $endColor = self::NORMAL): string
    {
        if ($this->getEnableColoredOutput()) {
            return $startColor . $text . $endColor;
        }

        return $text;
    }
658725
public function send($message, $from, $color = null)
    {
        $data = [
            'room_id' => $this->name,
            'message' => $message,
            'from' => $from
        ];

        if ($color) {
            $data['color'] = $color;
        }

        $this->connection->write('/v1/rooms/message', $data);
    }
359088
public function beginShape(\Jdenticon\Color $color)
    {
        $colorString = $color->toHexString(6);
        
        if (isset($this->pathsByColor[$colorString])) {
            $this->path = $this->pathsByColor[$colorString];
        } else {
            $this->path = new SvgPath();
            $this->pathsByColor[$colorString] = $this->path;
        }
    }
1326155
public function abort($code, $message='')
	{
		switch ($code)
		{
			case 404:
				throw new NotFoundException($message, $code);
			break;

			case 403:
				throw new NotAuthorizedException($message, $code);
			break;

			default:
				throw new RuntimeException($message, $code);
			break;
		}
	}
828472
public function stop($status = 0, $message = null) {
		if ($message) {
			($status == 0) ? $this->out($message) : $this->error($message);
		}
		exit($status);
	}
901579
protected static function __abort($message, $start)
        {
            $result = Symphony::Log()->pushToLog($message, E_ERROR, true);

            if ($result) {
                Symphony::Log()->writeToLog('============================================', true);
                Symphony::Log()->writeToLog(sprintf('INSTALLATION ABORTED: Execution Time - %d sec (%s)',
                    max(1, time() - $start),
                    date('d.m.y H:i:s')
                ), true);
                Symphony::Log()->writeToLog('============================================' . PHP_EOL . PHP_EOL . PHP_EOL, true);
            }

            self::__render(new InstallerPage('failure'));
        }
69289
public static function color($text, $color)
    {
        if (isset(ShellTool::$colors[$color])) {
            return ShellTool::$colors[$color]['start'] . $text . ShellTool::$colors[$color]['close'];
        } else {
            return $text;
        }
    }
205477
public static function displayAsGreen(string $message, string $exit = "yes", bool $header = true)
    {
        $colors = self::getManagerColorInstance();
        echo $colors->getColoredString($message, "green", "transparent", $header);
        if ($exit == "yes") {
            exit();
        }
    }