original_string: public function generateIdentifier( $id, $attributes = null )
      {
          $filename = (string) $id;
          $illegalFileNameChars = array(
              ' '  => '_',
              '/'  => DIRECTORY_SEPARATOR,
              '\\' => DIRECTORY_SEPARATOR,
          );
          $filename = strtr( $filename, $illegalFileNameChars );
  
          // Chars used for filename concatination
          $illegalChars = array(
              '-' => '#',
              ' ' => '%',
              '=' => '+',
              '.' => '+',
          );
          if ( is_array( $attributes ) && count( $attributes ) > 0 )
          {
              ksort( $attributes );
              foreach ( $attributes as $key => $val )
              {
                  $attrStr = '-' . strtr( $key, $illegalChars )
                           . '=' . strtr( $val, $illegalChars );
                  if ( strlen( $filename . $attrStr ) > 250 )
                  {
                      // Max filename length
                      break;
                  }
                  $filename .= $attrStr;
              }
          }
          else
          {
              $filename .= '-';
          }
          return $filename . $this->properties['options']['extension'];
      }
code: public function generateIdentifier( $id, $attributes = null )
      {
          $filename = (string) $id;
          $illegalFileNameChars = array(
              ' '  => '_',
              '/'  => DIRECTORY_SEPARATOR,
              '\\' => DIRECTORY_SEPARATOR,
          );
          $filename = strtr( $filename, $illegalFileNameChars );
  
          // Chars used for filename concatination
          $illegalChars = array(
              '-' => '#',
              ' ' => '%',
              '=' => '+',
              '.' => '+',
          );
          if ( is_array( $attributes ) && count( $attributes ) > 0 )
          {
              ksort( $attributes );
              foreach ( $attributes as $key => $val )
              {
                  $attrStr = '-' . strtr( $key, $illegalChars )
                           . '=' . strtr( $val, $illegalChars );
                  if ( strlen( $filename . $attrStr ) > 250 )
                  {
                      // Max filename length
                      break;
                  }
                  $filename .= $attrStr;
              }
          }
          else
          {
              $filename .= '-';
          }
          return $filename . $this->properties['options']['extension'];
      }
code_tokens: public function generateIdentifier ( $ id , $ attributes = null ) { $ filename = ( string ) $ id ; $ illegalFileNameChars = array ( ' ' => '_' , '/' => DIRECTORY_SEPARATOR , '\\' => DIRECTORY_SEPARATOR , ) ; $ filename = strtr ( $ filename , $ illegalFileNameChars ) ; // Chars used for filename concatination $ illegalChars = array ( '-' => '#' , ' ' => '%' , '=' => '+' , '.' => '+' , ) ; if ( is_array ( $ attributes ) && count ( $ attributes ) > 0 ) { ksort ( $ attributes ) ; foreach ( $ attributes as $ key => $ val ) { $ attrStr = '-' . strtr ( $ key , $ illegalChars ) . '=' . strtr ( $ val , $ illegalChars ) ; if ( strlen ( $ filename . $ attrStr ) > 250 ) { // Max filename length break ; } $ filename .= $ attrStr ; } } else { $ filename .= '-' ; } return $ filename . $ this -> properties [ 'options' ] [ 'extension' ] ; }
docstring: Generate the storage internal identifier from ID and attributes.
  
  Generates the storage internal identifier out of the provided ID and the
  attributes. This is the default implementation and can be overloaded if
  necessary.
  
  @param string $id                         The ID.
  @param array(string=>string) $attributes  Attributes describing the
  data to restore.
  @return string              The generated identifier
docstring_tokens: Generate the storage internal identifier from ID and attributes .