Class PHPDS_dependant

Description

This is a base class for PHPDS subsystems

It allows dependency injection and dependency fetching; also mimics multiple inheritance

  • author: greg
  • version: 1.0.2 (greg)
  • date: 20090427

Located in /PHPDS.inc.php (line 1071)


	
			
Direct descendents
Class Description
template This class contains methods that prints out to the template system, the template system is what the user see when using your application.
navigation This class extracts and organizes the main menus from the database and displayes it to the user. Shows only where permissions apply.
security This is a the core security class, it handles the security of the file system, where users can run only files where they have appropriate permission.
db This class makes connections to the database and makes the queries.
core This class contains general functions to use all over the system.
user A class representing a user in PHPDevShell.
PHPDS_tagger PHPDevShell is a RAD Framework aimed at developing administrative applications.
PHPDS_controller Master controller.
PHPDS_debug Adds FirePHP support to PHPDevShell.
PHPDS_login This base class implements the fundations for an authentification plugin It doesn't actually provides authentification (it will reject any request) but provides structure, cookie support ("remember me") and writing to the system log
PHPDS_notif This is a base class for PHPDS subsystems
PHPDS_errorHandler Error handler class
PHPDS_query PHPDevShell official Query handler.
PHPDS_PDOconnector This is a base class for PHPDS subsystems
Variable Summary
Method Summary
PHPDS_dependant __construct ()
boolean construct ()
object debugInstance ([ $domain = null])
instance factory ( $classname, string $classname,)
instance factoryWith (string $classname, array $params)
void info ($data $data)
void log (string $data)
owner PHPDS_dependance ([ $dependance = null], object $dependance,)
void _log ($data $data)
mixed __call (string $name, mixed $arguments)
mixed __get ($name $name)
void __set ( $name,  $value)
Variables
PHPDS_dependant $dependance (line 1077)

The object this object depend on. Ultimately up the chain it should be the main PHPSD instance

  • var: or PHPDS
  • access: protected
object or $parent (line 1087)

Holds a dependent extended object to appear as parent.

  • var: name of the field containing the object
  • access: protected
Methods
Constructor __construct (line 1097)

magic constructor

parameter list is not explicit: we're expecting the LAST argument to be the dependence, other are fed to construct()

  • author: greg
  • access: public
PHPDS_dependant __construct ()

Redefined in descendants as:
construct (line 1116)

Empty function called by the actual constructor; meant to be overriden

Supposed to return false (exactly) in case of error, otherwise return the object itself

  • return: or object
  • access: public
boolean construct ()

Redefined in descendants as:
debugInstance (line 1218)

Create instance of PHPDS_debug.

  • author: greg
  • version: 1.0.3
  • date: 20100412 (v1.0.1) (greg) deal with new sytle naming (starting with PHPDS_)
  • date: 20110202 (v1.0.3) (greg) fixed a bug of using factoryWith(à instead of factory()
  • date: 20100426 (v1.0.2) (greg) change to use PHPDS_dependance() to get the proper top owner
  • access: public
object debugInstance ([ $domain = null])
  • $domain

Redefined in descendants as:
factory (line 1280)

Create a new instance of the given class and link it as dependant (variable number of argument)

  • return: of $classname
  • author: greg
  • version: 1.2
  • see: PHPDS_debug
  • date: 20100922 (v1.2) (greg) created factoryWith()
  • date: 20100217 Split into factory() and PHPDS._factory() so the latter can be called with an array of arguments
  • date: 20091125 Added the dependance link as the last parameter of the constructor
  • access: public
instance factory ( $classname, string $classname,)
  • string $classname,: ... name of the class to instanciate, followed by class specific parameters
  • $classname
factoryWith (line 1299)

Create a new instance of the given class and link it as dependant (variable number of argument)

  • return: of $classname
  • author: greg
  • version: 1.0
  • access: public
instance factoryWith (string $classname, array $params)
  • string $classname: name of the class to instanciate
  • array $params: all the parameters to feed the object's constructor (packed into an array)
info (line 1259)

DEPRECATED: alias for _log()

  • access: public
void info ($data $data)
  • $data $data

Redefined in descendants as:
log (line 1238)

Send info data to the debug subsystem (console, firebug, ...)

The goal of this function is to be called all thourough the code to be able to track bugs.

  • version: 1.1
  • date: 20100928 (v1.1) (greg) this function send data with the DEBUG level
  • access: public
void log (string $data)
  • string $data

Redefined in descendants as:
  • PHPDS_debug::log() : Log the data to the backends with the LOG level (the smallest, most often seen)
PHPDS_dependance (line 1136)

Inject the given dependency into $this, and/or returns the owner

The default behavior is to try to get the top owner, ie the main PHPDS instance. However the given parmeter is supposed to be the object from where the new object is created. That means you can override this to "catch" the real owner at this time.

  • return: of $this
  • author: greg
  • version: 1.1.1
  • date: 20100426
  • date: 20110202 (v1.1.1) (greg) added a check to prevent breaking on $this->dependancy if it's not an object
  • access: public
owner PHPDS_dependance ([ $dependance = null], object $dependance,)
  • object $dependance,: the "owner", can be either PHPDS or PHPDS_dependant
  • $dependance
_log (line 1249)

DEPRECATED: alias for log()

  • access: public
void _log ($data $data)
  • $data $data
__call (line 1196)

Magic php function used when a non-defined method is called. Here we mimics multi-inheritance by calling methods from "roots"

  • access: public
mixed __call (string $name, mixed $arguments)
  • string $name
  • mixed $arguments
__get (line 1159)

Magic php function, called when trying to access a non-defined field

When a method want a field which doesn't exist, we assume it's a data from the father

  • author: greg
  • version: 1.0.2
  • date: 20100805 (v1.0.2) (greg) removed direct access to fields to avoid giving public access to private/protected fields
  • date: 20100426 (v1.0.1) (greg) change to use PHPDS_dependance() to get the proper top owner
  • access: public
mixed __get ($name $name)
  • $name $name: string name of the field to fetch
__set (line 1177)
  • access: public
void __set ( $name,  $value)
  • $name
  • $value

Documentation generated on Tue, 09 Aug 2011 09:05:01 +0200 by phpDocumentor 1.4.3