/usr/share/php/Nette/Latte/exceptions.php is in php-nette 2.4-20160731-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | <?php
/**
* This file is part of the Latte (https://latte.nette.org)
* Copyright (c) 2008 David Grudl (https://davidgrudl.com)
*/
namespace Latte;
/**
* The exception occured during Latte compilation.
*/
class CompileException extends \Exception
{
/** @var string */
public $sourceCode;
/** @var string */
public $sourceName;
/** @var int */
public $sourceLine;
public function setSource($code, $line, $name = NULL)
{
$this->sourceCode = (string) $code;
$this->sourceLine = (int) $line;
$this->sourceName = (string) $name;
if (@is_file($name)) { // @ - may trigger error
$this->message = rtrim($this->message, '.')
. ' in ' . str_replace(dirname(dirname($name)), '...', $name) . ($line ? ":$line" : '');
}
return $this;
}
}
/**
* The exception that indicates error of the last Regexp execution.
*/
class RegexpException extends \Exception
{
public static $messages = [
PREG_INTERNAL_ERROR => 'Internal error',
PREG_BACKTRACK_LIMIT_ERROR => 'Backtrack limit was exhausted',
PREG_RECURSION_LIMIT_ERROR => 'Recursion limit was exhausted',
PREG_BAD_UTF8_ERROR => 'Malformed UTF-8 data',
5 => 'Offset didn\'t correspond to the begin of a valid UTF-8 code point', // PREG_BAD_UTF8_OFFSET_ERROR
];
public function __construct($message, $code = NULL)
{
parent::__construct($message ?: (isset(self::$messages[$code]) ? self::$messages[$code] : 'Unknown error'), $code);
}
}
/**
* The exception that indicates error during rendering template.
*/
class RuntimeException extends \Exception
{
}
|