Rewritten:
[core.git] / framework / main / exceptions / file_directory / class_FileReadProtectedException.php
index 7be7ba632f9d35fbf8c27b960f2cb5965f1e2dbb..039e1bd382c33cf02d1c0182457cd9ce0ac46e23 100644 (file)
@@ -5,6 +5,9 @@ namespace CoreFramework\FileSystem;
 // Import framework stuff
 use CoreFramework\Generic\FrameworkException;
 
 // Import framework stuff
 use CoreFramework\Generic\FrameworkException;
 
+// Import SPL stuff
+use \SplFileInfo;
+
 /**
  * An exception thrown when a file is read-protected
  *
 /**
  * An exception thrown when a file is read-protected
  *
@@ -31,13 +34,13 @@ class FileReadProtectedException extends FrameworkException {
        /**
         * The constructor
         *
        /**
         * The constructor
         *
-        * @param       $fileName       File which cannot be read from
+        * @param       $infoInstance   An instance of a SplFileInfo class
         * @param       $code           Code number for the exception
         * @return      void
         */
         * @param       $code           Code number for the exception
         * @return      void
         */
-       public function __construct ($fileName, $code) {
+       public function __construct (SplFileInfo $infoInstance, $code) {
                // Add a message around the missing class
                // Add a message around the missing class
-               $message = sprintf('File %s is read-protected. Please set read access rights (CHMOD).', $fileName);
+               $message = sprintf('File %s is read-protected. Please set read access rights (CHMOD).', $infoInstance->getPathname());
 
                // Call parent constructor
                parent::__construct($message, $code);
 
                // Call parent constructor
                parent::__construct($message, $code);