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.

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