Skip to content

Instantly share code, notes, and snippets.

@aklaswad
Created November 6, 2010 06:29
Show Gist options
  • Save aklaswad/665236 to your computer and use it in GitHub Desktop.
Save aklaswad/665236 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
# Sample for using MT registry
use strict;
use warnings;
use lib qw( lib extlib );
use MT;
use MT::Component;
use Data::Dumper;
my $c1 = MT::Component->new;
$c1->registry({
foo => { bar => 1 },
});
my $c2 = MT::Component->new;
$c2->registry({
foo => { buz => 1 },
});
push @MT::Components, ( $c1, $c2 );
print Dumper( MT->registry('foo') );
# prints this.
#$VAR1 = {
# 'bar' => 1,
# 'buz' => 1
# };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment