Changeset 480 for trunk/docs


Ignore:
Timestamp:
May 4, 2014 12:29:05 AM (10 years ago)
Author:
anonymous
Message:

Removed some legacy files. Improved use of array_key_exists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/examples/_config.inc.php

    r468 r480  
    123123// Load preferences for the user.
    124124require_once 'codebase/lib/Prefs.inc.php';
    125 $prefs = new Prefs('permanent');
    126 $prefs->setParam(array(
    127     'persistent' => $auth->isLoggedIn(),
     125$prefs = new Prefs('permanent', array(
     126    'storagetype' => ($auth->isLoggedIn() ? 'database' : 'session'),
    128127    'user_id' => $auth->get('user_id'),
    129128));
    130129$prefs->setDefaults(array(
     130    // ...
    131131));
    132132$prefs->load();
     133// Load preferences for temporary usage.
     134require_once 'codebase/lib/Prefs.inc.php';
     135$c_prefs = new Prefs('config');
     136$c_prefs->setParam(array(
     137    'storagetype' => 'cookie',
     138));
    133139// Temporary prefs.
    134 $tmp_prefs = new Prefs('temporary');
    135 $tmp_prefs->setDefaults(array(
     140$c_prefs = new Prefs('settings');
     141$c_prefs->setDefaults(array(
    136142));
    137143
Note: See TracChangeset for help on using the changeset viewer.