PHP Classes

File: src/settings.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   Chronicle   src/settings.php   Download  
File: src/settings.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Chronicle
Append arbitrary data to a storage container
Author: By
Last change: Add pagination to /since
Type safety
Date: 1 year ago
Size: 1,066 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);

/* Local settings; not checked into git. */
$localSettings = [];
if (\
is_readable(CHRONICLE_APP_ROOT . '/local/settings.json')) {
   
$settingsFile = \file_get_contents(CHRONICLE_APP_ROOT . '/local/settings.json');
    if (\
is_string($settingsFile)) {
       
/** @var array $localSettings */
       
$localSettings = \json_decode($settingsFile, true);
    }
}

/* These are the defaults. You can override them locally by updating ../local/settings.json: */
$settings = [
   
'displayErrorDetails' => false, // set to false in production
   
'addContentLengthHeader' => false, // Allow the web server to send the content-length header

   
'paginate-export' => null,

   
// Renderer settings
   
'renderer' => [
       
'template_path' => CHRONICLE_APP_ROOT . '/templates/',
    ],

   
// Monolog settings
   
'logger' => [
       
'name' => 'paragonie-chronicle',
       
'path' => CHRONICLE_APP_ROOT . '/logs/app.log',
       
'level' => \Monolog\Logger::DEBUG,
    ],
];

return [
   
'settings' => $localSettings + $settings
];