www.gusucode.com > CKFinder 文件管理器PHP版 v3.0源码程序 > code/core/connector/php/vendor/league/flysystem/src/Adapter/Ftpd.php

    <?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], 0, 5) === "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], 0, 5) === "ftpd:")) {
            return [];
        }

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