mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
Fix parsing allinfo result
This commit is contained in:
parent
2a101e73bc
commit
2754259528
2 changed files with 33 additions and 1 deletions
|
|
@ -108,7 +108,7 @@ class Parser {
|
|||
if ($name === 'write_time') {
|
||||
$mtime = strtotime($value);
|
||||
} else if ($name === 'attributes') {
|
||||
$mode = hexdec(substr($value, 1, -1));
|
||||
$mode = hexdec(substr($value, strpos($value, '('), -1));
|
||||
} else if ($name === 'stream') {
|
||||
list(, $size,) = explode(' ', $value);
|
||||
$size = intval($size);
|
||||
|
|
|
|||
|
|
@ -63,6 +63,38 @@ class Parser extends \PHPUnit_Framework_TestCase {
|
|||
'mode' => FileInfo::MODE_NORMAL,
|
||||
'size' => 29634
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'altname: folder',
|
||||
'create_time: Sat Oct 12 07:05:58 PM 2013 CEST',
|
||||
'access_time: Tue Oct 15 02:58:48 PM 2013 CEST',
|
||||
'write_time: Sat Oct 12 07:05:58 PM 2013 CEST',
|
||||
'change_time: Sat Oct 12 07:05:58 PM 2013 CEST',
|
||||
'attributes: D (10)',
|
||||
'stream: [::$DATA], 29634 bytes'
|
||||
),
|
||||
array(
|
||||
'mtime' => strtotime('12 Oct 2013 19:05:58 CEST'),
|
||||
'mode' => FileInfo::MODE_DIRECTORY,
|
||||
'size' => 29634
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'altname: .hidden',
|
||||
'create_time: Sat Oct 12 07:05:58 PM 2013 CEST',
|
||||
'access_time: Tue Oct 15 02:58:48 PM 2013 CEST',
|
||||
'write_time: Sat Oct 12 07:05:58 PM 2013 CEST',
|
||||
'change_time: Sat Oct 12 07:05:58 PM 2013 CEST',
|
||||
'attributes: HA (22)',
|
||||
'stream: [::$DATA], 29634 bytes'
|
||||
),
|
||||
array(
|
||||
'mtime' => strtotime('12 Oct 2013 19:05:58 CEST'),
|
||||
'mode' => FileInfo::MODE_HIDDEN + FileInfo::MODE_ARCHIVE,
|
||||
'size' => 29634
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue