Was cleaning out my inbox and found this note from the PhlexDB days. I figure it's worth capturing here, as it still applies to Syntax in its current form.
There's been a couple of questions about prefix & path in PHlexDB. Because
PHlexDB doesn't rely on any values set in scripts, it uses the pxdb_prefs
("preferences" tab in DBasis) table for things like the file upload prefix and
path. It is looking, in particular, for 2 preferences:
[name] [key] [value]
'datastore' 'path' '/var/www/vhosts/etf.www/private/files'
'datastore' 'url' '/files/'
Using the pxdb_prefs class in conjunction w/ documentInfo:
$prefs = &pxdb_prefs::singleton();
$docInfo->set_local_filestore_path($prefs->get_pref('datastore', 'path'));
$docInfo->set_local_filestore_prefix($prefs->get_pref('datastore', 'url'));
A general note about the preferences class. It's a pretty simple table
structure (3-cols) & it's indexed, so while there is someoverhead in getting
values out of this table, it's not very large. **Also, preferences are cached
so that subsequent requests for the same pref on a page have no db call.
You can store whatever values you want in the pxdb_prefs table (you can use
add_pref(), set_pref(), or set_default_pref() methods). It's purpose is to
allow several web apps (e.g. admin areay, dbasis tool, and public site) that
share the same database to know about site-specific settings.
Cheers,
Hans