Preferences.class.php
gehe zur Dokumentation dieser Datei00001 <?php
00002
00010 class Preferences
00011 {
00019 function load( $dir='' )
00020 {
00021 if ( !defined('QUOTE') )
00022 define('QUOTE','"');
00023
00024 $values = array();
00025
00026
00027 if ( empty($dir) )
00028 {
00029 if ( isset($_GET['config']) )
00030 $dir = basename( $_GET['config'] ).'/';
00031 else
00032 $dir = OR_PREFERENCES_DIR;
00033 }
00034
00035 if ( !is_dir($dir) )
00036 {
00037 Http::sendStatus(501,'Internal Server Error','not a directory: '.$dir);
00038 exit;
00039 }
00040
00041 $dateien = FileUtils::readDir($dir);
00042
00043 foreach( $dateien as $datei )
00044 {
00045 $filename = $dir.$datei;
00046
00047 if ( is_file($filename) && eregi('\.(ini.*|conf)$',$datei) )
00048 {
00049 $nameBestandteile = explode('.',$datei);
00050 $values[$nameBestandteile[0]] = parse_ini_file( $filename,true );
00051 }
00052 }
00053
00054 ksort($values);
00055
00056 return $values;
00057 }
00058 }
00059 ?>