Fix version display in AboutController and improve log output in CacheCommand; update routing for constant PROJECT_ROOT
This commit is contained in:
@@ -109,7 +109,7 @@ class AboutController {
|
|||||||
}
|
}
|
||||||
$text = ''; $last = array_key_last((array) $packages);
|
$text = ''; $last = array_key_last((array) $packages);
|
||||||
foreach ($packages as $key => $item) {
|
foreach ($packages as $key => $item) {
|
||||||
$text .= $item->name. ' v' .$item->version. ($key === $last ? '' : '<i class="bi-gear px-1"></i>');
|
$text .= $item->name. ' '.(str_starts_with($item->version,'v')?'':'v').$item->version. ($key === $last ? '' : '<i class="bi-gear px-1"></i>');
|
||||||
}
|
}
|
||||||
$this->app->json([ 'html' => $text ]);
|
$this->app->json([ 'html' => $text ]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class CacheCommand extends AbstractBaseCommand {
|
|||||||
$cache->set_dev($config->env() === 'development');
|
$cache->set_dev($config->env() === 'development');
|
||||||
$cache->set_asset($asset);
|
$cache->set_asset($asset);
|
||||||
$ares = $cache->Make_Cache();
|
$ares = $cache->Make_Cache();
|
||||||
if (is_array($ares)) $io->white("Processed of {$ares['user_count']} user.", true);
|
if (is_array($ares)) $io->white(implode("\n", $ares['log']), true);
|
||||||
$io->ok("Done.", true);
|
$io->ok("Done.", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ $router->group('', function(Router $router) use ($app, $session, $config) {
|
|||||||
|
|
||||||
// handle Cache css & js for application
|
// handle Cache css & js for application
|
||||||
$router->get('/cache/@filename', function($filename) use ($app) {
|
$router->get('/cache/@filename', function($filename) use ($app) {
|
||||||
$rootdir = (defined('PROJECT_ROOT')) ? PROJECT_ROOT : $app->get('app.project_root');
|
$rootdir = (defined('PROJECT_ROOT')) ? constant('PROJECT_ROOT') : $app->get('app.project_root');
|
||||||
$filePath = $rootdir . '/temp/cache/' . $filename;
|
$filePath = $rootdir . '/temp/cache/' . $filename;
|
||||||
if (file_exists($filePath) && !str_contains($filename, '..')) {
|
if (file_exists($filePath) && !str_contains($filename, '..')) {
|
||||||
$mimeType = 'application/octet-stream';
|
$mimeType = 'application/octet-stream';
|
||||||
|
|||||||
Reference in New Issue
Block a user