original_string: public function purge( $limit = null )
      {
          $this->fetchSearchRegistry( true );
  
          $purgedIds = array();
          $ttl       = $this->properties['options']->ttl;
  
          foreach ( $this->searchRegistry[$this->properties['location']] as $id => $identifiers )
          {
              $deleted = false;
              foreach( $identifiers as $identifier => $data )
              {
                  if ( $ttl !== false && $this->calcLifetime( $identifier ) == 0 )
                  {
                      // Since ID <-> identifier mapping is ambigious, this does
                      // not ensure that all data for an ID is deleted. However,
                      // this should work if used properly
                      $this->backend->delete( $identifier );
                      $this->unRegisterIdentifier( null, null, $identifiers, true );
                      // Avoid adding an ID twice to the returned array
                      $deleted = true;
                  }
              }
              if ( $deleted === true )
              {
                  $purgedIds[] = $id;
              }
              if ( $limit !== null && count( $purgedIds ) >= $limit )
              {
                  break;
              }
          }
          $this->storeSearchRegistry();
          return $purgedIds;
      }
code: public function purge( $limit = null )
      {
          $this->fetchSearchRegistry( true );
  
          $purgedIds = array();
          $ttl       = $this->properties['options']->ttl;
  
          foreach ( $this->searchRegistry[$this->properties['location']] as $id => $identifiers )
          {
              $deleted = false;
              foreach( $identifiers as $identifier => $data )
              {
                  if ( $ttl !== false && $this->calcLifetime( $identifier ) == 0 )
                  {
                      // Since ID <-> identifier mapping is ambigious, this does
                      // not ensure that all data for an ID is deleted. However,
                      // this should work if used properly
                      $this->backend->delete( $identifier );
                      $this->unRegisterIdentifier( null, null, $identifiers, true );
                      // Avoid adding an ID twice to the returned array
                      $deleted = true;
                  }
              }
              if ( $deleted === true )
              {
                  $purgedIds[] = $id;
              }
              if ( $limit !== null && count( $purgedIds ) >= $limit )
              {
                  break;
              }
          }
          $this->storeSearchRegistry();
          return $purgedIds;
      }
code_tokens: public function purge ( $ limit = null ) { $ this -> fetchSearchRegistry ( true ) ; $ purgedIds = array ( ) ; $ ttl = $ this -> properties [ 'options' ] -> ttl ; foreach ( $ this -> searchRegistry [ $ this -> properties [ 'location' ] ] as $ id => $ identifiers ) { $ deleted = false ; foreach ( $ identifiers as $ identifier => $ data ) { if ( $ ttl !== false && $ this -> calcLifetime ( $ identifier ) == 0 ) { // Since ID <-> identifier mapping is ambigious, this does // not ensure that all data for an ID is deleted. However, // this should work if used properly $ this -> backend -> delete ( $ identifier ) ; $ this -> unRegisterIdentifier ( null , null , $ identifiers , true ) ; // Avoid adding an ID twice to the returned array $ deleted = true ; } } if ( $ deleted === true ) { $ purgedIds [ ] = $ id ; } if ( $ limit !== null && count ( $ purgedIds ) >= $ limit ) { break ; } } $ this -> storeSearchRegistry ( ) ; return $ purgedIds ; }
docstring: Purge outdated data from the storage.
  
  This method purges outdated data from the cache. If $limit is given, a
  maximum of $limit items is purged. Otherwise all outdated items are
  purged. The method returns an array containing the IDs of all cache
  items that have been purged.
  
  @param int $limit
  @return array(string)
docstring_tokens: Purge outdated data from the storage .