src/sb/Samba/Connection.php
private function parseListing($listing, $subdir = '')
    {
        $ret = new \sb\Samba\Listing();
        $exp = '/^\s{2}([\w \-]+\.?\w{3,4})\s+([A-Z]?)\s+(\d+)\s+(\w{3}.+)$/';

        preg_match_all($exp, $listing, $matches);

        if($matches[0]) {
            $ret->name = $matches[1][0];
            $ret->type = $matches[2][0];
            $ret->size = $matches[3][0];
            $ret->path = $subdir;
            $ret->datemodified =  $matches[4][0];

            return $ret;
        }

        return 0;
    }
private function parseListing($listing, $subdir = '')
    {
        $ret = new \sb\Samba\Listing();
        $exp = '/^\s{2}([\w \-]+\.?\w{3,4})\s+([A-Z]?)\s+(\d+)\s+(\w{3}.+)$/';

        preg_match_all($exp, $listing, $matches);

        if($matches[0]) {
            $ret->name = $matches[1][0];
            $ret->type = $matches[2][0];
            $ret->size = $matches[3][0];
            $ret->path = $subdir;
            $ret->datemodified =  $matches[4][0];

            return $ret;
        }

        return 0;
    }
private function parseListing ( $ listing , $ subdir = '' ) { $ ret = new \ sb \ Samba \ Listing ( ) ; $ exp = '/^\s{2}([\w \-]+\.?\w{3,4})\s+([A-Z]?)\s+(\d+)\s+(\w{3}.+)$/' ; preg_match_all ( $ exp , $ listing , $ matches ) ; if ( $ matches [ 0 ] ) { $ ret -> name = $ matches [ 1 ] [ 0 ] ; $ ret -> type = $ matches [ 2 ] [ 0 ] ; $ ret -> size = $ matches [ 3 ] [ 0 ] ; $ ret -> path = $ subdir ; $ ret -> datemodified = $ matches [ 4 ] [ 0 ] ; return $ ret ; } return 0 ; }
Converts a line of returned output into a \sb\Samba_Listing object
@param $listing
@param $subdir
@return \sb\Samba\Listing
Converts a line of returned output into a \ sb \ Samba_Listing object