Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.1

Bug #6754 SCO Openserver matched as WINDOWS
Submitted: 2006-02-11 17:35 UTC
From: monotask at sonaglia dot it Assigned: jorrit
Status: Closed Package: Net_FTP (version 1.3.2)
PHP Version: 5.0.5 OS:
Roadmaps: 1.4.0a1    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2007-12-22 18:36 UTC
Package:
Bug Type:
Summary:
From: monotask at sonaglia dot it
New email:
PHP Version: Package Version: OS:

 

 [2006-02-11 17:35 UTC] monotask at sonaglia dot it
Description: ------------ The class doesn't work properly when connected via FTP to a SCO Openserver (Version wu-2.6.2(1) Tue Feb 18 02:26:24 PST 2003). The result of the line $dir_list = @ftp_rawlist($this->_handle, $dir); into the function _list_and_parse($dir) is the following: array(18) { [0]=> string(9) "total 582" [1]=> string(55) "-r-------- 1 auth 0 Feb 11 18:23 .lastlogin" [2]=> string(49) "drwxrwxrwx 2 group 512 Nov 3 2003 0103" [3]=> string(49) "drwxrwxrwx 2 group 512 Aug 5 2004 0204" [4]=> string(49) "drwxrwxrwx 2 group 512 Feb 2 2005 0205" [5]=> string(49) "drwxrwxrwx 2 group 512 Feb 3 09:51 0206" [6]=> string(49) "drwxrwxrwx 2 group 512 Oct 7 2004 0303" [7]=> string(49) "drwxrwxrwx 2 group 512 Feb 8 12:48 0305" [8]=> string(49) "drwxrwxrwx 2 group 512 Nov 4 2003 0503" [9]=> string(49) "drwxrwxrwx 2 group 512 Jan 20 2004 0504" [10]=> string(49) "drwxrwxrwx 2 group 512 Jan 8 2005 0505" [11]=> string(49) "drwxrwxrwx 2 group 512 Jan 9 11:33 0506" [12]=> string(49) "drwxrwxrwx 2 group 512 Oct 31 2003 0802" [13]=> string(49) "drwxrwxrwx 2 group 92160 Jan 29 2004 0803" [14]=> string(49) "drwxrwxrwx 2 group 95744 Oct 7 2004 0804" [15]=> string(49) "drwxrwxrwx 2 group 93184 Jan 5 15:21 0805" [16]=> string(49) "drwxrwxrwx 2 group 512 Jan 2 09:01 0806" [17]=> string(49) "drwxrwxrwx 2 group 512 Oct 24 2003 0896" } It match like a windows OS. Different pattern is needed. Test script: ---------------

Comments

 [2006-02-11 19:09 UTC] monotask at sonaglia dot it
I solved my problem changing $_ls_match array in the following way: var $_ls_match = array( 'unix' => array( 'pattern' => '/(?:(d)|.)([rwxt-]+)\s+(\w+)\s+([\w\d-]+)\s+([\w\d-]+)\s+(\w+)\s+(\S+\s+\S+\s+\S+)\s+(.+)/', 'map' => array( 'is_dir' => 1, 'rights' => 2, 'files_inside' => 3, 'user' => 4, 'group' => 5, 'size' => 6, 'date' => 7, 'name' => 8, ) ), 'OpenServer' => array( 'pattern' => '/(?:(d)|.)([rwxt-]+)\s+(\w+)\s+(\w+)\s+(\w+)\s(\w+\s+\d+\s+.+)\s+(.+)/', 'map' => array( 'is_dir' => 1, 'rights' => 2, 'user' => 3, 'group' => 4, 'size' => 5, 'date' => 6, 'name' => 7, ) ), 'windows' => array( 'pattern' => '/(.+)\s+(.+)\s+((<DIR>)|[0-9]+)\s+(.+)/', 'map' => array( 'name' => 5, 'date' => 1, 'size' => 3, 'is_dir' => 4, ) ) );
 [2007-03-01 19:39 UTC] mwillbanks (Mike Willbanks)
A better solution may be to actually add a method to add individual patterns dynamically instead of having to add this type of information directly in the code base for long term support.
 [2007-11-16 21:30 UTC] jorrit (Jorrit Schippers)
The directory listing is not the default directory listing for wu-ftpd. Therefore, it is better to add a method using which programmers can set the matcher themselves. I will propose a patch shortly.
 [2007-12-22 18:36 UTC] jorrit (Jorrit Schippers)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.