https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42663
--- Comment #7 from David Cook <[email protected]> --- (In reply to Jonathan Druart from comment #3) > I think there are several good things in this approach: > > 1. Code is elegant and easy to read! > my $context = Koha::Context->current; > my $preferences = $context->preferences; > my $value = $preferences->get_value("MyPref"); > > my $config = $context->config; > my $value = $config->get("entry"); > > my $userenv = $context->userenv; > my $number = $userenv->get("number"); In theory, I think that this sounds good, as it's similar to what you see in MVC frameworks. https://metacpan.org/pod/Catalyst#%24c-%3Econfig https://metacpan.org/pod/Catalyst::Component https://metacpan.org/pod/Catalyst::Plugin::Session In fact, looking at Koha/Context.pm, it looks similar to how Catalyst works. But the problem is Koha isn't an MVC web app like Catalyst, and Catlayst also only applies to web apps. It doesn't cover things like CLI tools or cronjobs. (That's why you end up with modules like https://metacpan.org/pod/Config::JFDI which provide Catlayst config outside of a web context.) -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
