X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fclasses%2Fmain%2Fio%2Fclass_FrameworkFileInputPointer.php;h=61582a65d7014c43510186d1c1ae1c14a11b04c5;hb=f5cf5211620c1813c76d8231819b63a585fb2689;hp=c7a6ad178902b1bc5be94fb430c27676f95fb4db;hpb=1d0f8e0fa7346ab3df9d0ee44c4c957047711ddc;p=core.git diff --git a/inc/classes/main/io/class_FrameworkFileInputPointer.php b/inc/classes/main/io/class_FrameworkFileInputPointer.php index c7a6ad17..61582a65 100644 --- a/inc/classes/main/io/class_FrameworkFileInputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileInputPointer.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -71,7 +71,7 @@ class FrameworkFileInputPointer extends BaseFrameworkSystem { // Some pre-sanity checks... if ((is_null($fileName)) || (empty($fileName))) { // No filename given - throw new FileIsEmptyException(null, self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING); } elseif (!file_exists($fileName)) { // File does not exist! throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_FOUND); @@ -81,8 +81,8 @@ class FrameworkFileInputPointer extends BaseFrameworkSystem { } // Try to open a handler - $filePointer = @fopen($fileName, 'rb'); - if ((is_null($filePointer)) || ($filePointer === false)) { + $filePointer = fopen($fileName, 'rb'); + if ((is_null($filePointer)) || ($filePointer === FALSE)) { // Something bad happend throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID); } // END - if @@ -120,28 +120,6 @@ class FrameworkFileInputPointer extends BaseFrameworkSystem { return fread($this->getPointer(), 1024); } - /** - * Read lines from a file pointer - * - * @return mixed The result of fread() - * @throws NullPointerException If the file pointer instance - * is not set by setPointer() - * @throws InvalidResourceException If there is being set - * an invalid file resource - */ - public function readLinesFromFile () { - if (is_null($this->getPointer())) { - // Pointer not initialized - throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_resource($this->getPointer())) { - // Pointer is not a valid resource! - throw new InvalidResourceException($this, self::EXCEPTION_INVALID_DIRECTORY_POINTER); - } - - // Read data from the file pointer and return it - return fgets($this->getPointer(), 1024); - } - /** * Close a file source and set it's instance to null and the file name * to empty