xref: /dokuwiki/lib/plugins/config/core/Setting/SettingCompression.php (revision 33b331541831ff69d22f79b2ad12d36f4fe3dd39)
1<?php
2
3namespace dokuwiki\plugin\config\core\Setting;
4
5/**
6 * Class setting_compression
7 */
8class SettingCompression extends SettingMultichoice
9{
10    protected $choices = ['0'];      // 0 = no compression, always supported
11
12    /** @inheritdoc */
13    public function initialize($default = null, $local = null, $protected = null)
14    {
15
16        // populate _choices with the compression methods supported by this php installation
17        if (function_exists('gzopen')) $this->choices[] = 'gz';
18        if (function_exists('bzopen')) $this->choices[] = 'bz2';
19
20        parent::initialize($default, $local, $protected);
21    }
22}
23