Skip to content

Commit

Permalink
Added Encrypt::$default, the default instance name, part of #2849
Browse files Browse the repository at this point in the history
  • Loading branch information
Woody Gilk committed May 23, 2010
1 parent 8b4ac6f commit 1557b3e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion classes/kohana/encrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
*/
class Kohana_Encrypt {

/**
* @var string default instance name
*/
public static $default = 'default';

/**
* @var array Encrypt class instances
*/
Expand All @@ -42,8 +47,14 @@ class Kohana_Encrypt {
* @param string configuration group name
* @return object
*/
public static function instance($name = 'default')
public static function instance($name = NULL)
{
if ($name === NULL)
{
// Use the default instance name
$name = Encrypt::$default;
}

if ( ! isset(Encrypt::$instances[$name]))
{
// Load the configuration data
Expand Down

0 comments on commit 1557b3e

Please sign in to comment.