From:             oorza2k5 at gmail dot com
Operating system: *nix
PHP version:      5.3.0
PHP Bug Type:     Session related
Bug description:  mod_files.sh patch

Description:
------------
here's a script, mod_files.sh, in ext/session for creating directory
tree with depth X for sessions.  As it stands, it's pretty poorly
documented and very basic.  I got exceptionally bored and rewrote most
of it, the patch is attached.  It runs fine for me in linux (with sh
version 4.0).  I don't have any other *NIX systems to test it out on,
so I can't verify that it works in anything but linux, sorry.

What I changed:

1. Usage now properly reflects arguments, and is better explained.
2. Will create directory given if it doesn't exist
3. Will hop into interactive select if directory already has contents
4. Switched from "test" to "[[ ]]" as it's easier to read and _should_
be just as supported.

Reproduce code:
---------------
Patch is available at

http://pastebin.ca/1520039



Expected result:
----------------
(Old behavior)

$ sh mod_files.sh
usage: mod_files.sh basedir depth

$ sh mod_files.sh /foo 3
mod_files.sh: line 13: test: : integer expression expected
mkdir: cannot create directory `/foo/0': No such file or directory


Actual result:
--------------
(New behavior)

$ sh mod_files.sh
Usage: mod_files.sh BASE_DIRECTORY DEPTH MAJOR_PHP_VERSION
BASE_DIRECTORY will be created if it doesn't exist
DEPTH must be an integer number >0
MAJOR_PHP_VERSION should be one of 4, 5, or 6

$sh mod_files.sh /foo 3 5
Directory /foo is not empty! What would you like to do?
1) Delete directory contents  3) Quit
2) Choose another directory
#? 1
Deleting /foo contents...
Creating session path in /foo with a depth of 3 for PHP Version 5.X


-- 
Edit bug report at http://bugs.php.net/?id=49175&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=49175&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=49175&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=49175&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=49175&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=49175&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=49175&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=49175&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=49175&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=49175&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=49175&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=49175&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=49175&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=49175&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=49175&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49175&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49175&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=49175&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=49175&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=49175&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=49175&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=49175&r=mysqlcfg

Reply via email to