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\Generator\ImageType;
use Pongee\DatabaseSchemaVisualization\Parser\MysqlParser;
tionCollection = new ConnectionCollection();
$imageGenerator = new ImageGenerator(
ImageType::Png,
__DIR__ . '/../../bin/plantuml-mit-1.2026.6.jar'
);
$schema = $parser->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 = $parser->run($sqlSchema, $forcedConnectionCollection);
print $jsonExport->export($schema);
declare(strict_types=1);
use Pongee\DatabaseSchemaVisualization\DataObject\Sql\Database\Connection\ConnectionCollection;
use Pongee\DatabaseSchemaVisualization\Export\Markdown;
use Pongee\DatabaseSchemaVisualization\Parser\MysqlParser;
(file_get_contents('./src/Template/Markdown/v1.twig'));
$forcedConnectionCollection = new ConnectionCollection();
$schema = $parser->run($sqlSchema, $forcedConnectionCollection);
print $markdownExport->export($schema);