1<?php 2$mimes = realpath(dirname(__FILE__).'/../../../../').'/conf/mime.conf'; 3$mimes_local = realpath(dirname(__FILE__).'/../../../../').'/conf/mime.local.conf'; 4 5if(!file_exists($mimes)){ 6 $preload = realpath(dirname(__FILE__).'/../../../../') . '/inc/preload.php'; 7 require($preload); 8 $mimes = DOKU_CONF . 'mime.conf'; 9 $mimes_local = DOKU_CONF .'mime.local.conf'; 10 } 11 12$out=@file($mimes,FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); 13 14if(file_exists($mimes_local)) 15 { 16 $out_local = @file($mimes_local,FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); 17 $out = array_merge($out,$out_local); 18 } 19 20 foreach($out as $line) { 21 if(strpos($line,'#') === false) { 22 list($ext,$mtype) = preg_split('/\s+/', $line); 23 $extensions[] = $ext; 24 if(strpos($mtype,'image')!==false) { 25 $image_extensions[] = $ext; 26 } 27 } 28 } 29 30#print_r($image_extensions); 31echo implode("|",$image_extensions); 32?> 33