# Puppet Class: php::repo::ubuntu

Defined in:
  manifests/repo/ubuntu.pp

## Overview

Configure ubuntu ppa

=== Parameters

[version] PHP version to manage (e.g. 5.6)

Parameters:

- version (`Any`) (defaults to: `undef`)

    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    # File 'manifests/repo/ubuntu.pp', line 8

    class php::repo::ubuntu (
      $version   = undef,
    ) {
      include '::apt'

      if($version == undef) {
        $version_real = '5.6'
      } else {
        $version_real = $version
      }

      if ($version_real == '5.5') {
        fail('PHP 5.5 is no longer available for download')
      }
      assert_type(Pattern[/^\d\.\d/], $version_real)

      $version_repo = $version_real ? {
        '5.4' => 'ondrej/php5-oldstable',
        '5.6' => 'ondrej/php',
        '7.0' => 'ondrej/php'
      }

      ::apt::ppa { "ppa:${version_repo}": }
    }