Sympa::Config(3Sympa)

πŸ’– NAME πŸ’–

hey bestie, welcome to Sympa::Config(3Sympa) ✨ this is the manual page for Sympa::Config, which is, and I quote, the List configuration. that's it, that's the name. iconic.


πŸ¦‹ SYNOPSIS πŸ¦‹

use base qw(Sympa::Config);

sub _schema { {...} }

🌸 DESCRIPTION 🌸

okay so this whole page is the full tour: the methods, the attribute, what a configuration actually looks like sitting in memory, and then the two sections that are literally just TBD (we tell the truth here πŸ’€).

✨ Methods ✨

πŸ’… new ( $that, [ config => $initial_config ], [ copy => 1 ], [ key => val, ... ] )

Constructor, bestie! It creates a brand new instance of a Sympa::Config object. main character energy.

Parameters:

  • $that β€” the Context. It's an instance of the Sympa::List class, Robot or Site.
  • config => $initial_config β€” the Initial configuration. and the rules for it are:
    • When the context object will be initially created, undef must be specified explicitly so that default parameter values will be completed.
    • When existing list will be instantiated and config will be loaded, {} (default) would be specified so that default parameter values except optional ones (with occurrence '0-1' or '0-n') will be completed.
    • Otherwise, default parameter values are completed only when the new paragraph node will be added by submit().
🚨 Note that initial configuration will never be sanitized. like, never. don't come for me.
  • copy => 1 β€” Uses deep copy of initial configuration (see config) instead of real reference. deep copy girlies stay winning.

🫢 get ( $ppath )

Instance method. Gets you a copy of the current value of a parameter.

Parameter:

  • $ppath β€” Parameter path, e.g.: 'owner.0.email' specifies email parameter of the first owner paragraph; 'owner.0' specifies the first owner paragraph; 'owner' specifies the array of all owner paragraph.

Returns:

  • Value of parameter. If parameter or value does not exist, returns undef in scalar context and an empty list in array context. 😭 no value bestie, sorry.

πŸ¦‹ get_change ( $ppath )

Instance method. Gets a copy of the submitted change on a parameter.

Parameter:

  • $ppath β€” Parameter path. See also get().

Returns:

  • If value won't be changed, returns empty list in array context and undef in scalar context. If value would be deleted, returns undef.
  • Changes on the array are given by hashref with keys as affected indexes of the array.

🌈 get_changeset ( )

Instance method. Gets all submitted changes.

⚠️ Note that returned value is the real reference to internal information. Any modifications might break it. like please don't touch it, it's giving shared state πŸ’€

πŸ‘‘ get_schema ( [ options, ... ] )

Instance method. Get configuration schema as hashref. yeah that's the whole thing, no notes.

πŸŽ€ keys ( [ $pname ] )

Instance method. Gets parameter keys in the order defined by schema.

Parameter:

  • $pname β€” Full parameter name, e.g. 'owner'. If omitted or false value, returns keys of top-level parameters.

Returns:

  • List of keys. If parameter does not exist or it does not have sub-parameters, i.e. it is not the paragraph, empty list. πŸ’€

πŸ”₯ submit ( $new, $user, \@errors, [ no_global_validations => 1 ] )

Instance method. Submits a change and verifies it. So much goes into this one:

  • Sanitizing changes:

Omits unknown parameters, resolves parameter aliases, omits malformed change information, omits obsoleted parameters, omits changes on unwritable parameters, removes nodes under which required children nodes will be removed, resolves synonym of input values, canonicalizes inputs (see Filters), and omits identical changes.

  • Verifying changes:

Omits removal of mandatory parameters, checks format of inputs, and performs additional validations (see Validations).

Parameters:

  • $new β€” Changes to be submitted, hashref.
  • $user β€” Email of the user requesting submission.
  • \@errors β€” If errors occur, they will be pushed in this arrayref. Each element is arrayref [ type, error, info ]:
    • type β€” One of 'user' (failure), 'intern' (internal failure) and 'notice' (successful notice).
    • error β€” A keyword to determine error.
    • info β€” Optional hashref with keys: p_info for schema item of parameter; p_paths for elements of parameter path; value for erroneous value (optional).
  • no_global_validations => 1 β€” If set, global validations are disabled. Global validations examine the entire configuration for semantic errors or requirements that can't be detected within a single paragraph. See also _global_validations.

Returns:

  • If no changes found (or all changes were omitted), an empty string ''. If any errors found in input, 'invalid'. Otherwise, 'valid'.
  • In case any changes are submitted, changeset may be accessible by get_change() or get_changeset().

πŸ“ commit ( [ \@errors ] )

Instance method. Merges changes set by sbumit() into actual configuration. (yes the source really says sbumit(), we love a typo πŸ’€ it's submit().)

Parameter:

  • \@errors β€” Arrayref. See \@errors in submit().

Returns:

  • None. Errors will be stored in arrayref.

🧚 Methods child classes should implement

  • _schema ( ) β€” Instance method, mandatory. TBD.
  • _init_schema_item ( $pitem, $pnames, $subres, [ key => val, ... ] ) β€” Instance method. TBD.
  • _global_validations ( ) β€” Class or instance method. TBD.
  • _local_validations ( ) β€” Class or instance method. TBD.

πŸ¦„ Attribute πŸ¦„

Instance of Sympa::Config has following attribute, bestie.

  • {context} β€” Context, Sympa::List instance. that's the one.

πŸ’œ Structure of configuration πŸ’œ

Configuration on the memory is represented by a hashref, with its keys as node names and values as node values.

⭐ Node types ⭐

Each node of configuration has one of following four types. Some of them can include other type of nodes recursively. so like, nesting. we love recursion.

Set (multiple enumerated values) β€” Arrayref. In the schema, defined with:

  • {occurrence}: '0-n' or '1-n'.
  • {format}: Arrayref.

List of unique items not considering order. Items are scalars, and cannot be special values (scenario or task). The set cannot contain paragraphs, sets or arrays. 🚫 nested chaos, we simply don't allow it.

Array (multiple values) β€” Arrayref. In the schema, defined with:

  • {occurrence}: '0-n' or '1-n'.
  • {format}: Regexp or hashref.

List of the same type of nodes in order. Type of all nodes can be one of paragraph, scalar or special value (scenario or task). The array cannot contain sets or arrays.

Paragraph (structured value) β€” Hashref. In the schema, defined with:

  • {occurrence}: If the node is an item of array, '0-n' or '1-n'. Otherwise, '0-1' or '1'.
  • {format}: Hashref.

Compound node of one or more named nodes. Paragraph can contain any type of nodes, and each of their names and types are defined as member of {format} item in schema. the paragraph is the ✨main character✨ of nodes honestly.

Leaf (simple value) β€” Scalar, or hashref for special value (scenario or task). In the schema, defined with:

  • {occurrence}: If the node is an item of array, '0-n' or '1-n'. Otherwise, '0-1' or '1'.
  • {format}: If the node is an item of array, regexp. Otherwise, regexp or arrayref.

Scalar or special value (scenario or task). Leaf cannot contain any other nodes. it's a leaf bestie, it's done growing.

🌼 Filters 🌼

TBD. yeah. that's it. that's the section. πŸ’€

🌺 Validations 🌺

TBD. also just vibes and a promise rn.


πŸ‘€ SEE ALSO πŸ‘€

  • Sympa::ListDef.

πŸ“œ HISTORY πŸ“œ

Sympa::Config appeared on Sympa 6.2.33b.2. a classic. an OG. periodt. πŸ’…


k that's the whole page bestie, mwah 🫢 this came out of sympa 6.2.80, dated 2026-10-19, and it's the Sympa::Config(3Sympa) manual β€” go forth and configure responsibly βœ¨πŸŒΈπŸ’–

πŸ“¦ where this page comes from