Dancer2...igReader(3)
π Dancer2::Core::Role::ConfigReader π
okay bestie, so this page is Dancer2...igReader(3) from the User Contributed Perl Documentation, and it's lowkey one of those behind-the-scenes icons that runs the whole show. pull up a chair. π«Ά
β¨ NAME β¨
Dancer2::Core::Role::ConfigReader β the config reader role for Dancer2 core objects. yeah. it's giving foundational. π
πΈ VERSION πΈ
version 2.2.1 β that's the one we're talking about, no cap.
π¦ DESCRIPTION π¦
so this role gets implemented by all the different config readers out there. a config reader is literally the thing that creates the configuration for a Dancer2 app. and like, config can come from anywhere β reading configuration files, pulling from environment variables, fetching it from a cloud service, or honestly any other means your heart desires. π
the default config reader is Dancer2::ConfigReader::Config::Any, but here's the tea: you can totally create your own config reader if you want to replace or augment the default way config gets created. and bestie, that custom method of yours should implement this role. periodt.
the implementing module gets the following parameters during creation:
π ATTRIBUTES π
π environment
the name of the environment being used, e.g. production, development, staging. iykyk.
π location
the absolute path to the directory where the server started.
π default_config
a hash ref which contains the default values.
so these arguments get passed when the object is created by Dancer2::Core::App. then ConfigReader passes environment and location forward to every config reader class when it instantiates them. how the config reader actually applies them? that depends on its needs, bestie. every reader has its own vibe. π
it also provides a config attribute that β when you access it for the first time β feeds itself by finding and parsing configuration files. β¨
and it also provides a setting() method which is supposed to be used by externals to read/write config entries. iconic behavior honestly.
π location
absolute path to the directory where the server started. (yes she's back, she said what she said π)
π config_location
gets the location from the configuration. same as $object->location.
π environments_location
gets the directory where the environment files are stored.
π config
returns the whole configuration. the entire thing. no crumbs left. π
π environments
returns the name of the environment.
β METHODS β
π₯ read_config
load the configuration. whatever source the config comes from β files, env vars, etc. β this is the one doing the work. main character energy fr fr.
π AUTHOR π
Dancer Core Developers. legends, honestly.
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2026 by Alexis Sukrieh.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay.
and that's the whole page bestie!! π
β¨ this was Dancer2...igReader(3) on perl v5.42.3, dated 2026-09-20. go forth and configure responsibly. ππ¦π
π¦ where this page comes from
- fedora 44: perl-Dancer2 2.2.1-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms