tmp: render check

This commit is contained in:
2026-02-28 01:08:55 +01:00
parent b41fa58488
commit 869f25d6db

View File

@@ -1,21 +1,49 @@
<?php
// Show deployed template hash and check for licenses section
$file = __DIR__ . '/admin/templates/releases/main-view.php';
echo "File exists: " . (file_exists($file) ? 'YES' : 'NO') . "\n";
echo "MD5: " . md5_file($file) . "\n";
echo "Size: " . filesize($file) . " bytes\n";
echo "Modified: " . date('Y-m-d H:i:s', filemtime($file)) . "\n\n";
error_reporting(E_ALL);
ini_set('display_errors', 1);
$content = file_get_contents($file);
echo "Contains 'licenses': " . (strpos($content, 'licenses') !== false ? 'YES' : 'NO') . "\n";
echo "Contains 'pp_update_licenses': " . (strpos($content, 'pp_update_licenses') !== false ? 'YES' : 'NO') . "\n";
echo "Contains 'tab-licenses': " . (strpos($content, 'tab-licenses') !== false ? 'YES' : 'NO') . "\n";
echo "Contains 'foreach': " . (strpos($content, 'foreach') !== false ? 'YES' : 'NO') . "\n";
chdir(__DIR__ . '/admin');
// Show lines around licenses table
$lines = explode("\n", $content);
foreach ($lines as $i => $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, '</table>', $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 <tr> in licenses part
$lic_start = strpos($html, 'id="tab-licenses"');
$lic_end = strpos($html, '</div>', $lic_start + 100);
$lic_html = substr($html, $lic_start, $lic_end - $lic_start);
$tr_count = substr_count($lic_html, '<tr>');
echo "=== TR COUNT in #tab-licenses: $tr_count ===\n";
echo "=== TAB-LICENSES SNIPPET (first 500 chars) ===\n";
echo substr($lic_html, 0, 500) . "\n";