Fixed nested deletes in FTP and corrected directory listing prefixes.

Fixed nested deletes in FTP and corrected directory listing prefixes.

АвторFrank de Jonge
КоммитерFrank de Jonge
12 лет назад
Файлов изменено: 2
+4
–5
f5f97f5
Родители fe63d2d 1.0.x
src/Adapter/AbstractFtpAdapter.php
@@ -211,7 +211,7 @@
        while ($item = array_shift($listing)) {
            if (preg_match('#^.*:$#', $item)) {
                $base = $prefix.substr($item2, -1);
                $base = trim($item, './:');
                continue;
            }
@@ -236,7 +236,6 @@
    {
        $item = preg_replace('#\s+#', ' ', trim($item));
        list ($permissions/* $number *//* $owner *//* $group */$size$month$day$time$name) = explode(' ', $item9);
        $type = $this->detectType($permissions);
        $path = empty($base) ? $name : $base . $this->separator . $name;
src/Adapter/Ftp.php
@@ -183,9 +183,9 @@
        foreach ($contents as $object) {
            if ($object['type'] === 'file') {
                ftp_delete($connection$dirname . $this->separator . $object['path']);
                ftp_delete($connection$object['path']);
            } else {
                ftp_rmdir($connection$dirname . $this->separator . $object['path']);
                ftp_rmdir($connection$object['path']);
            }
        }
@@ -230,7 +230,7 @@
    public function getMetadata($path)
    {
        if (empty($path) || ( ! ($object = ftp_raw($this->getConnection(), 'STAT ' . $path)) && count($object) < 3)) {
        if (empty($path) ||  ! ($object = ftp_raw($this->getConnection(), 'STAT ' . $path)) || count($object) < 3) {
            return false;
        }

Cherry-pick

Команда cherry-pick позволяет выбрать отдельные коммиты из одной ветки и применить их к другой.