Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion lib/OpenCloud/ObjectStore/Resource/CDNContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function refresh($name = null, $url = null)
{
$response = $this->createRefreshRequest()->send();

$headers = $response->getHeaders();
$headers = $response->getHeaders();
$this->setMetadata($headers, true);

return $headers;
Expand Down Expand Up @@ -92,5 +92,26 @@ public function setStaticErrorPage($page)
$headers = array('X-Container-Meta-Web-Error' => $page);
return $this->getClient()->post($this->getUrl(), $headers)->send();
}

/**
* Turn on access logs, which track all the web traffic that your data objects accrue.
*
* @return \Guzzle\Http\Message\Response
*/
public function enableCdnLogging()
{
$headers = array('X-Log-Retention' => 'True');
return $this->getClient()->put($this->getUrl(), $headers)->send();
}

/**
* Disable access logs.
*
* @return \Guzzle\Http\Message\Response
*/
public function disableCdnLogging()
{
return $this->unsetMetadataItem(HeaderConst::LOG_RETENTION);
}

}
4 changes: 1 addition & 3 deletions lib/OpenCloud/ObjectStore/Resource/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ public function enableLogging()
*/
public function disableLogging()
{
return $this->saveMetadata($this->appendToMetadata(array(
HeaderConst::ACCESS_LOGS => false
)));
return $this->unsetMetadataItem(HeaderConst::ACCESS_LOGS);
}

/**
Expand Down