root/trunk/contrib/dbd2propel/transform.php

Revision 513, 475 bytes (checked in by heltem, 2 years ago)

Set svn:keywords property uniformly to .php, .xml and .properties files

  • Property svn:keywords set to Id Rev Date Author HeadURL Revision
Line 
1 <?php
2 /*
3 This PHP5 script will load the transform a DB Designer 4 database model to the
4 propel database schema file format
5 */
6
7 // load the DB Designer 4 XML
8 $xml = new DOMDocument;
9 $xml->load('model.xml');
10
11 // load the transformation stylesheet
12 $xsl = new DOMDocument;
13 $xsl->load('dbd2propel.xsl');
14
15 $proc = new XSLTProcessor();
16 // attach the xsl rules
17 $proc->importStyleSheet($xsl);
18
19 $schema_xml = $proc->transformToXML($xml);
20
21 file_put_contents('schema.xml', $schema_xml);
22
Note: See TracBrowser for help on using the browser.