Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Utils
  • none
  • Tracy
    • Bridges
      • Nette

Classes

  • Compiler
  • Engine
  • HtmlNode
  • MacroNode
  • MacroTokens
  • Object
  • Parser
  • PhpWriter
  • Token

Interfaces

  • ILoader
  • IMacro

Exceptions

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