Skip to content

Commit cd4e354

Browse files
authored
feat: add custom time to object metadata (GoogleCloudPlatform#1166)
Adding a new metadata field to print out.
1 parent fec93c9 commit cd4e354

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

storage/src/object_metadata.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,19 @@ function object_metadata($bucketName, $objectName)
7777
printf('Content-type: %s' . PHP_EOL, $info['contentType']);
7878
}
7979
if (isset($info['temporaryHold'])) {
80-
printf("Temporary hold: " . ($info['temporaryHold'] ? "enabled" : "disabled") . PHP_EOL);
80+
printf('Temporary hold: %s' . PHP_EOL, ($info['temporaryHold'] ? 'enabled' : 'disabled'));
8181
}
8282
if (isset($info['eventBasedHold'])) {
83-
printf("Event-based hold: " . ($info['eventBasedHold'] ? "enabled" : "disabled") . PHP_EOL);
83+
printf('Event-based hold: %s' . PHP_EOL, ($info['eventBasedHold'] ? 'enabled' : 'disabled'));
8484
}
8585
if (isset($info['retentionExpirationTime'])) {
86-
printf("retentionExpirationTime: " . $info['retentionExpirationTime'] . PHP_EOL);
86+
printf('Retention Expiration Time: %s' . PHP_EOL, $info['retentionExpirationTime']);
87+
}
88+
if (isset($info['customTime'])) {
89+
printf('Custom Time: %s' . PHP_EOL, $info['customTime']);
8790
}
8891
if (isset($info['metadata'])) {
89-
printf('Metadata: %s', print_r($info['metadata'], true));
92+
printf('Metadata: %s' . PHP_EOL, print_r($info['metadata'], true));
9093
}
9194
}
9295
# [END storage_get_metadata]

0 commit comments

Comments
 (0)