PHP Classes

File: bin/mysql-draw

Recommend this page to a friend!
  Classes of jawira   PHP MySQL Draw   bin/mysql-draw   Download  
File: bin/mysql-draw
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP MySQL Draw
MySQL diagram generator PHP tool
Author: By
Last change:
Date: 1 year ago
Size: 640 bytes
 

Contents

Class file image Download
#!/usr/bin/env php
<?php declare(strict_types=1);

use
Jawira\MysqlDraw\Cli;

function
autoload(): void
{
 
$autoloads = ['in dev' => __DIR__ . DIRECTORY_SEPARATOR . '../vendor/autoload.php',
               
'as library' => __DIR__ . DIRECTORY_SEPARATOR . '../../../vendor/autoload.php',];
 
array_walk($autoloads, function (string $autoload) {
    if (
is_file($autoload)) {
      require
$autoload;
    }
  });
}

function
main(): void
{
  try {
   
$code = 0;
   
autoload();
   
Cli::main();
  } catch (
Throwable $throwable) {
    echo
$throwable->getMessage() . PHP_EOL;
   
$code = 1;
  } finally {
    exit(
$code);
  }
}

main();