Permalink
Browse files

Request #17131 Ability to fetch the logging information per bucket.

  • Loading branch information...
1 parent 498f27e commit 80451956bf9c7abedfd625c686aa909679966441 @CloCkWeRX CloCkWeRX committed Jan 25, 2012
Showing with 27 additions and 0 deletions.
  1. +27 −0 Services/Amazon/S3/Resource/Bucket.php
@@ -451,6 +451,33 @@ public function loadLoggingStatus()
}
// }}}
+ // {{{ getLogging
+
+ /**
+ * Get the logging information of this Bucket
+ *
+ * Queries the server for a bucket and retrieves the
+ * logging status (?logging) for a bucket.
+ *
+ * @throws Services_Amazon_S3_Exception
+ *
+ * @return mixed bool|DOMNodeList Either a false if
+ * no logging information is found or
+ * a DOMNodeList of the targetbucket and
+ * the location of that logging file in the log
+ */
+ public function getLogging()
+ {
+ $response = $this->s3->sendRequest($this, '?logging');
+
+ $query = '/s3:BucketLoggingStatus/s3:LoggingEnabled';
+ $xPath = Services_Amazon_S3::getDOMXPath($response);
+ $s = $xPath->evaluate($query);
+
+ return $s->length > 0 ? $s : false;
+ }
+ // }}}
+
}
?>

0 comments on commit 8045195

Please sign in to comment.