Class Pastie_Driver
Pastie_Driver:: defines an API for implementing storage backends for
Pastie.
Copyright 2007-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (GPL). If you
did not receive this file, see http://www.horde.org/licenses/gpl.
Methods summary
public static
Pastie_Driver
|
#
factory( string $driver = null, array $params = null )
Attempts to return a concrete instance based on $driver.
Attempts to return a concrete instance based on $driver.
Parameters
- $driver
- <p>The type of the concrete subclass to return.
The class name is based on the storage driver
($driver). The code is dynamically included.</p>
- $params
- <p>A hash containing any additional configuration
or connection parameters a subclass might need.</p>
Returns
Throws
Horde_Exception
|
public
mixed
&
|
#
singleton( string $bin = '', string $driver = null, array $params = null )
Attempts to return a reference to a concrete Pastie_Driver instance based
on $driver.
Attempts to return a reference to a concrete Pastie_Driver instance based
on $driver.
It will only create a new instance if no Pastie_Driver instance with the
same parameters currently exists.
This should be used if multiple storage sources are required.
This method must be invoked as: $var = &Pastie_Driver::singleton()
Parameters
- $bin
- $notepad The name of the current notepad.
- $driver
- <p>The type of concrete Pastie_Driver subclass
to return. The is based on the storage
driver ($driver). The code is dynamically
included.</p>
- $params
- <p>(optional) A hash containing any additional
configuration or connection parameters a
subclass might need.</p>
Returns
mixed The created concrete Pastie_Driver instance, or false
on error.
|