@@ -40,21 +40,49 @@ function object_metadata($bucketName, $objectName)
4040 $ bucket = $ storage ->bucket ($ bucketName );
4141 $ object = $ bucket ->object ($ objectName );
4242 $ info = $ object ->info ();
43- printf ('Blob: %s ' . PHP_EOL , $ info ['name ' ]);
44- printf ('Bucket: %s ' . PHP_EOL , $ info ['bucket ' ]);
45- printf ('Storage class: %s ' . PHP_EOL , $ info ['storageClass ' ]);
46- printf ('ID: %s ' . PHP_EOL , $ info ['id ' ]);
47- printf ('Size: %s ' . PHP_EOL , $ info ['size ' ]);
48- printf ('Updated: %s ' . PHP_EOL , $ info ['updated ' ]);
49- printf ('Generation: %s ' . PHP_EOL , $ info ['generation ' ]);
50- printf ('Metageneration: %s ' . PHP_EOL , $ info ['metageneration ' ]);
51- printf ('Etag: %s ' . PHP_EOL , $ info ['etag ' ]);
52- printf ('Crc32c: %s ' . PHP_EOL , $ info ['crc32c ' ]);
53- printf ('MD5 Hash: %s ' . PHP_EOL , $ info ['md5Hash ' ]);
54- printf ('Content-type: %s ' . PHP_EOL , $ info ['contentType ' ]);
55- printf ("Temporary hold: " . ($ info ['temporaryHold ' ] ? "enabled " : "disabled " ) . PHP_EOL );
56- printf ("Event-based hold: " . ($ info ['eventBasedHold ' ] ? "enabled " : "disabled " ) . PHP_EOL );
57- if ($ info ['retentionExpirationTime ' ]) {
43+ if (isset ($ info ['name ' ])) {
44+ printf ('Blob: %s ' . PHP_EOL , $ info ['name ' ]);
45+ }
46+ if (isset ($ info ['bucket ' ])) {
47+ printf ('Bucket: %s ' . PHP_EOL , $ info ['bucket ' ]);
48+ }
49+ if (isset ($ info ['storageClass ' ])) {
50+ printf ('Storage class: %s ' . PHP_EOL , $ info ['storageClass ' ]);
51+ }
52+ if (isset ($ info ['id ' ])) {
53+ printf ('ID: %s ' . PHP_EOL , $ info ['id ' ]);
54+ }
55+ if (isset ($ info ['size ' ])) {
56+ printf ('Size: %s ' . PHP_EOL , $ info ['size ' ]);
57+ }
58+ if (isset ($ info ['updated ' ])) {
59+ printf ('Updated: %s ' . PHP_EOL , $ info ['updated ' ]);
60+ }
61+ if (isset ($ info ['generation ' ])) {
62+ printf ('Generation: %s ' . PHP_EOL , $ info ['generation ' ]);
63+ }
64+ if (isset ($ info ['metageneration ' ])) {
65+ printf ('Metageneration: %s ' . PHP_EOL , $ info ['metageneration ' ]);
66+ }
67+ if (isset ($ info ['etag ' ])) {
68+ printf ('Etag: %s ' . PHP_EOL , $ info ['etag ' ]);
69+ }
70+ if (isset ($ info ['crc32c ' ])) {
71+ printf ('Crc32c: %s ' . PHP_EOL , $ info ['crc32c ' ]);
72+ }
73+ if (isset ($ info ['md5Hash ' ])) {
74+ printf ('MD5 Hash: %s ' . PHP_EOL , $ info ['md5Hash ' ]);
75+ }
76+ if (isset ($ info ['contentType ' ])) {
77+ printf ('Content-type: %s ' . PHP_EOL , $ info ['contentType ' ]);
78+ }
79+ if (isset ($ info ['temporaryHold ' ])) {
80+ printf ("Temporary hold: " . ($ info ['temporaryHold ' ] ? "enabled " : "disabled " ) . PHP_EOL );
81+ }
82+ if (isset ($ info ['eventBasedHold ' ])) {
83+ printf ("Event-based hold: " . ($ info ['eventBasedHold ' ] ? "enabled " : "disabled " ) . PHP_EOL );
84+ }
85+ if (isset ($ info ['retentionExpirationTime ' ])) {
5886 printf ("retentionExpirationTime: " . $ info ['retentionExpirationTime ' ] . PHP_EOL );
5987 }
6088 if (isset ($ info ['metadata ' ])) {
0 commit comments