namespace CoreFramework\Filesystem\Pointer;
// Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
use CoreFramework\FileSystem\BaseFileIo;
+use CoreFramework\FileSystem\FileReadProtectedException;
+use CoreFramework\FileSystem\FileWriteProtectedException;
+use CoreFramework\Filesystem\PathWriteProtectedException;
use CoreFramework\Generic\NullPointerException;
+use CoreFramework\Generic\UnsupportedOperationException;
use CoreFramework\Object\BaseFrameworkSystem;
/**
if ((is_null($fileName)) || (empty($fileName))) {
// No filename given
throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif (!BaseFrameworkSystem::isReachableFilePath($fileName)) {
+ } elseif (!FrameworkBootstrap::isReachableFilePath($fileName)) {
// File exists but cannot be read
throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_REACHABLE);
- } elseif ((!BaseFrameworkSystem::isReadableFile($fileName)) && (file_exists($fileName))) {
+ } elseif ((!FrameworkBootstrap::isReadableFile($fileName)) && (file_exists($fileName))) {
// File exists but cannot be read
throw new FileReadProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ);
} elseif ((file_exists($fileName)) && (!is_writable($fileName))) {
// Try to open a handler
$filePointer = fopen($fileName, 'c+b');
- if ((is_null($filePointer)) || ($filePointer === FALSE)) {
+ if ((is_null($filePointer)) || ($filePointer === false)) {
// Something bad happend
throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
} // END - if
* Write data to a file pointer
*
* @param $dataStream The data stream we shall write to the file
- * @return mixed Number of writes bytes or FALSE on error
+ * @return mixed Number of writes bytes or false on error
*/
public function writeToFile ($dataStream) {
// Validate the pointer
*
* @param $seekPosition Seek position in file
* @param $data Data to be written
- * @return mixed Number of writes bytes or FALSE on error
+ * @return mixed Number of writes bytes or false on error
*/
public function writeAtPosition ($seekPosition, $data) {
// First seek to it
/**
* Checks wether the current entry is valid (not at the end of the file).
- * This method will return TRUE if an emptied (nulled) entry has been found.
+ * This method will return true if an emptied (nulled) entry has been found.
*
* @return $isValid Whether the next entry is valid
* @throws UnsupportedOperationException If this method is called