Ignore:
Timestamp:
2012-05-29T04:25:41+02:00 (23 months ago)
Author:
moo
Message:

improve config handling

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/admin/config.default.php

    r900 r902  
    11<?php 
    22 
    3 // this is an example only 
    4 // write your own config and name it as config.php 
     3// this is default config, DO NOT modify this file 
     4// copy this file and write your own config and name it as config.php 
    55 
    66// detected by browser 
    7 // $lang = 'en-us'; 
     7// $config['lang'] = 'en-us'; 
    88 
    9 $charset = "UTF-8"; 
     9$config['charset'] = "UTF-8"; 
    1010 
    11 // developers only 
    12 $show_todo_strings = false; 
     11// translators only 
     12$config['show_todo_strings'] = false; 
    1313 
    1414// width of graph for free or usage blocks 
    15 $usage_graph_width = 120; 
    16 // do not define both with 
    17 // $free_graph_width = 120; 
     15$config['percent_graph_width'] = 120; 
     16$config['percent_graph_type'] = 'used'; // either 'used' or 'free' 
    1817 
    1918// only enable if you have password protection for admin page 
    2019// enabling this option will cause user to eval() whatever code they want 
    21 $enable_eval = false; 
     20$config['enable_eval'] = false; 
    2221 
    23 // this function is detected by xcache.tpl.php, and enabled if function_exists 
    2422// this ob filter is applied for the cache list, not the whole page 
    25 function ob_filter_path_nicer($o) 
     23$config['path_nicer'] = 'ob_filter_path_nicer_default'; 
     24 
     25/* 
     26function custom_ob_filter_path_nicer($list_html) 
    2627{ 
    27     $sep = DIRECTORY_SEPARATOR; 
    28     $d = $_SERVER['DOCUMENT_ROOT']; 
    29     $o = str_replace($d,  "{DOCROOT}" . (substr($d, -1) == $sep ? $sep : ""), $o); 
    30     $xcachedir = realpath(dirname(__FILE__) . "$sep..$sep"); 
    31     $o = str_replace($xcachedir . $sep, "{XCache}$sep", $o); 
    32     if ($sep == '/') { 
    33         $o = str_replace("/home/", "{H}/", $o); 
    34     } 
    35     return $o; 
     28    $list_html = ob_filter_path_nicer_default($list_html); // this function is from common.php 
     29    return $list_html; 
    3630} 
     31$config['path_nicer'] = 'custom_ob_filter_path_nicer'; 
     32*/ 
    3733 
    3834// you can simply let xcache to do the http auth 
     
    4036// {{{ home made login example 
    4137// this is an example only, it's won't work for you without your implemention. 
     38/* 
    4239function check_admin_and_by_pass_xcache_http_auth() 
    4340{ 
     
    6360} 
    6461 
    65 // uncomment: 
    66 // check_admin_and_by_pass_xcache_http_auth(); 
     62check_admin_and_by_pass_xcache_http_auth(); 
     63*/ 
    6764// }}} 
    6865 
     66/* by pass XCache http auth 
     67$_SERVER["PHP_AUTH_USER"] = "moo"; 
     68$_SERVER["PHP_AUTH_PW"] = "your-xcache-password"; 
     69*/ 
     70 
    6971?> 
Note: See TracChangeset for help on using the changeset viewer.