Пример #1
0
 public static function registerStorage($name)
 {
     try {
         $store = new ReflectionClass($name);
     } catch (Exception $e) {
         throw new UUIDStorageException("Storage class does not exist.", 1001, $e);
     }
     if (array_search("UUIDStorage", $store->getInterfaceNames()) === FALSE) {
         throw new UUIDStorageException("Storage class does not implement the UUIDStorage interface.", 1002);
     }
     self::$storeClass = $name;
     if (func_num_args() > 1) {
         $args = func_get_args();
         array_shift($args);
         try {
             self::$store = $store->newInstanceArgs($args);
         } catch (Exception $e) {
             throw new UUIDStorageException("Storage class could not be instantiated with supplied arguments.", 1003, $e);
         }
     }
 }