Skip to content
Snippets Groups Projects
Commit 1b95bfdf authored by Chris Smith's avatar Chris Smith
Browse files

Add checks for supported attic compression methods to config plugin (FS#1185)

darcs-hash:20070805193638-d26fc-aac3910d4dea3cd5539572cce3e73366ed39ab80.gz
parent 2bb0d541
No related branches found
No related tags found
No related merge requests found
......@@ -622,7 +622,7 @@ if (!class_exists('setting_dirchoice')) {
function initialize($default,$local,$protected) {
// populate $this->_choices with a list of available templates
// populate $this->_choices with a list of directories
$list = array();
if ($dh = @opendir($this->_dir)) {
......
......@@ -35,6 +35,7 @@
* 'authtype' - as 'setting', input validated against a valid php file at expected location for auth files
* 'im_convert' - as 'setting', input must exist and be an im_convert module
* 'disableactions' - as 'setting'
* 'compression' - no additional parameters. checks php installation supports possible compression alternatives
*
* Any setting commented or missing will use 'setting' class - text input, minimal validation, quoted output
*
......@@ -162,7 +163,7 @@ $meta['compress'] = array('onoff');
$meta['gzip_output'] = array('onoff');
$meta['hidepages'] = array('string');
$meta['send404'] = array('onoff');
$meta['compression'] = array('multichoice','_choices' => array('0','gz','bz2'));
$meta['compression'] = array('compression');
$meta['sitemap'] = array('numeric');
$meta['rss_type'] = array('multichoice','_choices' => array('rss','rss1','rss2','atom','atom1'));
$meta['rss_linkto'] = array('multichoice','_choices' => array('diff','page','rev','current'));
......
......@@ -98,3 +98,19 @@ if (!class_exists('setting_disableactions')) {
}
}
}
if (!class_exists('setting_compression')) {
class setting_compression extends setting_multichoice {
var $_choices = array('0'); // 0 = no compression, always supported
function initialize($default,$local,$protected) {
// populate _choices with the compression methods supported by this php installation
if (function_exists('gzopen')) $this->_choices[] = 'gz';
if (function_exists('bzopen')) $this->_choices[] = 'bzip';
parent::initialize($default,$local,$protected);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment