mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
38 lines
775 B
PHP
38 lines
775 B
PHP
<?php
|
|
|
|
# Enable PHP dev cli-server
|
|
if (php_sapi_name() === 'cli-server' && is_file(__DIR__.preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI'])))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
include __DIR__ . '/../bootstrap.php';
|
|
|
|
define('IS_PRODUCTION', Request::getServerName() == 'lbry.io');
|
|
|
|
ini_set('display_errors', IS_PRODUCTION ? 'off' : 'on');
|
|
error_reporting(IS_PRODUCTION ? 0 : (E_ALL | E_STRICT));
|
|
|
|
register_shutdown_function('Controller::shutdown');
|
|
|
|
try
|
|
{
|
|
i18n::register();
|
|
Session::init();
|
|
if (!IS_PRODUCTION)
|
|
{
|
|
View::compileCss();
|
|
}
|
|
Controller::dispatch(Request::getRelativeUri());
|
|
}
|
|
catch(Throwable $e)
|
|
{
|
|
if (IS_PRODUCTION)
|
|
{
|
|
Slack::sendErrorIfProd($e);
|
|
throw $e;
|
|
}
|
|
|
|
http_response_code(500);
|
|
echo '<pre>'.Debug::exceptionToString($e).'</pre>';
|
|
}
|