}
// Try to open a handler
- $filePointer = @fopen($fileName, 'rb');
+ $filePointer = fopen($fileName, 'rb');
if ((is_null($filePointer)) || ($filePointer === false)) {
// Something bad happend
throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
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