Changeset 725
- Timestamp:
- 06/10/07 12:17:02 (1 year ago)
- Files:
-
- trunk/src/main/php/net/stubbles/reflection/annotations/stubAbstractAnnotation.php (modified) (2 diffs)
- trunk/src/test/php/net/stubbles/integration/AnnotationClass.php (added)
- trunk/src/test/php/net/stubbles/integration/AnnotationTestCase.php (added)
- trunk/src/test/runIntegration.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/reflection/annotations/stubAbstractAnnotation.php
r722 r725 22 22 */ 23 23 protected $annotationName; 24 /** 25 * a list of reflected class instances used in the annotation 26 * 27 * This property should only be used by this class. We can not make this 28 * property private because the serializung mechanism will not work then. 29 * 30 * @var array<string,string> 31 */ 32 protected $reflectedClasses = array(); 24 33 25 34 /** … … 49 58 { 50 59 foreach (get_object_vars($this) as $name => $value) { 51 if ( is_object($value) == true &&$value instanceof stubClonable) {60 if ($value instanceof stubClonable) { 52 61 $this->$name = clone $this->$name; 53 62 } 54 63 } 55 64 } 65 66 /** 67 * store only the names of the property and the reflected class names, 68 * not the reflection class itself because it can not be serialized 69 * 70 * @return array<string> 71 */ 72 public function __sleep() 73 { 74 $propertiesToSerialize = array(); 75 foreach (get_object_vars($this) as $name => $value) { 76 if ($value instanceof stubReflectionClass) { 77 $this->reflectedClasses[$name] = $value->getFullQualifiedClassName(); 78 } else { 79 $propertiesToSerialize[] = $name; 80 } 81 } 82 83 return $propertiesToSerialize; 84 } 85 86 /** 87 * restore all properties containing an instance of a reflection class 88 */ 89 public function __wakeup() 90 { 91 foreach ($this->reflectedClasses as $propertyName => $reflectedClasses) { 92 $this->$propertyName = new stubReflectionClass($reflectedClasses); 93 } 94 95 $this->reflectedClasses = array(); 96 } 56 97 } 57 98 ?> trunk/src/test/runIntegration.php
r589 r725 31 31 $testSuite = new TestSuite('All tests.'); 32 32 33 $testSuite->addTestFile(TEST_SRC_PATH . '/php/net/stubbles/integration/AnnotationTestCase.php'); 33 34 $testSuite->addTestFile(TEST_SRC_PATH . '/php/net/stubbles/integration/DatabaseTestCase.php'); 34 35 $testSuite->addTestFile(TEST_SRC_PATH . '/php/net/stubbles/integration/InterceptorTestCase.php');
