/framework/experimental/couch/CouchModule.php
http://zoop.googlecode.com/ · PHP · 34 lines · 30 code · 4 blank · 0 comment · 2 complexity · 0027e53e0f1c9cfbb8be90b82d236ad9 MD5 · raw file
- <?php
- class CouchModule extends ZoopModule
- {
- private static $connections = array();
-
- static function getConnection($name)
- {
- if(!isset(self::$connections[$name]))
- trigger_error("connection '$name' does not exist");
- return self::$connections[$name];
- }
-
- static function getDefaultConnection()
- {
- return self::getConnection('default');
- }
-
- function getClasses()
- {
- return array('CouchConnection', 'CouchDocument', 'CouchHttp');
- }
-
- function configure()
- {
- $connections = $this->getConfig();
- if($connections)
- {
- foreach($connections as $name => $params)
- {
- self::$connections[$name] = new CouchConnection($params);
- }
- }
- }
- }