Elxis CMS Forum

Support => Elxis 2008 developers guide => Topic started by: datahell on June 17, 2007, 23:16:38

Title: SoftDisk
Post by: datahell on June 17, 2007, 23:16:38
Elxis 2008 introduces a dynamic expandable storage area in database which we call SoftDisk.

What is this? Is it usefull?
Oh, yes! Imaging it as a virtual storage area for variables of any kind. System information, statistics, users specific data, system health, runtime variables, third party components data etc. Each entry is represented by a variable name which must be unique in the system inorder to become acceptable. Each variable also has a specific type which can be: URL, EMAIL, IMAGE, TEXT, STRING, YESNO, INTEGER, DECIMAL. Variables are seperated into sections. Example sections are: CORE, STATS, USER. You can add as many sections, types and variables you wish. SoftDisk can become the area where you can save for instance a module's data without the need the module to have a database table itself.

SoftDisk will be the source for the simple users to manage their site better and have much more information about it.

SoftDisk may also become in the future part of the artificial intelligence system that we finally did not implemented in Elxis 2008.

More information about SoftDisk will be available in the future.
Title: Example usage for SoftDisk
Post by: datahell on June 20, 2007, 21:25:29
Basic SoftDisk usage

First of all we must include and initialize the class.

Code: (php) [Select]
require_once($mosConfig_absolute_path.'/administrator/includes/softdisk.class.php');
$softdisk = new softDisk();

List existing SoftDisk's sections (returns an array of existing sections):
Code: (php) [Select]
$softdisk->listSections();
Translate a SoftDisk section or parameter name to our language:
Code: (php) [Select]
$softdisk->translate($string);
Get SoftDisks's valid value types (array of valid types):
Code: (php) [Select]
$softdisk->validTypes();
Get a SoftDisk's parameter value:
Code: (php) [Select]
$softdisk->getValue($name);
Get a SoftDisk's parameter formatted value:
Code: (php) [Select]
//name: the name of the SoftDisk parameter
//valuetype: the type of the SoftDisk parameter
$softdisk->getFormatedValue($name, $valuetype);

Get a complete SoftDisk row by either declaring the name or the row id (one of these must be defined):
Code: (php) [Select]
$softdisk->getRow($id, $name);
Fast SoftDisk update
Code: (php) [Select]
//name: the name of the SoftDisk parameter
//value: the value of the SoftDisk parameter
$softdisk->update($name, $value);

Load a whole SoftDisk section (object list):
Code: (php) [Select]
//section: the section name
$softdisk->loadSection($section);

Update SoftDisk system entries:
Code: (php) [Select]
$softdisk->updateSystem();
Title: SoftDisk System Entries
Post by: datahell on June 20, 2007, 21:41:41
SoftDisk system entries

Note: this list is not the final one!

Section: CORE

(name - value type - short description)
DB_TYPE - STRING - database type
DB_VERSION - STRING - database version
ELXISORG_FORUM - URL - Elxis.org forum url
ELXISORG_SITE - URL - Elxis.org url
ELXIS_VERSION - DECIMAL - Installed Elxis version (files, i.e. 2007.0 )
ELXIS_DBVERSION - DECIMAL - Installed Elxis version (database, i.e. 2006.4)
ELXIS_INSTALL - TIME - Elxis site installation timestamp
ELXIS_LASTUP - TIME - Elxis site last upgrade timestamp
OS - STRING - Server's Operating system (short)
OS_EXTENDED - STRING - Server's Operating system (extended)
PHP_VERSION - STRING - PHP version
SITE_ABSPATH - STRING - Elxis installation absolute path
SITE_URL - URL - Elxis installation live url
SOFTDISK_LASTUP - TIME -  SoftDisk last update timestamp
Title: Re: SoftDisk
Post by: datahell on June 24, 2007, 11:29:48
The first feature that uses SoftDisk is the "personal shortcuts" in backend's control panel.