Fixed nested deletes in FTP and corrected directory listing prefixes.
Автор
Frank de Jonge

Коммитер
Frank de Jonge
12 лет назад 
Файлов изменено: 2
+4
–5
f5f97f5
src/Adapter/AbstractFtpAdapter.php
+1
–2
@@ -211,7 +211,7 @@ | ||
while ($item = array_shift($listing)) { | ||
if (preg_match('#^.*:$#', $item)) { | ||
$base = $prefix.substr($item, 2, -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(' ', $item, 9); | ||
$type = $this->detectType($permissions); | ||
$path = empty($base) ? $name : $base . $this->separator . $name; | ||
src/Adapter/Ftp.php
+3
–3
@@ -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 позволяет выбрать отдельные коммиты из одной ветки и применить их к другой.