Changeset 670
- Timestamp:
- 05/27/07 16:16:52 (1 year ago)
- Files:
-
- trunk/cache (modified) (1 prop)
- trunk/examples/index.php (modified) (1 diff)
- trunk/examples/ipc07/csvWriter.php (modified) (3 diffs)
- trunk/examples/ipc07/xmlSerializer.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cache
- Property svn:ignore changed from
*.cache
to
*.cache
users.csv
- Property svn:ignore changed from
trunk/examples/index.php
r665 r670 84 84 </li> 85 85 </ul> 86 87 <h1 style="font-size: 21px;">Conference examples</h1> 88 <p> 89 The following examples have been created for various conferences. 90 </p> 91 <ul> 92 <li> 93 <a href="http://www.slideshare.net/stubbles/declarative-development-using-annotations-in-php">Declarative Development with Annotations</a> at the International PHP 2007 Conference in Ludwigsburg 94 <ul> 95 <li> 96 <a href="ipc07/xmlSerializer.php">Serializing to XML</a> (<a href="showsource.php?group=ipc07&example=xmlSerializer">show PHP source</a>) 97 </li> 98 <li> 99 <a href="ipc07/csvWriter.php">Serializing to CSV</a> (<a href="showsource.php?group=ipc07&example=csvWriter">show PHP source</a>) 100 </li> 101 </ul> 102 </li> 103 </ul> 86 104 </body> 87 105 </html> trunk/examples/ipc07/csvWriter.php
r669 r670 35 35 * A person 36 36 * 37 * @CSV(file=" users.csv",37 * @CSV(file="../../cache/users.csv", 38 38 * delimeter=";") 39 39 */ … … 97 97 } 98 98 $csv = $class->getAnnotation('CSV'); 99 99 100 $fp = fopen($csv->file, 'a'); 100 101 $fields = array(); … … 112 113 113 114 CSVWriter::write($user); 115 116 echo "<pre>"; 117 echo file_get_contents('../../cache/users.csv'); 118 echo "</pre>"; 114 119 ?> trunk/examples/ipc07/xmlSerializer.php
r669 r670 102 102 $serializer->serialize($user, $writer); 103 103 104 echo "<pre>"; 105 106 echo htmlentities($writer->asXML()); 107 108 echo "\n\n"; 109 echo "Using the PHP reflection\n"; 104 110 $class = new ReflectionClass('Person'); 105 111 echo $class->getName() . "\n"; … … 108 114 } 109 115 116 echo "\n"; 117 echo "Using the Stubbles reflection\n"; 110 118 $class = new stubReflectionClass('Person'); 111 119 if ($class->hasAnnotation('XMLTag')) { … … 120 128 } 121 129 } 122 123 124 //echo $writer->asXML(); 130 echo "</pre>"; 125 131 ?>
