PHP code example of pongee / database-schema-visualization
1. Go to this page and download the library: Download pongee/database-schema-visualization library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pongee / database-schema-visualization example snippets
declare(strict_types=1);
use Pongee\DatabaseSchemaVisualization\DataObject\Sql\Database\Connection\ConnectionCollection;
use Pongee\DatabaseSchemaVisualization\Export\Plantuml;
use Pongee\DatabaseSchemaVisualization\Generator\ImageGenerator;
use Pongee\DatabaseSchemaVisualization\Parser\MysqlParser;
t = new Plantuml(file_get_contents(__DIR__ . '/../../src/Template/Plantuml/v1.twig'));
$forcedConnectionCollection = new ConnectionCollection();
$imageGenerator = new ImageGenerator(
'png',
__DIR__ . '/../../bin/plantuml.jar',
__DIR__ . '/../../tmp/'
);
$schema = $sqlParser->run($sqlSchema, $forcedConnectionCollection);
print $imageGenerator->generate($plantumlExport->export($schema));
declare(strict_types=1);
use Pongee\DatabaseSchemaVisualization\DataObject\Sql\Database\Connection\ConnectionCollection;
use Pongee\DatabaseSchemaVisualization\Export\Json;
use Pongee\DatabaseSchemaVisualization\Parser\MysqlParser;
;
$forcedConnectionCollection = new ConnectionCollection();
$schema = $mysqlParser->run($sqlSchema, $forcedConnectionCollection);
print $jsonExport->export($schema);