3b663e3cfd5e8668360063967db0d13319975266
[yaffs-website] / vendor / lsolesen / pel / src / PelException.php
1 <?php
2
3 /**
4  * PEL: PHP Exif Library.
5  * A library with support for reading and
6  * writing all Exif headers in JPEG and TIFF images using PHP.
7  *
8  * Copyright (C) 2004, 2005 Martin Geisler.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program in the file COPYING; if not, write to the
22  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23  * Boston, MA 02110-1301 USA
24  */
25 namespace lsolesen\pel;
26
27 /**
28  * Standard PEL printf() capable exception.
29  * This class is a simple extension of the standard Exception class in
30  * PHP, and all the methods defined there retain their original
31  * meaning.
32  *
33  * @author Martin Geisler <mgeisler@users.sourceforge.net>
34  * @license http://www.gnu.org/licenses/gpl.html GNU General Public
35  *          License (GPL)
36  * @package PEL
37  *
38  * @subpackage PelException
39  */
40 class PelException extends \Exception
41 {
42
43     /**
44      * Construct a new PEL exception.
45      *
46      * @param string $fmt
47      *            an optional format string can be given. It
48      *            will be used as a format string for vprintf(). The remaining
49      *            arguments will be available for the format string as usual with
50      *            vprintf().
51      *
52      * @param mixed ...$args
53      *            any number of arguments to be used with
54      *            the format string.
55      */
56     public function __construct($fmt, $args = null)
57     {
58         $args = func_get_args();
59         $fmt = array_shift($args);
60         parent::__construct(vsprintf($fmt, $args));
61     }
62 }