Skip to content

Commit

Permalink
Merge pull request tpyo#94 from gabrieljenik/patch-2
Browse files Browse the repository at this point in the history
Added Default Delimiter
  • Loading branch information
tpyo committed Jan 22, 2015
2 parents 8413f6f + 75de3ab commit 0265ad0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ class S3
* @static
*/
private static $__sslKey = null;

/**
* Default delimiter to be used, for example while getBucket().
* @var string
* @access public
* @static
*/
public static $defDelimiter = null;

/**
* AWS URI
Expand Down Expand Up @@ -416,6 +424,7 @@ public static function getBucket($bucket, $prefix = null, $marker = null, $maxKe
if ($marker !== null && $marker !== '') $rest->setParameter('marker', $marker);
if ($maxKeys !== null && $maxKeys !== '') $rest->setParameter('max-keys', $maxKeys);
if ($delimiter !== null && $delimiter !== '') $rest->setParameter('delimiter', $delimiter);
else if (!empty(self::$defDelimiter)) $rest->setParameter('delimiter', self::$defDelimiter);
$response = $rest->getResponse();
if ($response->error === false && $response->code !== 200)
$response->error = array('code' => $response->code, 'message' => 'Unexpected HTTP status');
Expand Down

0 comments on commit 0265ad0

Please sign in to comment.