[Gravity] FAO file_exists wrapper

Review Request #307 — Created May 15, 2014 and updated

dinos
Lunr
dinostheo:FileExists
lunr
Adds a FAO wrapper for the file_exists function as well as checks filetype and compares file values.
unit tests
  • 2
  • 0
  • 1
  • 0
  • 3
Description From Last Updated
explanation sounds weird pprkut pprkut
I checked file and dir, not sure if block and char are affected as well. Bash behaviour is to follow ... pprkut pprkut
dinos
Review request changed

Change Summary:

Changed completely the structure of the implemented function

Description:

~  

Adds a FAO wrapper for the file_exists function.

  ~

Adds a FAO wrapper for the file_exists function as well as checks filetype and compares file values.

-   It also changes the mkdir to make use of the FAO file_exists. That is also the reason of the dependency #306

Depends On:

-306 - [Gravity] Wrapper for the mkdir function

Diff:

Revision 2 (+632)

Show changes

pprkut
  1. 
      
  2. src/Lunr/Gravity/Filesystem/FileFlags.php (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     
     
    explanation sounds weird
    1. taken from the man pages
      http://www.cyberciti.biz/faq/unix-linux-test-existence-of-file-in-bash/
    2. I'd just go with "file exists and is a block special file". When you have a "pdf file" you also don't say "This file is pdf"
  3. Not sure if possible, but could we set the default value to the constant?
  4. src/Lunr/Gravity/Filesystem/PhysicalFilesystemAccessObject.php (Diff revision 2)
     
     
     
     
     
     
     
     
     
    I checked file and dir, not sure if block and char are affected as well. Bash behaviour is to follow the symlink. So a symlink pointing to a directory would return TRUE at a "-d" check. I don't think that's the case here.
    1. is_dir() and is_file could substitute those 2, as they return TRUE in case that are symlinks to a directory and a file respectively. I will have to test further for block and char.
  5. 
      
Loading...