Class Raxan

Description

Raxan Main Class

Located in /raxan.php (line 111)



                    
Class Constant Summary
REVISION = 'rc1'
TPL_ALT = 8
TPL_EDIT = 24
TPL_FIRST = 1
TPL_ITEM = 4
TPL_LAST = 2
TPL_SELECT = 16
VERSION = 1.0
Variable Summary
static mixed $isDataStorageLoaded
static mixed $isDebug
static mixed $isInit
static mixed $isLocaleLoaded
static mixed $isLogging
static mixed $isPDOLoaded
static mixed $postBackToken
Method Summary
static void bindSysEvent ( $name,  $callback)
static string bindTemplate ( $rows,  $options)
static RaxanDateTime cDate ([ $dt = null])
static mixed config ([ $key = null], [ $value = null])
static RaxanPDO connect (mixed $dsn, [string $user = null], [string $password = null], [mixed $attribs = null])
static string currentURL ()
static mixed &data ([string $name = null], [mixed $value = null], [boolean $setValueIfNotIsSet = false])
static mixed &dataBank ( $bankId, [ $name = null], [ $value = null], [ $setValueIfNotIsSet = false])
static RaxanDataSanitizer dataSanitizer ([array $array = null], [string $charset = null])
static RaxanDataStorage dataStorage ([RaxanDataStorage $store = null])
static string dataStorageId ()
static boolean debug (string $txt)
static string debugOutut ()
static string escapeText ( $txt)
static string flash (string $name, [mixed $value = null])
static boolean imageResample (string $file, int $w, int $h, [string $type = null])
static array imageSize (string $file)
static array importCSV ( $file, [ $delimiter = ','], [ $enclosure = '"'], [ $escape = '\\'], [ $terminator = "\n"])
static boolean init ()
static void initDataStorage ()
static void initJSON ()
static string JSON (string $mode, mixed $value, [boolean $assoc = false])
static void loadConfig ( $file)
static boolean loadLangFile ( $fl)
static mixed loadPlugin (string $name, [boolean $extrn = false])
static boolean loadWidget (string $name, [boolean $extrn = false])
static string locale ([ $key = null], [ $arg1 = null], [ $arg2 = null], [ $arg3 = null], [ $arg4 = null], [ $arg5 = null], [ $arg6 = null])
static boolean log ( $var, [string $level = null], [string $label = null], string $str)
static string mapSitePathToUrl (string $pth)
static string paginate ( $maxPage,  $page, [ $options = null])
static void redirectTo (string $url, [boolean $useJavaScript = false])
static void redirectToView (string $view, [string $url = null], [boolean $useJavaScript = false])
static void removeData ( $name)
static void removeDataBank ( $bankId, [ $name = null])
static void sendError ( $msg, [ $code = null])
static void setBasePath ( $pth)
static boolean setLocale ( $code, [ $lang = null])
static Raxan singleton ()
static void startTimer ()
static void stopTimer ([ $time = null])
static void throwCallbackException ( $fn)
static mixed triggerSysEvent (string $name, [mixed $args = null])
Variables
static mixed $isDataStorageLoaded = false (line 129)
  • access: public
static mixed $isDebug = false (line 131)
  • access: public
static mixed $isInit = false (line 126)
  • access: public
static mixed $isLocaleLoaded = false (line 127)
  • access: public
static mixed $isLogging = false (line 132)
  • access: public
static mixed $isPDOLoaded = false (line 128)
  • access: public
static mixed $postBackToken (line 133)
  • access: public
Methods
static bindSysEvent (line 308)

Binds a callback functio to a System Event

  • access: public
static void bindSysEvent ( $name,  $callback)
  • $name
  • $callback
static bindTemplate (line 318)

Binds an Array or a PDO result set to a template

  • access: public
static string bindTemplate ( $rows,  $options)
  • $rows
  • $options
static cDate (line 572)

Converts the given date to a RaxanDateTime object

  • access: public
static RaxanDateTime cDate ([ $dt = null])
  • $dt
static config (line 582)

Returns or sets configuration values

  • access: public
static mixed config ([ $key = null], [ $value = null])
  • $key
  • $value
static connect (line 614)

Creates and returns a PDO connection to a database.

If connection failed then error is logged to the log file or debug screen. Sensitive data will be removed.

  • return: False if connection failed
  • access: public
static RaxanPDO connect (mixed $dsn, [string $user = null], [string $password = null], [mixed $attribs = null])
  • mixed $dsn: Acceptts string or array
  • string $user: Optional user name
  • string $password: Optional password
  • mixed $attribs: Optional PDO error mode or array of attributes. Set to TRUE to enable PDO error mode
static currentURL (line 660)

Returns current web page url relative to the document root

  • access: public
static string currentURL ()
static data (line 675)

Get and/or set a named data value for the current Session

  • access: public
static mixed &data ([string $name = null], [mixed $value = null], [boolean $setValueIfNotIsSet = false])
  • string $name
  • mixed $value
  • boolean $setValueIfNotIsSet
static dataBank (line 689)

Sets or returns a named data value for the current Session based on the specified data bank id

  • access: public
static mixed &dataBank ( $bankId, [ $name = null], [ $value = null], [ $setValueIfNotIsSet = false])
  • $bankId
  • $name
  • $value
  • $setValueIfNotIsSet
static dataSanitizer (line 708)

Returns a new instanace of RaxanDataSanitizer. Use the sanitizer to sanitize array or input values

  • access: public
static RaxanDataSanitizer dataSanitizer ([array $array = null], [string $charset = null])
  • array $array: Array containing values to be sanitized
  • string $charset
static dataStorage (line 721)

Returns or sets the session data storage handler

  • access: public
static RaxanDataStorage dataStorage ([RaxanDataStorage $store = null])
static dataStorageId (line 735)

Returns the session data storage id

  • access: public
static string dataStorageId ()
static debug (line 746)

Sends debugging information to client

  • access: public
static boolean debug (string $txt)
  • string $txt: Debug value. Set to TRUE or FALSE to enable or disable debugging
static debugOutut (line 763)

Returns debug output as text

  • access: public
static string debugOutut ()
static escapeText (line 777)

Converts multi-line text into a single-line JS string

  • access: public
static string escapeText ( $txt)
  • $txt
static flash (line 789)

Set or get flash value. Flash provides a way to pass temporary objects/values

between pages and views. The flash value is removed after it has been retrieved

  • access: public
static string flash (string $name, [mixed $value = null])
  • string $name
  • mixed $value
static getSharedSanitizer (line 803)

Returns a shared instanace of RaxanDataSanitizer with direct input enabled. Used internally

  • access: public
static RaxanDataSanitizer getSharedSanitizer ()
static imageResample (line 820)

Resamples (convert/resize) an image file. You can specify a new width, height and type

  • access: public
static boolean imageResample (string $file, int $w, int $h, [string $type = null])
  • string $file: Image path and file name
  • int $w: Width
  • int $h: Height
  • string $type: Supported image types: gif,png,jpg,bmp,xbmp,wbmp. Defaults to jpg
static imageSize (line 858)

Returns an array containing the width, height and type for the image file

  • return: Returns array or NULL if error
  • access: public
static array imageSize (string $file)
  • string $file: Image path and file name
static importCSV (line 879)

Converts a CSV file into an 2D array. The first row of the CSV file must contain the column names

  • access: public
static array importCSV ( $file, [ $delimiter = ','], [ $enclosure = '"'], [ $escape = '\\'], [ $terminator = "\n"])
  • $file
  • $delimiter
  • $enclosure
  • $escape
  • $terminator
static init (line 200)

Initialize the system and load config options

  • access: public
static boolean init ()
static initDataStorage (line 284)

Initialize session data storage handler

  • access: public
static void initDataStorage ()
static initJSON (line 295)

Initialize JSON support

  • access: public
static void initJSON ()
static JSON (line 892)

Encode/Decode JSON Strings

  • access: public
static string JSON (string $mode, mixed $value, [boolean $assoc = false])
  • string $mode: Set to encode or decode
  • mixed $value: Value to be encoded or decoded
  • boolean $assoc: Set to true to return objects as associative arrays
static loadConfig (line 928)

Loads a config file

  • access: public
static void loadConfig ( $file)
  • $file
static loadLangFile (line 939)

Loads a language file based on locale settings

usage: loadLangFile($fl1,$fl2,$fl3,...)

  • access: public
static boolean loadLangFile ( $fl)
  • $fl
static loadPlugin (line 963)

Loads a plugin from the plugins folder.

Usage: <p>Raxan::loadPlugin($name,$extrn)</p>

  • return: Returns an instance of the plugin
  • access: public
static mixed loadPlugin (string $name, [boolean $extrn = false])
  • string $name: Name of plugin file without the .php extension
  • boolean $extrn: Set to true if plugin will be loaded from a folder that's not relative to {plugins.path}
static loadWidget (line 983)

Loads a widget from the widgets folder.

  • access: public
static boolean loadWidget (string $name, [boolean $extrn = false])
  • string $name: Name of widget file without the .php extension
  • boolean $extrn: Set to true if widget will be loaded from a folder that's not relative to {widgets.path}
static locale (line 918)

Returns locale settings based on the the site.locale config option

  • access: public
static string locale ([ $key = null], [ $arg1 = null], [ $arg2 = null], [ $arg3 = null], [ $arg4 = null], [ $arg5 = null], [ $arg6 = null])
  • $key
  • $arg1
  • $arg2
  • $arg3
  • $arg4
  • $arg5
  • $arg6
static log (line 996)

Adds an entry to the log file

  • access: public
static boolean log ( $var, [string $level = null], [string $label = null], string $str)
  • string $str
  • string $level: Optional tag to be assocciated with the log entry. E.g. ERROR, WARNING, INFO, etc
  • string $label: Optional.
  • $var
static mapSitePathToUrl (line 1019)

Returns the URL for a file or folder path within the site

  • return: Returns null if file or folder is not within the site
  • access: public
static string mapSitePathToUrl (string $pth)
  • string $pth: The path to the file or folder
static paginate (line 1039)

Generate page numbers based . The $option values are similar to that of bindTemplate

  • access: public
static string paginate ( $maxPage,  $page, [ $options = null])
  • $maxPage
  • $page
  • $options
static redirectTo (line 1077)

Redirect client to the specified url

  • access: public
static void redirectTo (string $url, [boolean $useJavaScript = false])
  • string $url: page url
  • boolean $useJavaScript: Optional. Enable page redirection using client-side JavaScript
static redirectToView (line 1093)

Redirect to new page view

  • access: public
static void redirectToView (string $view, [string $url = null], [boolean $useJavaScript = false])
  • string $view: View mode
  • string $url: Optional page url
  • boolean $useJavaScript: Optional. Enable page redirection using client-side JavaScript
static removeData (line 1104)

Remove session data

  • access: public
static void removeData ( $name)
  • $name
static removeDataBank (line 1113)

Remove named data from a data bank within the current session

  • access: public
static void removeDataBank ( $bankId, [ $name = null])
  • $bankId
  • $name
static sendError (line 1123)

Sends an error page to the web browser

  • access: public
static void sendError ( $msg, [ $code = null])
  • $msg
  • $code
static setBasePath (line 1149)

Sets the base path for the framework

  • access: public
static void setBasePath ( $pth)
  • $pth
static setLocale (line 1158)

Sets the locale and/or lang code

  • access: public
static boolean setLocale ( $code, [ $lang = null])
  • $code
  • $lang
static singleton (line 1191)

Returns an instance of Raxan

  • access: public
static Raxan singleton ()
static startTimer (line 1199)

Start/Stop Timer Functions

  • access: public
static void startTimer ()
static stopTimer (line 1200)
  • access: public
static void stopTimer ([ $time = null])
  • $time
static throwCallbackException (line 1228)

Throws an exception for missing or invalid callback

  • access: public
static void throwCallbackException ( $fn)
  • $fn
static triggerSysEvent (line 1210)

Triggers a System Event

  • access: public
static mixed triggerSysEvent (string $name, [mixed $args = null])
  • string $name: Event type/name
  • mixed $args: Optional event argument
Class Constants
REVISION = 'rc1' (line 116)
TPL_ALT = 8 (line 122)
TPL_EDIT = 24 (line 124)
TPL_FIRST = 1 (line 119)
TPL_ITEM = 4 (line 121)
TPL_LAST = 2 (line 120)
TPL_SELECT = 16 (line 123)
VERSION = 1.0 (line 115)