util 
[ doc home ] [ class tree: util ] [ index: util ] [ all elements ]

Class: IsterObject

Source Location: /IsterObject.php

Class Overview


Base class of Ister Framework.


Author(s): Ingo Schramm   

Copyright: Copyright (c) 2005 Ister.ORG Ingo Schramm

Methods


Child classes:

IsterACLProtector
This class represents a protector.
IsterRessourceChecker
This class represents a checker for ressources.
IsterTemplateFactory
This class represents a factory for template languages.
IsterTemplate
This class represents a Template.
IsterACLPasswordFactory
Factory producing IsterACLPassword objects.
IsterAppConfigureFactory
This class represents a factory to create configuration objects.
IsterUIDescExpatNative
This class represents a xml description.
IsterCapability
This class represents capabilities.
IsterBufferFilter
This class represents a filter to apply to a buffer.
IsterACLPassword
This class represents passwords.
IsterTree
This class represents a directory like (not binary) tree.
IsterSqlPager
This class provides methods to build a pager for large SQL result sets.
IsterAppConfigureCollection
This class represents a configuration collection.
IsterAppPropertyFactory
This class represents a factory to create property collection objects.
IsterClassLoader
This class represents a class loader.
IsterXmlSimpleXMLImpl
This class represents a SimpleXML implementation.
IsterDate
This class represents a date.
IsterMethodProxy
This class represents a method proxy.
IsterMethodCaller
An object capable to register and invoke callback methods.
IsterUIDescFactory
This class represents a description of an object extending IsterUIBase.
IsterFileLocator
Locate a file inside of a *nix style path.
IsterAttributeSet
An object having attributes.
IsterQueue
This class represents a queue.
IsterSqlDriver
Base class for SQL drivers.
IsterMail
This class represents an email message.
IsterMethodProxyRegister
This class represents a register of objects.
IsterAppMain
This class represents an application.
IsterAppPropertyWriter
This class represents a property writer.
IsterUIDescExpat
This class represents a xml description.
T24FunctionContainer
This class represents a set of buildin functions for T24 template language.
IsterXmlNode
This class represents a generic XML node.
IsterXmlExpat
This class represents a generic namespace aware expat parser.
T24IncludeTree
This class represents an include tree.
IsterSqlConnection
This class represents database connections.
IsterHttpSecurityPolicy
Class representing a secutrity policy to apply to http reuqest data.
IsterParser
This class represents a template parser.
IsterObjectChecker
Compare two objects.

Inherited Constants

Inherited Variables

Inherited Methods


Class Details

Base class of Ister Framework.

IsterObjects have at least two important features: they can log their states and they can serialize themselves. The logging facility works global (unless you call setLogLocal() for a single object). That means, if you add a logger to one IsterObject this logger will be used by all IsterObjects.


copyright:  Copyright (c) 2005 Ister.ORG Ingo Schramm
author:  Ingo Schramm


[ Top ]


Class Methods


constructor IsterObject

object IsterObject( [boolean $phperr = false])

Constructor

The constructor adds an IsterStdLogger automatically.


Parameters:

boolean   $phperr   Whether to catch E_WARNING and E_NOTICE messages.

[ Top ]

method abstractMethodError

boolean abstractMethodError( string $name)

Report attempt to call an abstract method.

Parameters:

string   $name   Name of method.

[ Top ]

method addLogger

boolean addLogger( string $logger)

Add an IsterLogger to process log messages.

Loggers are always static, unless IsterObject::setLogLocal() was called.


Parameters:

string   $logger   Name of the IsterLogger to register.

[ Top ]

method deleteLogger

boolean deleteLogger( string $logger)

Delete an already registered IsterLogger.

Parameters:

string   $logger   Name of the IsterLogger to delete.

[ Top ]

method getLoggerNames

array getLoggerNames( )

Fetch the names of all currently registered IsterLoggers.

[ Top ]

method getMem

integer getMem( )

Return maximum amount of memory an application has allocated at this point.

This is only a rough value. It is increased each time a new object is created. If the object consumes memory itself, this cannot be added here.

Note: PHP must be compiled with --enable-memory-limit, otherwise this method always returns 0.


[ Top ]

method log

boolean log( string $msg, integer $level, string $caller, [string $context = null])

Trigger a log message.

A log mesage is not necessarily an error message. Choose one level of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE and ISTER_DEBUG_NOTICE. The caller usually identifies the method that triggers the log message. Additional information may be passed via $context.

The method will call exit() on E_USER_ERROR after logging has been completed.

Note that it is up to the added IsterLogger objects to actually process the logging information.


return:  False on E_USER_WARNING, true otherwise.
see:  IsterObject::addLogger()

Parameters:

string   $msg  
integer   $level  
string   $caller  
string   $context  

[ Top ]

method passPHPmessage

void passPHPmessage( integer $errno, string $str, string $file, integer $line)

Catch PHP E_WARNING and E_NOTICE messages.

This method is registered automatically using set_error_handler() on the very first IsterObject created if you assign the $phperr parameter of the constructor a true value.


Parameters:

integer   $errno  
string   $str  
string   $file  
integer   $line   return boolean

[ Top ]

method serialize

string serialize( )

Serialize the object.

[ Top ]

method setLogLocal

boolean setLogLocal( )

Set logging local for the current object.

After a call to this method, the object will have no IsterLoggers registered. You must register one before you can benefit from the logging facility.


[ Top ]

method setupLogger

void setupLogger( string $name, array $array)

Setup a logger.

see:  IsterLogger

Parameters:

string   $name   Name of the logger
array   $array   Array containing setup data

[ Top ]

method triggerError

boolean triggerError( string $msg, integer $level, string $caller, [string $context = null])

Alias for log();

depricated


Parameters:

string   $msg  
integer   $level  
string   $caller  
string   $context  

[ Top ]

method unserialize

void unserialize( string $data)

Unserialize the object.

The benefits of using this method over using a plain PHP unserialize() is that you already must have defined the class to use this method. Thus you have an improvement in robustness. Note: This is a class method.

  1. $o = new IsterObject;
  2. $data = $o->serialze();
  3. unset($o);
  4. $o = IsterObject::unserialize($data);


Parameters:

string   $data  

[ Top ]

method __sleep

array __sleep( )

Executed prior to serialize().

This method should be overwritten. The default implementation is:

  1. function __sleep() {
  2. return array_keys( get_object_vars($this) );
  3. }


Overridden in child classes as:

IsterSessionObject::__sleep()

[ Top ]

method __wakeup

void __wakeup( )

Executed prior to unserialize().

This method should be overwritten.


[ Top ]


Documentation generated on Tue, 20 Dec 2005 11:21:01 +0100 by phpDocumentor 1.3.0RC4