Rackspace - php-opencloud filters - Documentation for valid ObjectList filters? -


anyone know if/where there documentation valid objectlist filter arrays?

the project's entry on github has tiny blurb on directing me api documentation, fails have comprehensive list, , search on 'filters' talks containers only, not object themselves.

i have list of videos, each in 4 different formats named same thing (sans filetype). using php-opencloud api, want 1 of video formats (to grab unique filename rather different formats).

i figured using filter way go, can't find solid documentation.

someone has got have done before. noob out?

as glen's pointed out, there isn't support (at moment) service apply filters on objects. thing might interested in supplying prefix, allows refine objects returned based on how filenames start. if sent 'bobcatscuddling' prefix, you'd associated video formats 1 recording.

your option, seems, objects , iterate on collection:

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 filename         $filename = pathinfo($object->name, pathinfo_filename);          // make sure deal filename once (i.e. ignore different extensions)         if (!in_array($processedobjects, $filename)) {              // can db check here...              // stock array             $processedobjects[] = $filename;         }          $count++;         $marker = ($count == $total) ? $object->name : null;     }  } 

what you'll notice you're incrementing marker , making new request each 10,000 objects. haven't tested this, it'll lead in right direction.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -