Mercurial > pub > Impl
diff Lib/IMPL/base.pm @ 134:44977efed303
Significant performance optimizations
Fixed recursion problems due converting objects to JSON
Added cache support for the templates
Added discovery feature for the web methods
author | wizard |
---|---|
date | Mon, 21 Jun 2010 02:39:53 +0400 |
parents | |
children | e6447ad85cb4 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Lib/IMPL/base.pm Mon Jun 21 02:39:53 2010 +0400 @@ -0,0 +1,38 @@ +package IMPL::base; +use strict; + +my %loaded; + +sub import { + shift; + + no strict 'refs'; + my $class = caller; + + foreach my $baseClass (@_) { + unless ($loaded{$baseClass}) { + undef $!; + undef $@; + $loaded{$baseClass} = 1; + eval "require $baseClass;"; + + die $@ if $@ and not $!; + } + + #TODO debug warn if base class is empty; + + push @{"${class}::ISA"}, $baseClass; + } +} + +1; + +__END__ + +=pod + +=head1 NAME + +C<IMPL::base> быстрая версия директивы C<base>. + +=cut