diff --git a/_diag_licenses.php b/_diag_licenses.php index 2d0288d..d8f6d90 100644 --- a/_diag_licenses.php +++ b/_diag_licenses.php @@ -1,21 +1,49 @@ $line) { - if (strpos($line, 'licenses') !== false) { - echo ($i+1) . ": " . trim($line) . "\n"; - } -} +require_once '../config.php'; +require_once '../libraries/medoo/medoo.php'; +require_once '../libraries/grid/config.php'; + +$mdb = new medoo([ + 'database_type' => 'mysql', + 'database_name' => $database['name'], + 'server' => $database['host'], + 'username' => $database['user'], + 'password' => $database['password'], + 'charset' => 'utf8' +]); + +spl_autoload_register(function($classname) { + $q = explode('\\', $classname); + $c = array_pop($q); + $f = '../autoload/' . implode('/', $q) . '/class.' . $c . '.php'; + if (file_exists($f)) { require_once($f); return; } + $f = '../autoload/' . implode('/', $q) . '/' . $c . '.php'; + if (file_exists($f)) require_once($f); +}); + +// Render view (exactly like admin does) +$html = \admin\view\Releases::main_view(); + +// Find licenses table section in rendered HTML +$start = strpos($html, 'tab-licenses'); +$end = strpos($html, '', $start) + 8; +$section = substr($html, $start - 50, $end - $start + 50 + 100); + +header('Content-Type: text/plain'); +echo "=== FULL HTML SIZE: " . strlen($html) . " bytes ===\n\n"; +echo "=== LICENSES SECTION ===\n"; +echo $section . "\n\n"; + +// Count