Skip to content

Commit 0265ad0

Browse files
committed
Merge pull request #94 from gabrieljenik/patch-2
Added Default Delimiter
2 parents 8413f6f + 75de3ab commit 0265ad0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

S3.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ class S3
7474
* @static
7575
*/
7676
private static $__sslKey = null;
77+
78+
/**
79+
* Default delimiter to be used, for example while getBucket().
80+
* @var string
81+
* @access public
82+
* @static
83+
*/
84+
public static $defDelimiter = null;
7785

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

0 commit comments

Comments
 (0)