Branch: Tag:

2000-03-01

2000-03-01 19:05:46 by Per Hedbor <ph@opera.com>

Write the config cache (and settings) files using the same XML syntax that the configuration files use, and save them in <configdir>/_configinterface/'

Rev: server/base_server/roxen.pike:1.444

4:   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.      // ABS and suicide systems contributed freely by Francesco Chemolli - constant cvs_version="$Id: roxen.pike,v 1.443 2000/02/29 23:35:23 neotron Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.444 2000/03/01 19:05:46 per Exp $";      object backend_thread;   ArgCache argcache;
1818:    alarm (60*QUERY(abs_timeout)+10);   }    - // Cache used by the various configuration interface modules etc. - // It should be OK to delete this cache at any time. + // Settings used by the various configuration interface modules etc.   class ConfigIFCache   {    string dir;    void create( string name )    { -  dir = (".config_settings/"+ -  replace(configuration_dir-".", "/", "-") + -  "/" + name + "/"); -  mkdirhier( dir+"/foo" ); +  dir = configuration_dir + "_configinterface/" + name + "/"; +  mkdirhier( dir );    }       mixed set( string name, mixed to )
1845:    return to;    }    } -  f->write( encode_value( to ) ); +  f->write( encode_mixed( to, this_object() ) );    return to;    }   
1854:    Stdio.File f = Stdio.File();    if(!f->open( dir + replace( name, "/", "-" ), "r" ))    return 0; -  return decode_value( f->read() ); +  mapping q = ([]); +  decode_variable( 0, ([ "name":"res" ]), f->read(), q ); +  parse( f->read(), ([]) ); +  return q->res;    }       array list()