Skip to content

Commit 19bf2f5

Browse files
committed
Merge branch 'release/0.8.4'
2 parents dcb9104 + 7117df5 commit 19bf2f5

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

.version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"strategy": "semver",
33
"major": 0,
44
"minor": 8,
5-
"patch": 3,
5+
"patch": 4,
66
"build": 0
77
}

src/Bootstrap.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,25 @@ function boot( string $ConfigPath ) : Application
3434
$Version = new Version();
3535
$Version->loadFromFile( "$BasePath/.version.json" );
3636

37-
return new Application( $Version->getAsString(), $Settings );
37+
try
38+
{
39+
$App = new Application( $Version->getAsString(), $Settings );
40+
}
41+
catch( \Exception $e )
42+
{
43+
echo Application::beautifyException( $e );
44+
exit( 1 );
45+
}
46+
47+
return $App;
3848
}
3949

4050
/**
4151
* Dispatches the current route mapped in the 'route' GET variable.
4252
*
4353
* @param Application $App
4454
*/
55+
4556
function dispatch( Application $App ) : void
4657
{
4758
$Route = Get::filterScalar( 'route' ) ?? "";

src/Mvc/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ public function clearExpiredCache(): int
480480
return 0;
481481
}
482482

483-
public function beautifyException( \Exception $e ): string
483+
public static function beautifyException( \Exception $e ): string
484484
{
485485
// this function should return a nicely formatted HTML representation of the exception
486486
$ExceptionType = get_class( $e );

src/Mvc/Views/Html.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ public function render( array $Data ): string
4141
$Path = "$BasePath/resources/views";
4242
}
4343

44-
$ControllerName = new NString( $this->getController() )->toSnakeCase();
44+
// Convert controller name to snake_case, preserving directory separators
45+
$controllerParts = explode( '/', $this->getController() );
46+
$snakeCaseParts = array_map(
47+
fn( $part ) => ( new NString( $part ) )->toSnakeCase(),
48+
$controllerParts
49+
);
50+
$ControllerName = implode( '/', $snakeCaseParts );
51+
4552
$View = "$Path/$ControllerName/{$this->getPage()}.php";
4653

4754
if( !file_exists( $View ) )

versionlog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 0.8.4 2025-11-07
2+
13
## 0.8.3 2025-11-07
24

35
* Added exception formatting.

0 commit comments

Comments
 (0)