PhamlpException.php 956 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /* SVN FILE: $Id: HamlException.php 61 2010-04-16 10:19:59Z chris.l.yates $ */
  3. /**
  4. * Phamlp exception.
  5. * @author Chris Yates <chris.l.yates@gmail.com>
  6. * @copyright Copyright (c) 2010 PBM Web Development
  7. * @license http://phamlp.googlecode.com/files/license.txt
  8. * @package PHamlP
  9. */
  10. require_once('Phamlp.php');
  11. /**
  12. * Phamlp exception class.
  13. * Base class for PHamlP::Haml and PHamlP::Sass exceptions.
  14. * Translates exception messages.
  15. * @package PHamlP
  16. */
  17. class PhamlpException extends Exception {
  18. /**
  19. * Phamlp Exception.
  20. * @param string Category (haml|sass)
  21. * @param string Exception message
  22. * @param array parameters to be applied to the message using <code>strtr</code>.
  23. */
  24. public function __construct($category, $message, $params, $object) {
  25. parent::__construct(Phamlp::t($category, $message, $params) .
  26. (is_object($object) ? ": {$object->filename}::{$object->line}\nSource: {$object->source}" : '')
  27. );
  28. }
  29. }