forked from YetiForceCompany/YetiForceCRM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile.php
26 lines (25 loc) · 933 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
<?php
/**
* Basic file to handle files.
*
* @copyright YetiForce Sp. z o.o
* @license YetiForce Public License 3.0 (licenses/LicenseEN.txt or yetiforce.com)
* @author Mariusz Krzaczkowski <[email protected]>
*/
define('ROOT_DIRECTORY', __DIR__ !== DIRECTORY_SEPARATOR ? __DIR__ : '');
require __DIR__ . '/include/main/WebUI.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();
}