>> YANA 4 PHP Framework >> Docs For Class Yana

Class Yana

Description

«Singleton» Yana

This is a primary controller and application loader for the YANA-Framework.

  • access: public

Located in /includes/class_yana.php

SerializeableObject
   |
   --Singleton
      |
      --Yana

Variable Summary

Method Summary

Yana Yana (string $filename, array $ARGS)
mixed &connect (string $source)
mixed getDefault (string $key)
integer getMode ()
mixed getVar (string $key)
boolean handle ([string $event = ""], [array $ARGS = NULL])
boolean merge (string $key, array $array)
void message (string $level, string $errcode, [string $event = ""])
void report (yana_log $log)
boolean setType (string $key, string $type)
boolean setVar (string $key, mixed $value)
boolean unsetVar (string $key)
void writeView ()

Variables

Language $language = null

readonly

  • access: public
PluginManager $plugins = null

readonly

  • access: public
Registry $registry = null

readonly

  • access: public
Skin $skin = null

readonly

  • access: public

Methods

Constructor Yana
Yana Yana (string $filename, array $ARGS)

«Singleton» Constructor

  • access: public
  • uses: new - yana("config/system.config", $_REQUEST)
Name Type Description
$filename string path to system.config
$ARGS array associative array of request vars
connect
mixed &connect (string $source)

«factory» connect()

returns a ready-to-use database connection

  • access: public
Name Type Description
$source string name of the database schema that describes the names and structure of tables within the database
getDefault
mixed getDefault (string $key)

returns the default value for a given var (if any) else returns null (not false!)

  • access: public
  • uses: $YANA->getDefault('CONTAINER1.CONTAINER2.DATA')
Name Type Description
$key string adress of data in memory (case insensitive)
getMode
integer getMode ()

returns current type of session (0=using profile|1=using default data)

  • access: public
  • uses: $YANA->getMode()
getVar
mixed getVar (string $key)

retrieves var from registry (memory shared by all plugins)

  • access: public
  • uses: $YANA->get('CONTAINER1.CONTAINER2.DATA')
Name Type Description
$key string adress of data in memory (case insensitive)
handle
boolean handle ([string $event = ""], [array $ARGS = NULL])

resolves event and calls plugin(s), with the given arguments

  • access: public
  • uses: $YANA->handle('test', - $_REQUEST)
Name Type Description
$event string (optional) script action parameter
$ARGS array (optional) array of passed arguments
merge
boolean merge (string $key, array $array)

merges the value at adresse $key with the provided array data

  • access: public
  • uses: $YANA->merge('CONTAINER1.CONTAINER2.DATA', - $array)
Name Type Description
$key string adress of data in memory (case insensitive)
$array array associative array to merge
message
void message (string $level, string $errcode, [string $event = ""])

outputs an text message (while terminating the current script)

  • access: public
  • uses: $YANA->message('ERROR', - '404')
Name Type Description
$level string type of message ('OK'|'ALERT'|'ERROR')
$errcode string code of corresponding message in message.config
$event string upcoming event to route to
report
void report (yana_log $log)

adds an entry to the log-queue (will be printed to screen or written to log-file, depending on base-class)

  • access: public
  • uses: $YANA->report($report)
Name Type Description
$log yana_log object containing the log entry
setType
boolean setType (string $key, string $type)

sets the type of a var on registry (memory shared by all plugins)

  • access: public
  • uses: $YANA->setType('CONTAINER1.CONTAINER2.DATA', - 'string')
Name Type Description
$key string adress of data in memory (case insensitive)
$type string new type of variable
setVar
boolean setVar (string $key, mixed $value)

sets var on registry (memory shared by all plugins)

  • access: public
  • uses: $YANA->setVar('CONTAINER1.CONTAINER2.DATA', - $value)
Name Type Description
$key string adress of data in memory (case insensitive)
$value mixed new value (may be scalar value or array)
unsetVar
boolean unsetVar (string $key)

removes var from registry (memory shared by all plugins)

  • access: public
  • uses: $YANA->unsetVar('CONTAINER1.CONTAINER2.DATA')
Name Type Description
$key string adress of data in memory (case insensitive)
writeView
void writeView ()

provides gui from current data

  • access: public
  • uses: $YANA->writeView()

Inherited Methods

Inherited From Singleton

Singleton::checkSingletonConstraint()

Inherited From SerializeableObject

SerializeableObject::serialize()
SerializeableObject::toString()

Documentation generated on Sat, 16 Sep 2006 17:06:13 +0200 by phpDocumentor 1.3.0RC4

yana author: Thomas MeyerHomepage: www.all-community.de/pub