forked from YetiForceCompany/YetiForceCRM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
file.php
27 lines (26 loc) · 938 Bytes
/
file.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
/**
* Basic file to handle files.
*
* @copyright YetiForce S.A.
* @license YetiForce Public License 5.0 (licenses/LicenseEN.txt or yetiforce.com)
* @author Mariusz Krzaczkowski <[email protected]>
*/
chdir(__DIR__);
require_once __DIR__ . '/include/main/WebUI.php';
require_once __DIR__ . '/include/RequirementsValidation.php';
\App\Process::$requestMode = 'File';
try {
$webUI = new App\Main\File();
$webUI->process(App\Request::init());
} catch (Exception $e) {
\App\Log::error($e->getMessage() . ' => ' . $e->getFile() . ':' . $e->getLine());
$response = new \Vtiger_Response();
$response->setEmitType(\Vtiger_Response::$EMIT_JSON);
$trace = '';
if (\App\Config::debug('DISPLAY_EXCEPTION_BACKTRACE') && \is_object($e)) {
$trace = str_replace(ROOT_DIRECTORY . DIRECTORY_SEPARATOR, '', $e->getTraceAsString());
}
$response->setError($e->getCode(), $e->getMessage(), $trace);
$response->emit();
}