1MooX::File::ConfigDir(3U)ser Contributed Perl DocumentatiMoonoX::File::ConfigDir(3)
2
3
4
6 MooX::File::ConfigDir - Moo eXtension for File::ConfigDir
7
9 my App;
10
11 use Moo;
12 with MooX::File::ConfigDir;
13
14 1;
15
16 package main;
17
18 my $app = App->new();
19 $app->config_identifier('MyProject');
20
21 my @cfgdirs = @{ $app->config_dirs };
22
23 # install support
24 my $site_cfg_dir = $app->site_cfg_dir->[0];
25 my $vendor_cfg_dir = $app->site_cfg_dir->[0];
26
28 This module is a helper for easily find configuration file locations.
29 Whether to use this information for find a suitable place for
30 installing them or looking around for finding any piece of settings,
31 heavily depends on the requirements.
32
34 config_identifier
35 Allows to deal with a global unique identifier passed to the functions
36 of File::ConfigDir. Using it encapsulates configuration files from the
37 other ones (e.g. "/etc/apache2" vs. "/etc").
38
39 "config_identifier" can be initialized by specifying it as parameter
40 during object construction or via inheriting default builder
41 ("_build_config_identifier").
42
43 system_cfg_dir
44 Provides the configuration directory where configuration files of the
45 operating system resides. For details see "system_cfg_dir" in
46 File::ConfigDir.
47
48 desktop_cfg_dir
49 Provides the configuration directory where configuration files of the
50 desktop applications resides. For details see "desktop_cfg_dir" in
51 File::ConfigDir.
52
53 xdg_config_dirs
54 Alias for desktop_cfg_dir to support XDG Base Directory Specification
55 <http://standards.freedesktop.org/basedir-spec/basedir-spec-
56 latest.html>
57
58 core_cfg_dir
59 Provides the configuration directory of the Perl5 core location. For
60 details see "core_cfg_dir" in File::ConfigDir.
61
62 site_cfg_dir
63 Provides the configuration directory of the Perl5 sitelib location.
64 For details see "site_cfg_dir" in File::ConfigDir.
65
66 vendor_cfg_dir
67 Provides the configuration directory of the Perl5 vendorlib location.
68 For details see "vendor_cfg_dir" in File::ConfigDir.
69
70 singleapp_cfg_dir
71 Provides the configuration directory of $0 if it's installed as a
72 separate package - either a program bundle (TSM, Oracle DB) or an
73 independent package combination (e.g. via PkgSrc
74 <http://www.pkgsrc.org/> For details see "singleapp_cfg_dir" in
75 File::ConfigDir.
76
77 vendorapp_cfg_dir
78 Provides the configuration directory of $0 if it's installed as a
79 separate package via a vendor installation as e.g. PkgSrc
80 <http://www.pkgsrc.org/> or Homebrew <https://brew.sh/>. For details
81 see "vendorapp_cfg_dir" in File::ConfigDir.
82
83 local_cfg_dir
84 Returns the configuration directory for distribution independent, 3rd
85 party applications. For details see "local_cfg_dir" in File::ConfigDir.
86
87 locallib_cfg_dir
88 Provides the configuration directory of the Perl5 local::lib
89 environment location. For details see "locallib_cfg_dir" in
90 File::ConfigDir.
91
92 here_cfg_dir
93 Provides the path for the "etc" directory below the current working
94 directory. For details see "here_cfg_dir" in File::ConfigDir.
95
96 user_cfg_dir
97 Provides the users home folder using File::HomeDir. For details see
98 "user_cfg_dir" in File::ConfigDir.
99
100 xdg_config_home
101 Returns the user configuration directory for desktop applications. For
102 details see "xdg_config_home" in File::ConfigDir.
103
104 config_dirs
105 Tries to get all available configuration directories as described
106 above. Returns those who exists and are readable. For details see
107 "config_dirs" in File::ConfigDir.
108
110 Jens Rehsack, "<rehsack at cpan.org>"
111
113 Please report any bugs or feature requests to "bug-MooX-File-ConfigDir
114 at rt.cpan.org", or through the web interface at
115 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooX-File-ConfigDir>.
116 I will be notified, and then you'll automatically be notified of
117 progress on your bug as I make changes.
118
120 You can find documentation for this module with the perldoc command.
121
122 perldoc MooX::File::ConfigDir
123
124 You can also look for information at:
125
126 • RT: CPAN's request tracker
127
128 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooX-File-ConfigDir>
129
130 • AnnoCPAN: Annotated CPAN documentation
131
132 <http://annocpan.org/dist/MooX-File-ConfigDir>
133
134 • CPAN Ratings
135
136 <http://cpanratings.perl.org/m/MooX-File-ConfigDir>
137
138 • Search CPAN
139
140 <http://search.cpan.org/dist/MooX-File-ConfigDir/>
141
143 Copyright 2013-2020 Jens Rehsack.
144
145 This program is free software; you can redistribute it and/or modify it
146 under the terms of either: the GNU General Public License as published
147 by the Free Software Foundation; or the Artistic License.
148
149 See http://dev.perl.org/licenses/ for more information.
150
151
152
153perl v5.34.0 2021-07-22 MooX::File::ConfigDir(3)