/var/www/hkosl.com/littleark/webadmin/libraies/league/flysystem/src/Adapter/Ftpd.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

namespace League\Flysystem\Adapter;

class 
Ftpd extends Ftp
{
    
/**
     * @inheritdoc
     */
    
public function getMetadata($path)
    {
        if (empty(
$path) || ! ($object ftp_raw($this->getConnection(), 'STAT ' $path)) || count($object) < 3) {
            return 
false;
        }

        if (
substr($object[1], 05) === "ftpd:") {
            return 
false;
        }

        return 
$this->normalizeObject($object[1], '');
    }

    
/**
     * @inheritdoc
     */
    
protected function listDirectoryContents($directory$recursive true)
    {
        
$listing ftp_rawlist($this->getConnection(), $directory$recursive);

        if (
$listing === false || ( ! empty($listing) && substr($listing[0], 05) === "ftpd:")) {
            return [];
        }

        return 
$this->normalizeListing($listing$directory);
    }
}