message = $message; $this->backtrace = debug_backtrace(); } public function __toString() { $out = '
'; $c = count($this->backtrace); foreach($this->backtrace as $line) { $out .= '[ #'. $c.' ]
'; $out .= '[ method ]' . $line['function'] . '()
[ file ] ' . $line['file'] . ' (line: ' . $line['line'] .')

'; $c--; } $out .= '
'; return $out; } } /** * Obsluga wyjatkow plikowych * */ class FileException extends CoreException { /** * Backtrace * * @var array */ public $backtrace; /** * Konstruktor * * @param string $message * @param integer $code */ public function __construct($message=false, $code=false) { $this->message = $message; $this->backtrace = debug_backtrace(); } } /** * Obsluga wyjatkow mysql * */ class MysqlException extends FileException { /** * Backtrace * * @var array */ public $backtrace; /** * Konstruktor * * @param string $message * @param integer $code */ public function __construct($message=false, $code=false) { if(!$message) { $this->message = mysql_error(); } else $this->message = $message; if(!$code) { $this->code = mysqli_errno(1); } else $this->code = $code; $this->backtrace = debug_backtrace(); } } /** * Obsluga wyjatkow autoryzacji * */ class AuthException extends MysqlException { /** * Backtrace * * @var array */ public $backtrace; /** * Konstruktor * * @param string $message * @param integer $code */ public function __construct($message=false, $code=false) { $this->backtrace = debug_backtrace(); } } /** * Obsluga wyjatkow uzytkownika * */ class UserException extends AuthException { /** * Backtrace * * @var array */ public $backtrace; /** * Konstruktor * * @param string $message * @param integer $code */ public function __construct($message=false, $code=false) { $this->message = $message; $this->backtrace = debug_backtrace(); } } /** * Wyjatek ApiException. * * @author WP */ class ApiException extends Exception { } /** * Wyjatek SecurityException. * * @author WP */ class SecurityException extends ApiException { } ?>