Private
Public Access
Initial docset viewer app
This commit is contained in:
commit
cff60930fb
23 files changed
+2484
No files matched your search
Executable
+67
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
$debug_env = getenv('APP_DEBUG');
|
||||
$debug_enabled = $debug_env === false
|
||||
? true
|
||||
: filter_var($debug_env, FILTER_VALIDATE_BOOL, FILTER_NULL_ON_FAILURE);
|
||||
if($debug_enabled === null)
|
||||
$debug_enabled = true;
|
||||
$error_reporting_level = $debug_enabled ? E_ALL : (E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING);
|
||||
error_reporting($error_reporting_level);
|
||||
ini_set('display_errors', $debug_enabled ? 'on' : 'off');
|
||||
|
||||
define('DATE_FORMAT', 'Y-m-d');
|
||||
define('DATETIME_FORMAT', 'Y-m-d H:i');
|
||||
define('ONE_MINUTE', 60);
|
||||
define('ONE_HOUR', 60 * 60);
|
||||
define('ONE_DAY', 60 * 60 * 24);
|
||||
|
||||
$GLOBALS['config'] = array(
|
||||
'debug' => array(
|
||||
'enabled' => $debug_enabled,
|
||||
'display_errors' => $debug_enabled,
|
||||
'reporting' => $error_reporting_level,
|
||||
),
|
||||
'url' => array(
|
||||
'pretty' => false,
|
||||
'root' => '',
|
||||
'content-type' => 'html',
|
||||
),
|
||||
'theme' => array(
|
||||
'key' => 'docset-viewer',
|
||||
'path' => 'themes/portal-dark/',
|
||||
'mode' => 'dark',
|
||||
'label' => 'Docset Viewer',
|
||||
'footer_text' => 'Docset Viewer - local Zeal/Dash documentation browser.',
|
||||
'meta_description' => 'Search and browse local Zeal docsets',
|
||||
'theme_color' => '#0f172a',
|
||||
'options' => array(),
|
||||
),
|
||||
'site' => array(
|
||||
'name' => 'Docset Viewer',
|
||||
'default_page_title' => 'Search Zeal Docsets',
|
||||
'include_paths' => ['views/', 'components/'],
|
||||
'autostart_session' => false,
|
||||
'timezone' => 'UTC',
|
||||
),
|
||||
'docsets' => array(
|
||||
'path' => __DIR__.'/../data/docsets',
|
||||
'snippet_length' => 180,
|
||||
'search_limit' => 80,
|
||||
),
|
||||
'track' => array('changes' => array()),
|
||||
'filebase' => array('path' => __DIR__.'/../tmp/'),
|
||||
'menu' => array(
|
||||
'' => array('title' => 'Search'),
|
||||
'docsets' => array('title' => 'Docsets'),
|
||||
),
|
||||
);
|
||||
|
||||
if(!$GLOBALS['config']['url']['pretty'] && !$GLOBALS['config']['url']['root'])
|
||||
{
|
||||
$sroot = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : ($_SERVER['DOCUMENT_URI'] ?? '');
|
||||
if(substr($sroot, -9) == 'index.php')
|
||||
$GLOBALS['config']['url']['root'] = substr($sroot, 0, -strlen('index.php'));
|
||||
}
|
||||
|
||||
date_default_timezone_set($GLOBALS['config']['site']['timezone'] ?: 'UTC');
|
||||
Reference in new issue
Block a user