Namespaces

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

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:  * @author     David Grudl
15:  */
16: class CompileException extends \Exception
17: {
18:     /** @var string */
19:     public $sourceCode;
20: 
21:     /** @var string */
22:     public $sourceName;
23: 
24:     /** @var int */
25:     public $sourceLine;
26: 
27: 
28:     public function setSource($code, $line, $name = NULL)
29:     {
30:         $this->sourceCode = (string) $code;
31:         $this->sourceLine = (int) $line;
32:         $this->sourceName = (string) $name;
33:         if (@is_file($name)) { // @ - may trigger error
34:             $this->message = rtrim($this->message, '.')
35:                 . ' in ' . str_replace(dirname(dirname($name)), '...', $name) . ($line ? ":$line" : '');
36:         }
37:         return $this;
38:     }
39: 
40: }
41: 
42: 
43: /**
44:  * The exception that indicates error of the last Regexp execution.
45:  */
46: class RegexpException extends \Exception
47: {
48:     public static $messages = array(
49:         PREG_INTERNAL_ERROR => 'Internal error',
50:         PREG_BACKTRACK_LIMIT_ERROR => 'Backtrack limit was exhausted',
51:         PREG_RECURSION_LIMIT_ERROR => 'Recursion limit was exhausted',
52:         PREG_BAD_UTF8_ERROR => 'Malformed UTF-8 data',
53:         5 => 'Offset didn\'t correspond to the begin of a valid UTF-8 code point', // PREG_BAD_UTF8_OFFSET_ERROR
54:     );
55: 
56:     public function __construct($message, $code = NULL)
57:     {
58:         parent::__construct($message ?: (isset(self::$messages[$code]) ? self::$messages[$code] : 'Unknown error'), $code);
59:     }
60: 
61: }
62: 
63: 
64: /**
65:  * The exception that indicates error during rendering template.
66:  */
67: class RuntimeException extends \Exception
68: {
69: }
70: 
Nette 2.2 API documentation generated by ApiGen 2.8.0