示例#1
0
 function get_basic_sortedsets($iterations = 1000)
 {
     $result = array();
     for ($j = 0; $j < $this->set_iteration; $j++) {
         $set = new Rediska_Key_SortedSet($this->sortedset_variable . $j);
         $result[$j] = $set->getByRank();
     }
     return $result;
 }
示例#2
0
 /**
  * Returns ids and timestamps of all files which have a specified uploader's UUID. Throws an exception with code
  * self::ERROR_INVALID_UPLOADER if the UUID is invalid. If there are no files for selected UUID, an empty
  * array will be returned.
  */
 public static function getIdsForUploader(&$application, $uuid)
 {
     // uuid must be valid
     if (!ApplicationModel_User::validateUuid($uuid)) {
         throw new ApplicationModelException_File('Uploader UUID is invalid.', self::ERROR_INVALID_UPLOADER);
     }
     $fileIds = array();
     $filesKeySet = new Rediska_Key_SortedSet('uuid_' . $uuid);
     $fileIdsSet = $filesKeySet->getByRank(true, 0, 20, true);
     return $fileIdsSet;
 }