]> git.mxchange.org Git - shipsimu.git/blobdiff - ship-simu/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php
Initial import of current development status
[shipsimu.git] / ship-simu / inc / classes / exceptions / compressor / class_MismatchingCompressorsException.php
diff --git a/ship-simu/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php b/ship-simu/inc/classes/exceptions/compressor/class_MismatchingCompressorsException.php
new file mode 100644 (file)
index 0000000..2eb0b10
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+// An exception class for lost classes... ;-)
+class MismatchingCompressorsException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param               $message                Message from the exception
+        * @param               $code           Code number for the exception
+        * @return      void
+        */
+       public final function __construct ($array, $code) {
+               // Cast the array
+               $array = (array) $array;
+
+               // Add a message around the missing class
+               $message = sprintf("[%s:%d] Der Kompressor <u>%s</u> zu den geladenen Daten aus <u>%s</u> und der aktuell verwendete Kompressor <u>%s</u> stimmen nicht &uuml;berein!",
+                       $array[0]->__toString(),
+                       $this->getLine(),
+                       strtoupper($array[1]),
+                       sprintf("%s:%s",
+                               basename(dirname($array[2])),
+                               basename($array[2])
+                       ),
+                       strtoupper($array[3])
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>