propel
[ class tree: propel ] [ index: propel ] [ all elements ]

Class: Propel

Source Location: /Propel.php

Class Overview


Propel's main resource pool and initialization & configuration class.


Author(s):

Version:

  • $Revision: 821 $

Constants

Methods



Class Details

[line 43]
Propel's main resource pool and initialization & configuration class.

This static class is used to handle Propel initialization and to maintain all of the open database connections and instantiated database maps.




Tags:

author:  Magnús Þór Torfason <magnus@handtolvur.is> (Torque)
author:  Daniel Rall <dlr@finemaltcoding.com> (Torque)
author:  Hans Lellelid <hans@xmpl.rg> (Propel)
author:  Kurt Schrader <kschrader@karmalab.org> (Torque)
author:  Jason van Zyl <jvanzyl@apache.org> (Torque)
author:  Henning P. Schmiedehausen <hps@intermeta.de> (Torque)
author:  Martin Poeschl <mpoeschl@marmot.at> (Torque)
author:  Rafal Krzewski <Rafal.Krzewski@e-point.pl> (Torque)
version:  $Revision: 821 $


[ Top ]


Class Methods


static method autoload [line 619]

static boolean autoload( string $className)

Autoload function for loading propel dependencies.



Tags:

return:  TRUE if the class was loaded, false otherwise.
access:  public


Parameters:

string   $className   The class name needing loading.

[ Top ]

static method close [line 605]

static void close( )

Closes any associated resource handles.

This method frees any database connection handles that have been opened by the getConnection() method.




Tags:

access:  public


[ Top ]

static method configure [line 236]

static void configure( string $configFile)

Configure Propel using an INI or PHP (array) config file.



Tags:

throws:  PropelException If configuration file cannot be opened. (E_WARNING probably will also be raised by PHP)
access:  public


Parameters:

string   $configFile   Path (absolute or relative to include_path) to config file.

[ Top ]

static method configureLogging [line 247]

static void configureLogging( )

Configure the logging system, if config is specified in the runtime configuration.



Tags:

access:  protected


[ Top ]

static method disableInstancePooling [line 643]

static void disableInstancePooling( )

Disable instance pooling.



Tags:

access:  public


[ Top ]

static method enableInstancePooling [line 651]

static void enableInstancePooling( )

Enable instance pooling (enabled by default).



Tags:

access:  public


[ Top ]

static method getConfiguration [line 302]

static array getConfiguration( )

Get the configuration for this component.



Tags:

return:  The Configuration
access:  public


[ Top ]

static method getConnection [line 433]

static PDO getConnection( [string $name = null])

Gets an already-opened PDO connection or opens a new one for passed-in db name.



Tags:

return:  A database connection
throws:  PropelException - if no conneciton params, or lower-level exception caught when trying to connect.
access:  public


Parameters:

string   $name   The name that is used to look up the DSN from the runtime properties file.

[ Top ]

static method getDatabaseMap [line 393]

static DatabaseMap getDatabaseMap( [string $name = null])

Returns the database map information. Name relates to the name of the connection pool to associate with the map.

The database maps are "registered" by the generated map builder classes.




Tags:

return:  The named
.
throws:  PropelException - if database map is null or propel was not initialized properly.
access:  public


Parameters:

string   $name   The name of the database corresponding to the DatabaseMap to retrieve.

[ Top ]

static method getDB [line 553]

static DBAdapter getDB( [string $name = null])

Returns database adapter for a specific datasource.



Tags:

return:  The corresponding database adapter.
throws:  PropelException If unable to find DBdapter for specified db.
access:  public


Parameters:

string   $name   The datasource name.

[ Top ]

static method getDefaultDB [line 590]

static string getDefaultDB( )

Returns the name of the default database.



Tags:

return:  Name of the default DB
access:  public


[ Top ]

static method hasLogger [line 330]

static bool hasLogger( )

Returns true if a logger, for example PEAR::Log, has been configured, otherwise false.



Tags:

return:  True if Propel uses logging
access:  public


[ Top ]

static method init [line 271]

static void init( string $c)

Initialization of Propel with an INI or PHP (array) configuration file.



Tags:

throws:  PropelException Any exceptions caught during processing will be rethrown wrapped into a PropelException.
access:  public


Parameters:

string   $c   The Propel configuration file path.

[ Top ]

static method initialize [line 200]

static void initialize( )

Initializes Propel



Tags:

throws:  PropelException Any exceptions caught during processing will be rethrown wrapped into a PropelException.
access:  public


[ Top ]

static method isInit [line 282]

static bool isInit( )

Determine whether Propel has already been initialized.



Tags:

return:  True if Propel is already initialized.
access:  public


[ Top ]

static method isInstancePoolingEnabled [line 661]

static boolean isInstancePoolingEnabled( )

the instance pooling behaviour. True by default.



Tags:

return:  Whether the pooling is enabled or not.
access:  public


[ Top ]

static method log [line 355]

static bool log( string $message, [string $level = self::LOG_DEBUG])

Logs a message If a logger has been configured, the logger will be used, otherwrise the logging message will be discarded without any further action



Tags:

return:  True if the message was logged successfully or no logger was used.
access:  public


Parameters:

string   $message   The message that will be logged.
string   $level   The logging level.

[ Top ]

static method logger [line 340]

static object Configured logger( )

Get the configured logger.



Tags:

return:  log class ([PEAR] Log or BasicLogger).
access:  public


[ Top ]

static method setConfiguration [line 292]

static void setConfiguration( array $c)

Sets the configuration for Propel and all dependencies.



Tags:

access:  public


Parameters:

array   $c   The Configuration

[ Top ]

static method setConnection [line 501]

static void setConnection( string $name, $con)

Sets the connection to use for specified datasource.



Tags:

access:  public


Parameters:

string   $name   The datasource name.
PropelPDO   $con   The PDO connection object to use for specified datasource.

[ Top ]

static method setDatabaseMap [line 416]

static void setDatabaseMap( string $name, $map)

Sets the database map object to use for specified datasource.



Tags:

access:  public


Parameters:

string   $name   The datasource name.
DatabaseMap   $map   The database map object to use for specified datasource.

[ Top ]

static method setDatabaseMapClass [line 635]

static void setDatabaseMapClass( string $name)

Set your own class-name for Database-Mapping. Then you can change the whole TableMap-Model, but keep its functionality for Criteria.



Tags:

access:  public


Parameters:

string   $name   The name of the class.

[ Top ]

static method setDB [line 577]

static void setDB( string $name, $adapter)

Sets a database adapter for specified datasource.



Tags:

access:  public


Parameters:

string   $name   The datasource name.
DBAdapter   $adapter   The DBAdapter implementation to use.

[ Top ]

static method setLogger [line 319]

static void setLogger( object The $logger)

Override the configured logger.

This is primarily for things like unit tests / debugging where you want to change the logger without altering the configuration file.

You can use any logger class that implements the propel.logger.BasicLogger interface. This interface is based on PEAR::Log, so you can also simply pass a PEAR::Log object to this method.




Tags:

access:  public


Parameters:

object The   $logger   new logger to use. ([PEAR] Log or BasicLogger)

[ Top ]


Class Constants

DEFAULT_NAME =  "default"

[line 48]

A constant for
  1. default
.


[ Top ]

LOG_ALERT =  1

[line 58]

A constant defining 'Immediate action required' logging level


[ Top ]

LOG_CRIT =  2

[line 63]

A constant defining 'Critical conditions' logging level


[ Top ]

LOG_DEBUG =  7

[line 88]

A constant defining 'Debug-level messages' logging level


[ Top ]

LOG_EMERG =  0

[line 53]

A constant defining 'System is unusuable' logging level


[ Top ]

LOG_ERR =  3

[line 68]

A constant defining 'Error conditions' logging level


[ Top ]

LOG_INFO =  6

[line 83]

A constant defining 'Informational' logging level


[ Top ]

LOG_NOTICE =  5

[line 78]

A constant defining 'Normal but significant' logging level


[ Top ]

LOG_WARNING =  4

[line 73]

A constant defining 'Warning conditions' logging level


[ Top ]

VERSION =  '1.3.0-dev'

[line 93]

The Propel version.


[ Top ]



Documentation generated on Thu, 22 Nov 2007 03:33:51 +0000 by phpDocumentor 1.4.0