正如 Glen 所指出的,该服务(目前)不支持在对象上应用过滤器。您可能感兴趣的唯一事情是提供前缀,它允许您根据文件名的开始方式细化返回的对象。因此,如果您发送“bobcatscuddling”作为前缀,您将获得该录制文件的所有相关视频格式。
看来,您唯一的选择是取回所有对象并遍历集合:
use OpenCloud\Rackspace;
$connection = new Rackspace(RACKSPACE_US, array(
'username' => 'foo',
'apiKey' => 'bar'
));
$service = $connection->objectStore('cloudFiles', 'DFW', 'publicURL');
$container = $service->container('CONTAINER_NAME');
$processedObjects = array();
$marker = '';
while ($marker !== null) {
$objects = $container->objectList('marker' => $marker);
$total = $objects->count();
$count = 0;
while ($object = $objects->next()) {
// Extract the filename
$filename = pathinfo($object->name, PATHINFO_FILENAME);
// Make sure you only deal with the filename once (i.e. to ignore different extensions)
if (!in_array($processedObjects, $filename)) {
// You can do your DB check here...
// Stock the array
$processedObjects[] = $filename;
}
$count++;
$marker = ($count == $total) ? $object->name : null;
}
}
您会注意到,您正在增加标记并为每 10,000 个对象发出一个新请求。我没有对此进行测试,但它可能会引导您朝着正确的方向前进。