<?php // Change directory to project root chdir(__DIR__ . '/..'); // Use default autoload implementation require 'vendor/mindaphp/Loader.php'; // Load the libraries require 'config/loader.php'; // Load the config parameters require 'config/config.php'; echo Conventionist::html(); class Conventionist { public static function html() { $errors = static::check(); $str = "<h1>Conventionist</h1>"; $str .= "<table cellpadding=\"4\"><tr><th>#</th><th>type</th><th>table</th><th>field</th><th>message</th></tr>"; foreach ($errors as $i => $e) { $str .= "<tr><td>" . ($i + 1) . ".</td><td>{$e['type']}</td><td>{$e['table']}</td><td>{$e['field']}</td><td>{$e['message']}</td></tr>"; } $str .= "</table>"; return $str; } public static function text() { $errors = static::check(); $str = ""; foreach ($errors as $i => $e) { $str .= <<<END_OF_STR #{$i}
<?php chdir('..'); require "minjs_settings.php"; $settings = $minjs_settings; // parameters (server,username,password,database) $errors = Conventionist::check($settings['server'], $settings['username'], $settings['password'], $settings['database']); echo Conventionist::html($errors); class Conventionist { public static function html($errors) { $str = "<h1>Conventionist</h1>"; $str .= "<table cellpadding=\"4\"><tr><th>#</th><th>type</th><th>table</th><th>field</th><th>message</th></tr>"; foreach ($errors as $i => $e) { $str .= "<tr><td>" . ($i + 1) . ".</td><td>{$e['type']}</td><td>{$e['table']}</td><td>{$e['field']}</td><td>{$e['message']}</td></tr>"; } $str .= "</table>"; return $str; } public static function text($errors) { $str = "<h1>Conventionist</h1>"; $str .= "<table cellpadding=\"4\"><tr><th>#</th><th>type</th><th>table</th><th>field</th><th>message</th></tr>"; foreach ($errors as $i => $e) { $str .= "<tr><td>" . ($i + 1) . ".</td><td>{$e['type']}</td><td>{$e['table']}</td><td>{$e['field']}</td><td>{$e['message']}</td></tr>"; } $str .= "</table>"; return $str; } public static function check($server, $username, $password, $database)