Beispiel #1
0
  [first_name] VARCHAR(40), 
  [last_name] VARCHAR(40), 
  [email] VARCHAR(250));");

 // Create table messages
$file_db->exec("CREATE TABLE [course] (
  [id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
  [start] DATETIME NOT NULL, 
  [end] DATETIME NOT NULL, 
  [teacher_id] CHAR NOT NULL CONSTRAINT [FK_course_teacher] REFERENCES [teacher]([id]));");

 // Create table messages
$file_db->exec("CREATE TABLE [person] (
  [id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
  [first_name] VARCHAR(40) NOT NULL, 
  [last_name] VARCHAR(40) NOT NULL, 
  [email] VARCHAR(250) NOT NULL, 
  [identity] created NOT NULL);");

 // Create table messages
$file_db->exec("CREATE TABLE [student] (
  [id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
  [person_id] INTEGER NOT NULL CONSTRAINT [FK_student_person] REFERENCES [person]([id]), 
  [course_id] INTEGER NOT NULL CONSTRAINT [FK_student_course] REFERENCES [course]([id]), 
  [created] DATETIME NOT NULL, 
  [aborted] DATETIME);");
*/
$cdbyuml = new \Dlid\DbYuml\CDbYuml($file_db, ['scale' => 230, 'style' => 'scruffy', 'cachepath' => 'dlid14.mh', 'cachetime' => '15 minutes']);
$cdbyuml->outputText();
// Uncommen to see debug information
# ->outputImage(true);
Beispiel #2
0
<?php

require '../autoloader.php';
$dbh = new PDO('mysql:host=localhost;dbname=ames;', 'root', '3UfRAwak', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''));
$cdbyuml = new \Dlid\DbYuml\CDbYuml($dbh, ['cachepath' => 'mysql_example', 'cachetime' => '15 minutes']);
$cdbyuml->outputText(true)->outputImage();