dmBridge PHP API
DMAuthenticationServiceFactory.php
00001 <?php
00002 #
00003 # dmBridge: a data access framework for CONTENTdm(R)
00004 #
00005 # Copyright © 2009, 2010, 2011 Board of Regents of the Nevada System of Higher
00006 # Education, on behalf of the University of Nevada, Las Vegas
00007 #
00008 
00013 abstract class DMAuthenticationServiceFactory {
00014 
00018    private static $service;
00019 
00024    public static function getService() {
00025       if (!self::$service) {
00026          $custom_class = DMConfigIni::getInstance()->getString(
00027                "dmbridge.authentication_class");
00028          if ($custom_class) {
00029             $path = sprintf("%s/../../extensions/%s.php",
00030                   dirname(__FILE__), $custom_class);
00031             if (!file_exists($path)) {
00032                throw new DMClassNotFoundException($path);
00033             }
00034             require_once($path);
00035             self::$service = new $custom_class;
00036          } else {
00037             self::$service = new DMCdmAuthenticationService();
00038          }
00039       }
00040       return self::$service;
00041    }
00042 
00043 }
 All Data Structures Functions Variables