tmp: template check
This commit is contained in:
@@ -1,45 +1,21 @@
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
// 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";
|
||||
|
||||
chdir(__DIR__ . '/admin');
|
||||
$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";
|
||||
|
||||
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 just the licenses table portion
|
||||
$licenses = \admin\factory\Releases::get_licenses();
|
||||
|
||||
echo "<h2>Licenses (" . count($licenses) . " rows)</h2>\n";
|
||||
echo "<p>empty(): " . (empty($licenses) ? 'TRUE' : 'FALSE') . "</p>\n";
|
||||
|
||||
echo "<table border='1'><tr><th>ID</th><th>Domain</th><th>Key (8)</th><th>valid_to_version</th><th>beta</th></tr>\n";
|
||||
foreach ($licenses as $lic) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . (int)$lic['id'] . "</td>";
|
||||
echo "<td>" . htmlspecialchars($lic['domain']) . "</td>";
|
||||
echo "<td>" . htmlspecialchars(substr($lic['key'], 0, 8)) . "</td>";
|
||||
echo "<td>" . htmlspecialchars($lic['valid_to_version'] ?? '') . "</td>";
|
||||
echo "<td>" . (int)$lic['beta'] . "</td>";
|
||||
echo "</tr>\n";
|
||||
// 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";
|
||||
}
|
||||
}
|
||||
echo "</table>\n";
|
||||
|
||||
Reference in New Issue
Block a user