summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Process
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-02-03 12:30:29 +0000
committerfukachan <fukachan>2002-02-03 12:30:29 +0000
commit0c139b006cfff447ecc455d0117faed546d5f5a8 (patch)
treea7ef9a43f043d439733b5bb02705fc56414ff10a /fml/lib/FML/Process
parent338a420fd491504401968c0c8d06834215bdea0a (diff)
downloadfml8-0c139b006cfff447ecc455d0117faed546d5f5a8.tar.gz
fml8-0c139b006cfff447ecc455d0117faed546d5f5a8.tar.bz2
fml8-0c139b006cfff447ecc455d0117faed546d5f5a8.zip
we should not use $curproc->{ main_cf } directrly in modules out of FML::Process::
we implement the following methods in FML::Process::Utils and use them. o $curproc->executable_prefix() o $curproc->template_files_dir_for_newml()
Diffstat (limited to 'fml/lib/FML/Process')
-rw-r--r--fml/lib/FML/Process/Utils.pm49
1 files changed, 46 insertions, 3 deletions
diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm
index 95abd8ec..1689e203 100644
--- a/fml/lib/FML/Process/Utils.pm
+++ b/fml/lib/FML/Process/Utils.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Utils.pm,v 1.9 2002/02/02 15:18:00 fukachan Exp $
+# $FML: Utils.pm,v 1.10 2002/02/03 12:11:55 fukachan Exp $
#
package FML::Process::Utils;
@@ -152,7 +152,7 @@ return the default domain defined in /etc/fml/main.cf.
# Descriptions: return the default domain defined in /etc/fml/main.cf.
# Arguments: OBJ($curproc) STR($domain)
# Side Effects: none
-# Return Value: HASH_ARRAY
+# Return Value: STR
sub default_domain
{
my ($curproc, $domain) = @_;
@@ -162,6 +162,44 @@ sub default_domain
}
+=head2 executable_prefix()
+
+return executable prefix such as "/usr/local".
+
+=cut
+
+
+# Descriptions: return the path for executables
+# Arguments: OBJ($curproc)
+# Side Effects: none
+# Return Value: STR
+sub executable_prefix
+{
+ my ($curproc) = @_;
+ my $main_cf = $curproc->{ __parent_args }->{ main_cf };
+
+ return $main_cf->{ executable_prefix };
+}
+
+
+=head2 template_files_dir_for_newml()
+
+=cut
+
+
+# Descriptions: return the path where template files used in "newml" method exist
+# Arguments: OBJ($curproc)
+# Side Effects: none
+# Return Value: STR
+sub template_files_dir_for_newml
+{
+ my ($curproc) = @_;
+ my $main_cf = $curproc->{ __parent_args }->{ main_cf };
+
+ return $main_cf->{ default_config_dir };
+}
+
+
=head2 ml_home_prefix([domain])
return $ml_home_prefix in main.cf.
@@ -218,6 +256,11 @@ sub __ml_home_prefix_from_main_cf
+# Descriptions: search virtual domain in $virtual_maps.
+# return $ml_home_prefix for the virtual domain if found.
+# Arguments: HASH_REF($main_cf) STR($virtual_domain) ARRAY_REF($virtual_maps)
+# Side Effects: none
+# Return Value: STR
sub __ml_home_prefix_search_in_virtual_maps
{
my ($main_cf, $virtual_domain, $virtual_maps) = @_;
@@ -246,7 +289,7 @@ sub __ml_home_prefix_search_in_virtual_maps
}
}
- return undef;
+ return '';
}