Skip to content

Commit

Permalink
Added directory create check and handle actual directories in AWS con…
Browse files Browse the repository at this point in the history
…tent listing.
  • Loading branch information
frankdejonge committed Mar 22, 2014
1 parent 18239fb commit a60a13c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Adapter/AwsS3.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ public function createDir($path)
{
$result = $this->write(rtrim($path, '/') . '/', '');

if ( ! $result) {
return false;
}

return array('path' => $path, 'type' => 'dir');
}

Expand Down Expand Up @@ -371,6 +375,13 @@ protected function normalizeObject($object, $path = null)
$result['timestamp'] = strtotime($object['LastModified']);
}

if (substr($result['path'], -1) === '/') {
$result['type'] = 'dir';
$result['path'] = rtrim($result['path'], '/');

return $result;
}

$result = array_merge($result, Util::map($object, static::$resultMap), array('type' => 'file'));
$result['dirname'] = Util::dirname($result['path']);

Expand Down

0 comments on commit a60a13c

Please sign in to comment.