← Index
NYTProf Performance Profile   « line view »
For /usr/local/libexec/sympa/task_manager-debug.pl
  Run on Tue Jun 1 22:32:51 2021
Reported on Tue Jun 1 22:35:10 2021

Filename/usr/local/libexec/sympa/Sympa/ListDef.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sSympa::ListDef::::BEGIN@30Sympa::ListDef::BEGIN@30
0000s0sSympa::ListDef::::BEGIN@31Sympa::ListDef::BEGIN@31
0000s0sSympa::ListDef::::BEGIN@33Sympa::ListDef::BEGIN@33
0000s0sSympa::ListDef::::__ANON__Sympa::ListDef::__ANON__ (xsub)
0000s0sSympa::ListDef::::_filterSympa::ListDef::_filter
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# -*- indent-tabs-mode: nil; -*-
2# vim:ft=perl:et:sw=4
3# $Id$
4
5# Sympa - SYsteme de Multi-Postage Automatique
6#
7# Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel
8# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
9# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
10# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
11# Copyright 2017, 2018, 2019, 2020 The Sympa Community. See the AUTHORS.md
12# file at the top-level directory of this distribution and at
13# <https://github.com/sympa-community/sympa.git>.
14#
15# This program is free software; you can redistribute it and/or modify
16# it under the terms of the GNU General Public License as published by
17# the Free Software Foundation; either version 2 of the License, or
18# (at your option) any later version.
19#
20# This program is distributed in the hope that it will be useful,
21# but WITHOUT ANY WARRANTY; without even the implied warranty of
22# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23# GNU General Public License for more details.
24#
25# You should have received a copy of the GNU General Public License
26# along with this program. If not, see <http://www.gnu.org/licenses/>.
27
28package Sympa::ListDef;
29
30use strict;
31use warnings;
32
33use Sympa::Config::Schema;
34
35our %pinfo = _filter({%Sympa::Config::Schema::pinfo});
36our %user_info = %Sympa::Config::Schema::user_info;
37
38sub _filter {
39 my $pinfo = shift;
40 my $pnames = shift || [];
41
42 return map {
43 my $item = $pinfo->{$_};
44 unless (not $item->{context}
45 or grep { 'list' eq $_ } @{$item->{context}}) {
46 ();
47 } else {
48 my $default = $item->{default};
49 if ($item->{context}
50 and grep { 'domain' eq $_ or 'site' eq $_ }
51 @{$item->{context}}
52 and ref $item->{format} ne 'HASH') {
53 $default = {conf => join('.', @$pnames, $_)};
54 }
55
56 if (ref $item->{format} eq 'HASH') {
57 ( $_ => {
58 %$item,
59 format => {_filter($item->{format}, [@$pnames, $_])},
60 ( (ref $item->{file_format} eq 'HASH')
61 ? ( file_format => {
62 _filter(
63 $item->{file_format}, [@$pnames, $_]
64 )
65 }
66 )
67 : ()
68 ),
69 ((defined $default) ? (default => $default) : ()),
70 }
71 );
72 } elsif (defined $default) {
73 ($_ => {%$item, default => $default});
74 } else {
75 ($_ => {%$item});
76 }
77 }
78 } keys %$pinfo;
79}
80
811;
82__END__