Browse Source

fixed #ZF-8842 : avoid reflection call

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20343 44c647ce-9c0f-0410-b52a-842ac1e357ba
doctorrock83 16 years ago
parent
commit
f84f2449f9
1 changed files with 4 additions and 3 deletions
  1. 4 3
      library/Zend/Serializer.php

+ 4 - 3
library/Zend/Serializer.php

@@ -64,12 +64,13 @@ class Zend_Serializer
             require_once 'Zend/Serializer/Exception.php';
             require_once 'Zend/Serializer/Exception.php';
             throw new Zend_Serializer_Exception('Can\'t load serializer adapter "'.$adapterName.'"', 0, $e);
             throw new Zend_Serializer_Exception('Can\'t load serializer adapter "'.$adapterName.'"', 0, $e);
         }
         }
-        $adapterReflection = new ReflectionClass($adapterClass);
-        if (!$adapterReflection->implementsInterface('Zend_Serializer_Adapter_AdapterInterface')) {
+
+        $adapterObj = new $adapterClass($opts);
+        if (!$adapterObj instanceof Zend_Serializer_Adapter_AdapterInterface) {
             require_once 'Zend/Serializer/Exception.php';
             require_once 'Zend/Serializer/Exception.php';
             throw new Zend_Serializer_Exception('The serializer adapter class "'.$adapterClass.'" must implement Zend_Serializer_Adapter_AdapterInterface');
             throw new Zend_Serializer_Exception('The serializer adapter class "'.$adapterClass.'" must implement Zend_Serializer_Adapter_AdapterInterface');
         }
         }
-        return new $adapterClass($opts);
+        return $adapterObj;
     }
     }
 
 
     /**
     /**