Returns a printable representation of the exception
target. If no target has been explicitly passed in,
the last non-array segments of the path are returned.

@return string
167507
protected function getTargetNode()
    {
        if (null === $target = $this->getTarget()) {
            $segments = explode('/', $this->getPath());
            $target = '';

            while (count($segments) > 0) {
                $segment = array_pop($segments);
                $target = $segment.'/'.$target;

                if (!is_numeric($segment)) {
                    break;
                }
            }

            return rtrim($target, '/');
        }

        return $target;
    }
553679
public function getLastError()
    {
        if($this->lastError) {
            return $this->lastError->getMessage();
        }
        $error = $this->pdo->errorInfo();
        if ($error[1]) {
            print_debug($error);
        }
        return $error[2];
    }
237008
public function getFragment(): string
    {
        if (!isset($this->segments['fragment'])) {
            throw new UrlException('Unable to get fragment for ' . $this->url);
        }

        return $this->segments['fragment'];
    }
852630
public function getPrintableMessage()
    {
        $ret = $this->message;

        if ($this->_parser != null) {
            $string = rtrim($this->_parser->getString());
            $offset = $this->_parser->getOffset();

            $rightStr = substr($string, $offset);
            $offset0 = $offset + strlen($rightStr) - strlen(ltrim($rightStr));

            $str1 = substr($string, 0, $offset0);
            $offset1 = strrpos($str1, "\n");
            if ($offset1 !== false) {
                $offset1++;
            }

            $str2 = substr($string, $offset1);
            $offset2 = strpos($str2, "\n");
            if ($offset2 === false) {
                $offset2 = strlen($str2);
            }

            $str3 = substr($str2, 0, $offset2);
            $line = $offset0 > 0? substr_count($string, "\n", 0, $offset0) : 0;
            $column = $offset0 - $offset1;

            $ret = "$str3\n" . str_repeat(" ", $column) . "^" . $this->message;
            if ($line > 0) {
                $ret .= " (line " . ($line + 1) . ")";
            }
        }

        return $ret;
    }
1184023
public function toString()
    {
        ob_start();

        printf(
            "%s Exception: %s\n\nMessage: %s\n\nCode:\n\t%s\n\n" .
                "Created in file '%s' on line %s.\n\n",
            $this->wasHandled() ? 'Caught' : 'Uncaught',
            $this->class,
            $this->getMessage(),
            $this->getCode(),
            $this->getFile(),
            $this->getLine()
        );

        echo "Stack Trace:\n";
        $count = count($this->backtrace);

        foreach ($this->backtrace as $entry) {
            $class = array_key_exists('class', $entry) ? $entry['class'] : null;

            $function = array_key_exists('function', $entry)
                ? $entry['function']
                : null;

            if (array_key_exists('args', $entry)) {
                $arguments = $this->getArguments(
                    $entry['args'],
                    $function,
                    $class
                );
            } else {
                $arguments = '';
            }

            printf(
                "%s. In file '%s' on line %s.\n%sMethod: %s%s%s(%s)\n",
                str_pad(--$count, 6, ' ', STR_PAD_LEFT),
                array_key_exists('file', $entry) ? $entry['file'] : 'unknown',
                array_key_exists('line', $entry) ? $entry['line'] : 'unknown',
                str_repeat(' ', 8),
                $class === null ? '' : $class,
                array_key_exists('type', $entry) ? $entry['type'] : '',
                $function === null ? '' : $function,
                $arguments
            );
        }

        echo "\n";

        return ob_get_clean();
    }
314771
public function getOutput(): string
    {
        $log_file = $this->config->getLogFile();
        if (!file_exists($log_file)) {
            $msg = "Server output log file does not exists '$log_file'";
            $this->logger->error("Get server output failed: $msg");
            throw new Exception\RuntimeException($msg);
        } elseif (!is_readable($log_file)) {
            $msg = "Cannot read log file do to missing read permission '$log_file'";
            $this->logger->error("Get server output failed: $msg");
            throw new Exception\RuntimeException($msg);
        }
        $output = file_get_contents($log_file);

        return $output;
    }
944660
public function getLineFormatter()
    {
        $formatter = function($line) {
            $line['online'] = $this->isOnline($line['lastActivity']);
            $line['intervalLastLogin'] = $this->getIntervalLastLogin($line['lastLogin']);
            $line['lastActivity'] = '';
            return $line;
        };
        
        return $formatter;
    }
1251623
protected function getCurrentResourceSetWrapper()
    {
        $segmentWrappers = $this->getStack()->getSegmentWrappers();
        $count = count($segmentWrappers);

        return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count-1];
    }
990253
public function getExceptionsMap()
    {
        if(empty($this->exceptionsMap)) {
            $fileExtToPos = array_flip($this->getPosFileMaps());
            
            foreach($this->getExceptionFileNames() as $fileName )
            {
                $pos = $fileExtToPos[substr($fileName, 0, -4)];
                $fh = fopen($this->getDir().$fileName,'r');
                if(!$fh) {
                    throw new RuntimeException("wordnet file missing {$fileName}");
                }                
                                
                while($line = fgets($fh)) 
                {
                    if($line[0] === ' ') {
                        continue;
                    }
                    $this->exceptionsMap[] = $this->getExceptionMapFromString(trim($line), $pos);

                }               
                fclose($fh);
            } 
        }
        return $this->exceptionsMap;
    }
819664
protected function format_exception( Exception $exception ) {
		$string = get_class( $exception );

		if ( ! empty( $exception->getMessage() ) ) {
			$string .= " : {$exception->getMessage()}";
		}

		if ( ! empty( $exception->getCode() ) ) {
			$string .= " (#{$exception->getCode()})";
		}

		return $string;
	}
199200
public function getRequestException()
    {
        if (!is_null($this->requestException)) {
            return $this->requestException;
        }

        $search = function (\Exception $exception = null) use (&$search) {
            $previous = $exception->getPrevious();

            if (is_null($previous)) {
                return null;
            }

            if ($previous instanceof RequestException) {
                return $this->requestException = $previous;
            }

            return $search($previous);
        };

        return $search($this);
    }
642095
private function getNotificationMessage(Throwable $exception): string
    {
        if ($exception instanceof HttpExceptionInterface) {
            return $exception->getMessage();
        }

        $file = new SplFileInfo($exception->getFile());
        $line = $exception->getLine();

        $relativePathname = (new Filesystem())->makePathRelative($file->getPath(), $this->rootDir) . $file->getFilename();

        $message = $exception->getMessage();

        return sprintf('%s [in %s:%d]', $message, $relativePathname, $line);
    }
836040
private function resolveValidPath():string{
		$last = null;
		foreach( $this->tree as $level ){
			if( !$level->exist ){
				break;
			}
			$last = $level;
		}
		if( $last === null ){
			return '';
		}
		return $last->path;
	}
1289890
protected function getExceptionMessageAppendix()
    {
        $tmp = [];
        if ($this->sourceBlueprint) { $tmp[] = 'Blueprint: ' . $this->sourceBlueprint->getName(); }
        if ($this->sourceType) { $tmp[] = 'Type:' . $this->sourceType; }
        if ($this->sourceKey) { $tmp[] = 'Key:' . $this->sourceKey; }
        if (count($tmp)) {
            return ' (' . implode(', ', $tmp) . ')';
        }
        return '';
    }
607067
public function getTarget()
    {
        if ($this->cPointerExternalLink != '') {
            if ($this->cPointerExternalLinkNewWindow) {
                return '_blank';
            }
        }

        $_c = $this->getCollectionObject();
        if (is_object($_c)) {
            return $_c->getAttribute('nav_target');
        }

        return '';
    }
273036
private static function _formatException($exception)
    {
        return str_replace(realpath(BASE_PATH), '', \Mmi\App\FrontController::getInstance()->getEnvironment()->requestUri . ' (' . $exception->getMessage() . ') @' .
            $exception->getFile() . '(' . $exception->getLine() . ') ' .
            self::_formatTrace($exception));
    }
681302
public function toString()
    {
        $result = '';

        if (!empty($this->scheme)) {
            $result.= $this->scheme . ':';
        }

        if (!empty($this->authority)) {
            $result.= '//' . $this->authority;
        }

        $result.= $this->path;

        if (!empty($this->query)) {
            $result.= '?' . $this->query;
        }

        if (!empty($this->fragment)) {
            $result.= '#' . $this->fragment;
        }

        return $result;
    }