/**
  * Initialises the exception with the location object $location which
  * contains the locator which is missing.
  *
  * @param string $identifier The unique identifier for the compiled file.
  * @param string $path The path to the compiled file.
  */
 public function __construct($identifier, $path)
 {
     if (!file_exists($path)) {
         parent::__construct("The compiled template file '{$path}' does not exist.");
     } elseif (!is_readable($path)) {
         parent::__construct("The compiled template file '{$path}' cannot be read.");
     }
 }
 /**
  * Initialises the exception with the failing elements, parser, source code
  * and error messages.
  *
  * @param ezcTemplateSource $source         The source code which caused the error, used for file path.
  * @param ezcTemplateCursor $startCursor  
  * @param ezcTemplateCursor $errorCursor  
  * @param string $errorMessage The error message.
  * @param string $errorDetails Extra details for error.
  */
 public function __construct($source, ezcTemplateCursor $startCursor, ezcTemplateCursor $errorCursor, $errorMessage, $errorDetails = "")
 {
     $this->source = $source;
     $this->startCursor = $startCursor;
     $this->errorCursor = $errorCursor;
     $this->errorMessage = $errorMessage;
     $this->errorDetails = $errorDetails;
     parent::__construct($this->getErrorMessage());
 }
 /**
  * Initialises the exception with the failing elements, parser, source code
  * and error messages.
  *
  * @param ezcTemplateSourceToTstParser $parser  The parser which was used when error occured, can be null.
  * @param ezcTemplateCursor $cursor             The cursor pointing to the error.
  * @param string $errorMessage                  The error message.
  * @param string $errorDetails                  Extra details for error.
  */
 public function __construct($parser, ezcTemplateCursor $cursor, $errorMessage, $errorDetails = "")
 {
     // TODO fix this.
     $this->elements = array($parser);
     $this->parser = $parser;
     $this->source = $parser->parser->source;
     $this->elements[0]->startCursor = $cursor;
     $this->errorMessage = $errorMessage;
     $this->errorDetails = $errorDetails;
     parent::__construct($this->getErrorMessage());
 }
 /**
  * Initialises the exception with the type of error which automatically generates an exception message.
  *
  * @param int $type The type of element error.
  * @param string $comment Optional comment for the error, depends on $type.
  */
 public function __construct($type)
 {
     switch ($type) {
         case self::NO_FIRST_CHILD:
             $message = "Element has no children, cannot get first child.";
             break;
         case self::NO_LAST_CHILD:
             $message = "Element has no children, cannot get last child.";
             break;
     }
     parent::__construct($message);
 }
 /**
  * Initialises the exception with the template file path.
  *
  * @param string $stream The stream path to the template file which could not be
  * read.
  */
 public function __construct($stream)
 {
     parent::__construct("The requested template file '{$stream}' is not readable.");
 }
Example #6
0
 /**
  * Creates a template internal exception.
  *
  * @param string $msg
  */
 public function __construct($msg)
 {
     parent::__construct("Internal error: {$msg}");
 }
 /**
  * Initialises the exception with the template file path.
  *
  * @param string $stream The stream path to the template file which could not be
  * found.
  */
 public function __construct($stream)
 {
     parent::__construct("The requested template file '{$stream}' does not exist.");
 }
 /**
  * Constructs a template runtime exception with message $msg.
  *
  * @param string $msg
  */
 public function __construct($msg)
 {
     parent::__construct($msg);
 }
 /**
  * Constructor
  *
  * @param string $stream    The stream path to the template file which could not be written.
  * @param string $type      The type of the file that could not be read.
  */
 public function __construct($stream, $type = "requested template file")
 {
     parent::__construct("The {$type} '{$stream}' is not writeable.");
 }
 /**
  * This exception should be caught, and rethrown. The message is not important.
  */
 public function __construct()
 {
     $message = "Typehint failure";
     parent::__construct($message);
 }
 /**
  * Initialises the exception with the original template file path and the new file path.
  *
  * @param string $from The original file path.
  * @param string $to The new file path.
  */
 public function __construct($from, $to)
 {
     parent::__construct("Renaming template file from '{$from}' to '{$to}' failed.");
 }
 /**
  * Initialises the exception with the template file path.
  *
  * @param string $stream The stream path to the template file which could not be
  * unlinked.
  */
 public function __construct($stream)
 {
     parent::__construct("Unlinking template file '{$stream}' failed.");
 }
Example #13
0
 /**
  * Initialises the exception with the location object $location which
  * contains the locator which is missing.
  *
  * @param string $class The name of the class which is missing the manager.
  * @param string $property The name of the property which is missing the manager.
  */
 public function __construct($class, $property)
 {
     parent::__construct("The class '{$class}' and property '{$property}' does not contain a template manager which is required.");
 }
 /**
  * Initialises the CustomBlock exception with the given message.
  *
  * @param string $message
  */
 public function __construct($message)
 {
     parent::__construct($message);
 }