Mercurial > pub > Impl
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 133:a07a66fd8d5c | 134:44977efed303 |
|---|---|
| 1 package IMPL::base; | |
| 2 use strict; | |
| 3 | |
| 4 my %loaded; | |
| 5 | |
| 6 sub import { | |
| 7 shift; | |
| 8 | |
| 9 no strict 'refs'; | |
| 10 my $class = caller; | |
| 11 | |
| 12 foreach my $baseClass (@_) { | |
| 13 unless ($loaded{$baseClass}) { | |
| 14 undef $!; | |
| 15 undef $@; | |
| 16 $loaded{$baseClass} = 1; | |
| 17 eval "require $baseClass;"; | |
| 18 | |
| 19 die $@ if $@ and not $!; | |
| 20 } | |
| 21 | |
| 22 #TODO debug warn if base class is empty; | |
| 23 | |
| 24 push @{"${class}::ISA"}, $baseClass; | |
| 25 } | |
| 26 } | |
| 27 | |
| 28 1; | |
| 29 | |
| 30 __END__ | |
| 31 | |
| 32 =pod | |
| 33 | |
| 34 =head1 NAME | |
| 35 | |
| 36 C<IMPL::base> быстрая версия директивы C<base>. | |
| 37 | |
| 38 =cut |
