Skip to content

Commit bd01d37

Browse files
Tobias WilkenTooAngel
authored andcommitted
Enable int timestamp for deployment_getLog
Handle cases differently if lastTime is a string or something else
1 parent b02860a commit bd01d37

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

CloudControl/API.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,8 @@ public function deployment_delete($applicationName, $deploymentName) {
463463

464464
/**
465465
* Get a deployment's log by log_type.
466-
* log_type choices are 'access' or 'error'
467-
* last_time is optional - any English textual datetime description '2010-8-30 17:04:22' Y-m-d H:i:s
466+
* logType choices are 'access', 'error', 'worker' or 'deploy'
467+
* lastTime is optional - any English textual datetime description '2010-8-30 17:04:22' Y-m-d H:i:s or a timestamp as int or float
468468
*
469469
* @param string $applicationName applications name
470470
* @param string $deploymentName deployments name
@@ -492,7 +492,11 @@ public function deployment_getLog($applicationName, $deploymentName, $logType="e
492492
);
493493
$resource = $url;
494494
if (!is_null($lastTime)) {
495-
$timestamp = strtotime($lastTime);
495+
if (is_string($lastTime)) {
496+
$timestamp = strtotime($lastTime);
497+
} else {
498+
$timestamp = $lastTime;
499+
}
496500
$resource = sprintf('%s?timestamp=%s', $url, $timestamp);
497501
}
498502
return $this->_executeGet($resource);

0 commit comments

Comments
 (0)