Puppet Function: php::fpm::versioned_port

Defined in:
modules/php/functions/fpm/versioned_port.pp
Function type:
Puppet Language

Overview

php::fpm::versioned_port(Optional[Stdlib::Port::User] $port, Array[Wmflib::Php_version] $versions)Hash[Wmflib::Php_version, Optional[Stdlib::Port::User]]

SPDX-License-Identifier: Apache-2.0

Parameters:

  • port (Optional[Stdlib::Port::User])
  • versions (Array[Wmflib::Php_version])

Returns:

  • (Hash[Wmflib::Php_version, Optional[Stdlib::Port::User]])


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'modules/php/functions/fpm/versioned_port.pp', line 2

function php::fpm::versioned_port(
    Optional[Stdlib::Port::User] $port,
    Array[Wmflib::Php_version] $versions
) >> Hash[Wmflib::Php_version, Optional[Stdlib::Port::User]] {
    # If a port is defined, use subsequent ones for
    # the various versioned pools.
    # If the port is undefined, the unix socket depends on the
    # pool name.
    return $versions.map |$idx, $version| {
        $pool_port = $port ? {
            undef => $port,
            default => $port + $idx
        }
        $retval = {$version => $pool_port}
    }.reduce({}) |$m, $v| {$m.merge($v)}
}