Mercurial > pub > Impl
diff Lib/IMPL/Config.pm @ 58:a35b60b16a99
Configuration, late activation
author | wizard |
---|---|
date | Fri, 05 Mar 2010 20:14:45 +0300 |
parents | 16ada169ca75 |
children | b0c068da93ac |
line wrap: on
line diff
--- a/Lib/IMPL/Config.pm Fri Mar 05 13:59:29 2010 +0300 +++ b/Lib/IMPL/Config.pm Fri Mar 05 20:14:45 2010 +0300 @@ -83,6 +83,10 @@ } } +sub spawn { + goto &LoadXMLFile; +} + 1; __END__ @@ -99,6 +103,7 @@ BEGIN { public property SimpleString => prop_all; public property MyClass => prop_all; + public lazy property DataSource => prop_all, {type => 'App::DataSource', factory => sub {}}; } sub CTOR { @@ -108,6 +113,12 @@ $this->MyClass(new IMPL::Config::Class(Type => MyClass)) unless $this->MyClass; } +# in some script + +my $app = spawn App::Config('default.xml'); + +$app->Run(); + =head1 DESCRIPTION Позволяет сохранить/загрузить конфигурацию. Также все классы конфигурации