diff options
author | Olav Morken <olav.morken@uninett.no> | 2010-11-03 13:23:56 +0000 |
---|---|---|
committer | Olav Morken <olav.morken@uninett.no> | 2010-11-03 13:23:56 +0000 |
commit | db59506010cbc46fdfbad225c6a3813e0698c908 (patch) | |
tree | 07f475afdf25d248141d3af20dfeea5ed113d062 | |
parent | a6f0137756372ebf79ce76f356f2ee949b1e5a1b (diff) | |
download | simplesamlphp-db59506010cbc46fdfbad225c6a3813e0698c908.zip simplesamlphp-db59506010cbc46fdfbad225c6a3813e0698c908.tar.gz simplesamlphp-db59506010cbc46fdfbad225c6a3813e0698c908.tar.bz2 |
SimpleSAML_Store: Add support for defining datastores in modules.
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2619 44740490-163a-0410-bde0-09ae8108e29a
-rw-r--r-- | lib/SimpleSAML/Store.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/SimpleSAML/Store.php b/lib/SimpleSAML/Store.php index 134833f..9447c44 100644 --- a/lib/SimpleSAML/Store.php +++ b/lib/SimpleSAML/Store.php @@ -48,7 +48,12 @@ abstract class SimpleSAML_Store { self::$instance = new SimpleSAML_Store_SQL(); break; default: - throw new SimpleSAML_Error_Exception('Unknown datastore type: ' . var_export($storeType, TRUE)); + if (strpos($storeType, ':') === FALSE) { + throw new SimpleSAML_Error_Exception('Unknown datastore type: ' . var_export($storeType, TRUE)); + } + /* Datastore from module. */ + $className = SimpleSAML_Module::resolveClass($storeType, 'Store', 'SimpleSAML_Store'); + self::$instance = new $className(); } return self::$instance; |