- $flags = explode( ',', $row->old_flags );
- $text = $row->old_text;
- if ( in_array( 'external', $flags ) ) {
- $this->output( "External $text\n" );
- if ( preg_match( '!^DB://(\w+)/(\w+)/(\w+)$!', $text, $m ) ) {
- $es = ExternalStore::getStoreObject( 'DB' );
- $blob = $es->fetchBlob( $m[1], $m[2], $m[3] );
- if ( strtolower( get_class( $blob ) ) == 'concatenatedgziphistoryblob' ) {
- $this->output( "Found external CGZ\n" );
- $blob->uncompress();
- $this->output( "Items: (" . implode( ', ', array_keys( $blob->mItems ) ) . ")\n" );
- $text = $blob->getItem( $m[3] );
- } else {
- $this->output( "CGZ expected at $text, got " . gettype( $blob ) . "\n" );
- $text = $blob;
- }
- } else {
- $this->output( "External plain $text\n" );
- $text = ExternalStore::fetchFromURL( $text );
- }
- }
- if ( in_array( 'gzip', $flags ) ) {
- $text = gzinflate( $text );
- }
- if ( in_array( 'object', $flags ) ) {
- $obj = unserialize( $text );
- $text = $obj->getText();