transform.php 475 B

12345678910111213141516171819202122
  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. // load the DB Designer 4 XML
  7. $xml = new DOMDocument;
  8. $xml->load('model.xml');
  9. // load the transformation stylesheet
  10. $xsl = new DOMDocument;
  11. $xsl->load('dbd2propel.xsl');
  12. $proc = new XSLTProcessor();
  13. // attach the xsl rules
  14. $proc->importStyleSheet($xsl);
  15. $schema_xml = $proc->transformToXML($xml);
  16. file_put_contents('schema.xml', $schema_xml);