VirtueMart  3.2.14.9808
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Attributes | List of all members
VmConfig Class Reference

Public Member Functions

 toString ()
 
 setParams ($params)
 
 isJ15 ()
 

Static Public Member Functions

static getStartTime ()
 
static setStartTime ($name, $value)
 
static getSecret ()
 
static echoAdmin ()
 
static showDebug ($override=false)
 
static setErrRepDefault ($force=false)
 
static setErrRepDebug ()
 
static ensureMemoryLimit ($minMemory=0)
 
static getMemoryLimitBytes ()
 
static getMemoryLimit ()
 
static ensureExecutionTime ($minTime=0)
 
static getExecutionTime ()
 
static getCache ($group= '', $handler= 'callback', $storage=null, $site=true)
 
static setdbLanguageTag ($siteLang=false)
 
static loadJLang ($name, $site=false, $tag=0, $cache=true)
 
static loadModJLang ($name)
 
static loadConfig ($force=FALSE, $fresh=FALSE, $lang=true, $exeTrig=true)
 
static get ($key, $default='', $allow_load=FALSE)
 
static set ($key, $value)
 
static parseJsonUnSerialize ($in, $b64Str=false)
 
static getInstalledVersion ($includeDevStatus=FALSE)
 
static isSuperVendor ($uid=0)
 
static isSite ()
 

Public Attributes

const LOGFILEEXT = '.log.php'
 
 $_params = array()
 
 $_raw = array()
 

Static Public Attributes

static $_debug = NULL
 
static $_starttime = array()
 
static $loaded = FALSE
 
static $maxMessageCount = 0
 
static $maxMessage = 300
 
static $echoDebug = FALSE
 
static $logDebug = FALSE
 
static $logFileName = 'com_virtuemart'
 
static $echoAdmin = FALSE
 
static $langs = array()
 
static $langCount = 0
 
static $vmlang = false
 
static $vmlangTag = ''
 
static $vmlangSef = ''
 
static $defaultLang = false
 
static $defaultLangTag = false
 
static $jDefLang = false
 
static $jDefLangTag = false
 
static $mType = 'info'
 
static $installed = false
 

Private Member Functions

 __construct ()
 

Static Private Attributes

static $_jpConfig = NULL
 
static $_secret = NULL
 
static $cache
 
static $isSite = null
 

Detailed Description

The time how long the config in the session is valid. While configuring the store, you should lower the time to 10 seconds. Later in a big store it maybe useful to rise this time up to 1 hr. That would mean that changing something in the config can take up to 1 hour until this change is effecting the shoppers. We use this Class STATIC not dynamically !

Constructor & Destructor Documentation

VmConfig::__construct ( )
private

Member Function Documentation

static VmConfig::echoAdmin ( )
static
static VmConfig::ensureExecutionTime (   $minTime = 0)
static
static VmConfig::ensureMemoryLimit (   $minMemory = 0)
static

Ensures a certain Memory limit for php (if server supports it)

Author
Max Milbers
Parameters
int$minMemory
static VmConfig::get (   $key,
  $default = '',
  $allow_load = FALSE 
)
static

Find the configuration value for a given key

Author
Max Milbers
Parameters
string$keyKey name to lookup
Returns
Value for the given key name
static VmConfig::getCache (   $group = '',
  $handler = 'callback',
  $storage = null,
  $site = true 
)
static
Deprecated:
Parameters
string$group
string$handler
null$storage
Returns
mixed
static VmConfig::getExecutionTime ( )
static
static VmConfig::getInstalledVersion (   $includeDevStatus = FALSE)
static

Find the currently installed version

Author
RickG
Parameters
boolean$includeDevStatusTrue to include the development status
Returns
String of the currently installed version
static VmConfig::getMemoryLimit ( )
static

Returns the PHP memory limit of the server in MB, regardless the used unit

Author
Max Milbers
Returns
float|int PHP memory limit in MB
static VmConfig::getMemoryLimitBytes ( )
static
static VmConfig::getSecret ( )
static
static VmConfig::getStartTime ( )
static
VmConfig::isJ15 ( )

Return if the used joomla function is j15

Deprecated:
use JVM_VERSION instead
static VmConfig::isSite ( )
static
static VmConfig::isSuperVendor (   $uid = 0)
static
Deprecated:
Returns
mixed
static VmConfig::loadConfig (   $force = FALSE,
  $fresh = FALSE,
  $lang = true,
  $exeTrig = true 
)
static

Loads the configuration and works as singleton therefore called static. The call using the program cache is 10 times faster then taking from the session. The session is still approx. 30 times faster then using the file. The db is 10 times slower then the session.

Performance:

Fastest is Program Cache: 1.5974044799805E-5 Session Cache: 0.00016094612121582

First config db load: 0.00052118301391602 Parsed and in session: 0.001554012298584

After install from file: 0.0040450096130371 Parsed and in session: 0.0051419734954834

Functions tests if already loaded in program cache, session cache, database and at last the file.

Load the configuration values from the database into a session variable. This step is done to prevent accessing the database for every configuration variable lookup.

Author
Max Milbers
Parameters
$forceboolean Forces the function to load the config from the db
static VmConfig::loadJLang (   $name,
  $site = false,
  $tag = 0,
  $cache = true 
)
static
static VmConfig::loadModJLang (   $name)
static
Deprecated:
please usevmLanguage::loadModJLang
static VmConfig::parseJsonUnSerialize (   $in,
  $b64Str = false 
)
static
static VmConfig::set (   $key,
  $value 
)
static
static VmConfig::setdbLanguageTag (   $siteLang = false)
static
static VmConfig::setErrRepDebug ( )
static
static VmConfig::setErrRepDefault (   $force = false)
static
VmConfig::setParams (   $params)

For setting params, needs assoc array

Author
Max Milbers
static VmConfig::setStartTime (   $name,
  $value 
)
static
static VmConfig::showDebug (   $override = false)
static
VmConfig::toString ( )

Writes the params as string and escape them before

Author
Max Milbers

Member Data Documentation

VmConfig::$_debug = NULL
static
VmConfig::$_jpConfig = NULL
staticprivate
VmConfig::$_params = array()
VmConfig::$_raw = array()
VmConfig::$_secret = NULL
staticprivate
VmConfig::$_starttime = array()
static
VmConfig::$cache
staticprivate
VmConfig::$defaultLang = false
static
VmConfig::$defaultLangTag = false
static
VmConfig::$echoAdmin = FALSE
static
VmConfig::$echoDebug = FALSE
static
VmConfig::$installed = false
static
VmConfig::$isSite = null
staticprivate
VmConfig::$jDefLang = false
static
VmConfig::$jDefLangTag = false
static
VmConfig::$langCount = 0
static
VmConfig::$langs = array()
static
VmConfig::$loaded = FALSE
static
VmConfig::$logDebug = FALSE
static
VmConfig::$logFileName = 'com_virtuemart'
static
VmConfig::$maxMessage = 300
static
VmConfig::$maxMessageCount = 0
static
VmConfig::$mType = 'info'
static
VmConfig::$vmlang = false
static
VmConfig::$vmlangSef = ''
static
VmConfig::$vmlangTag = ''
static
const VmConfig::LOGFILEEXT = '.log.php'

The documentation for this class was generated from the following file: