[Gravity] Wrapper for the mkdir function

Review Request #306 — Created May 15, 2014 and submitted

dinos
Lunr
dinostheo:MkDir
lunr
FAO mkdir function, which is a wrapper of the the php mkdir function
unit tests
  • 0
  • 0
  • 3
  • 0
  • 3
Description From Last Updated
dinos
dinos
dinos
pprkut
  1. 
      
  2. src/Lunr/Gravity/Filesystem/PhysicalFilesystemAccessObject.php (Diff revision 4)
     
     
     
     
     
     
     
     
     
     
     
     
     
    I was wondering about mode here. This is really the most tricky thing about mkdir and while a sensible default is already good, I was wondering whether it makes sense to do input sanitizing on it as well. To avoid forwarding values like "0755" or '0755' or 755. What do you think?
    1. You are right. I remember trying to use 755 instead of 0755 and not being able to create the dir. 
      However, what should we do? Log an error and return FALSE or try to see first if the given mode is logical and format it properly. e.g. change the '0755' or the 755 to 0755.
    2. I think if we can do a reasonable conversion then that would be preferred. Otherwise, the error.
      IMHO it could be done by casting the value to int, and then checking for the integer value. Tricky part is that it can't really be a range value since it's specific values that can be allowed. Maybe somehow using a binary mask would work?
  3. 
      
dinos
dinos
tardypad
  1. Ship It!
  2. 
      
pprkut
  1. 
      
  2. I remember our discussions, so I know why you are doing this, but the error message does not match. Of course the access mode can be a string
  3. 
      
dinos
pprkut
  1. 
      
  2. Can you add the special cases here as well? Like 1777, 2777 and 4777
  3. 
      
dinos
dinos
Review request changed

Status: Closed (submitted)

Change Summary:

Merged into master
Loading...