* throw new ezcConfigurationFileException( ezcConfigurationFileException:: * FILE_NOT_READABLE, $filename ); * * * @package Configuration * @version 1.0beta2 */ class ezcConfigurationFileException extends Exception { /** * The configuration file could not be found on the filesystem. */ const FILE_NOT_FOUND = 1; /** * The configuration file could not be read from the filesystem. */ const FILE_NOT_READABLE = 2; /** * The configuration file could not be written to the filesystem. */ const FILE_NOT_WRITABLE = 3; /** * Constructs a file exception. * * Creates the exceptions with one of the class constants as error code. * The error message will be generated automatically from the code with * the file $filename specified in it. * * @param int $code * @param string $filename */ public function __construct( $code, $filename ) { switch ( $code ) { case self::FILE_NOT_FOUND: $message = "The INI file <$filename> could not be found"; break; case self::FILE_NOT_READABLE: $message = "The INI file <$filename> could not be opened for reading"; break; case self::FILE_NOT_WRITABLE: $message = "The INI file <$filename> could not be opened for writing"; break; } parent::__construct( $message, $code ); } } ?>