PHP Classes

File: resources/views/system_errors/api.php

Recommend this page to a friend!
  Classes of Ujah Chigozie peter   Luminova Framework   resources/views/system_errors/api.php   Download  
File: resources/views/system_errors/api.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Luminova Framework
PHP Luminova framework: simple, powerful MVC/HMVC.
Author: By
Last change: New update and changes
Date: 15 days ago
Size: 859 bytes
 

Contents

Class file image Download
<?php
/**
 * Luminova Framework
 *
 * @package Luminova
 * @author Ujah Chigozie Peter
 * @copyright (c) Nanoblock Technology Ltd
 * @license See LICENSE file
 */
$error = [
   
'code' => $stack ? $stack->getCode() : 0,
   
'title' => $stack ? htmlspecialchars($stack->getName()) : null,
];

if (
defined('PRODUCTION') && !PRODUCTION) {
   
$error['message'] = $stack ? htmlspecialchars($stack->getMessage()) : null;
}else{
   
$error['message'] = 'Something went wrong, please check your server error logs for more details.';
}

response(500, null, true)->json([
   
'error' => $error,
   
'framework' => [
       
'php_version' => PHP_VERSION,
       
'version' => defined('\Luminova\Application\Foundation::VERSION') ? \Luminova\Application\Foundation::VERSION : '1.0.0',
       
'environment' => defined('ENVIRONMENT') ? ENVIRONMENT : 'Unknown',
    ]
]);