xref: /dokuwiki/lib/plugins/config/core/Setting/SettingCompression.php (revision d4f83172d9533c4d84f450fe22ef630816b21d75)
10a5b05ebSAndreas Gohr<?php
20a5b05ebSAndreas Gohr
30a5b05ebSAndreas Gohrnamespace dokuwiki\plugin\config\core\Setting;
40a5b05ebSAndreas Gohr
50a5b05ebSAndreas Gohr/**
60a5b05ebSAndreas Gohr * Class setting_compression
70a5b05ebSAndreas Gohr */
88c7c53b0SAndreas Gohrclass SettingCompression extends SettingMultichoice
98c7c53b0SAndreas Gohr{
10467c1427SAndreas Gohr    protected $choices = ['0'];      // 0 = no compression, always supported
110a5b05ebSAndreas Gohr
120a5b05ebSAndreas Gohr    /** @inheritdoc */
13*d868eb89SAndreas Gohr    public function initialize($default = null, $local = null, $protected = null)
14*d868eb89SAndreas Gohr    {
150a5b05ebSAndreas Gohr
160a5b05ebSAndreas Gohr        // populate _choices with the compression methods supported by this php installation
170a5b05ebSAndreas Gohr        if (function_exists('gzopen')) $this->choices[] = 'gz';
180a5b05ebSAndreas Gohr        if (function_exists('bzopen')) $this->choices[] = 'bz2';
190a5b05ebSAndreas Gohr
200a5b05ebSAndreas Gohr        parent::initialize($default, $local, $protected);
210a5b05ebSAndreas Gohr    }
220a5b05ebSAndreas Gohr}
23