Skip to content

Commit

Permalink
Fix error views on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
puleeno committed Sep 30, 2023
1 parent f955c12 commit 5512375
Show file tree
Hide file tree
Showing 4 changed files with 5,262 additions and 4 deletions.
7 changes: 4 additions & 3 deletions app/Core/ExtensionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,11 @@ public function runActiveExtensions()
}
}

protected function getExtension($extensionName, $throwException = true)
public static function getExtension($extensionName, $throwException = true)
{
if (isset($this->activeExtensions[$extensionName])) {
return $this->activeExtensions[$extensionName];
$instance = static::getInstance();
if (isset($instance->activeExtensions[$extensionName])) {
return $instance->activeExtensions[$extensionName];
}
if ($throwException) {
throw new NotFoundExtensionException($extensionName);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function getExtensionName(): string
{
$class_info = new ReflectionClass($this);
if (strpos($class_info->getFileName(), get_path('extension')) !== false) {
$extensionPath = str_replace(get_path('extension') . '/', '', $class_info->getFileName());
$extensionPath = str_replace(get_path('extension') . DIRECTORY_SEPARATOR, '', $class_info->getFileName());
$extensionPathArr = explode(DIRECTORY_SEPARATOR, $extensionPath);
return $extensionPathArr[0];
}
Expand Down
3 changes: 3 additions & 0 deletions app/Http/Handlers/HttpErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ protected function respond(): Response
$error->setDescription($exception->getMessage());
}

var_dump($exception);
die;

$payload = new ActionPayload($statusCode, null, $error);
$encodedPayload = json_encode($payload, JSON_PRETTY_PRINT);

Expand Down
Loading

0 comments on commit 5512375

Please sign in to comment.