如何列出PHP中Bucket子目录中的所有文件?

After reviewing the PHP Docs for the GCP Storage API and the Bookshelf tutorial (https://cloud.google.com/php/getting-started/using-cloud-storage) I'm lost on how to list the files located in a Bucket subdirectory.

I've viewed Listing files in Google Cloud Storage (nearline) - missing files, however, this code is adapted to Python. If it really is as simple as using an ls command, how would I run this command from PHP? I've dug through the repo's on Github from Google and I'm not sure which to use in this case.

I have both of these libraries included via composer. Just to clarify I'm running these remotely from a DigitalOcean Droplet, not from App Engine.

"google/appengine-php-sdk": "^1.9",
"google/cloud": "^0.39.2",

There's an "objects" method that'll do this for you.

use Google\Cloud\Storage\StorageClient;

$storage = new StorageClient();
$bucket = $storage->bucket('my-bucket');
$objects = $bucket->objects([
    'fields' => 'items/name,nextPageToken'
]);

foreach ($objects as $object) {
    echo $object->name() . PHP_EOL;
}

The documentation for the PHP storage client is over here: https://googlecloudplatform.github.io/google-cloud-php/#/docs/google-cloud/v0.39.2/storage/storageclient