File manager - Edit - /home/c14075/dragmet-ural.ru/www/storage.php.tar
Back
home/c14075/dragmet-ural.ru/www/storage.php 0000644 00000003365 15136161025 0014340 0 ustar 00 <?php use Bitrix\Main\Application; use Bitrix\Main\Config\Configuration; use Bitrix\Main\Diag\ExceptionHandlerFormatter; use Bitrix\Main\Engine\Response\AjaxJson; use Bitrix\Main\Error; use Bitrix\Main\ErrorCollection; try { require($_SERVER["DOCUMENT_ROOT"]."/desktop_app/headers.php"); require_once($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php"); /** @var CAllMain $APPLICATION */ $diskEnabled = false; if(IsModuleInstalled('disk')) { $diskEnabled = \Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk'); if($diskEnabled && \Bitrix\Disk\Configuration::REVISION_API >= 5) { $storageController = new Bitrix\Disk\Bitrix24Disk\Legacy\StorageController(); $storageController ->setActionName($_REQUEST['action']) ->exec(); } else { $diskEnabled = false; } } if(!$diskEnabled) { $APPLICATION->IncludeComponent('bitrix:webdav.disk', '', array('VISUAL' => false)); CMain::FinalActions(); die(); } } catch (\Throwable $e) { $errorCollection = new ErrorCollection(); $exceptionHandling = Configuration::getValue('exception_handling'); if (!empty($exceptionHandling['debug'])) { $errorCollection[] = new Error(ExceptionHandlerFormatter::format($e)); if ($e->getPrevious()) { $errorCollection[] = new Error(ExceptionHandlerFormatter::format($e->getPrevious())); } } if ($e instanceof \Exception || $e instanceof \Error) { $exceptionHandler = Application::getInstance()->getExceptionHandler(); $exceptionHandler->writeToLog($e); } /** @global \CMain $APPLICATION */ global $APPLICATION; $APPLICATION->RestartBuffer(); while(ob_end_clean()); Application::getInstance()->end(0, AjaxJson::createError($errorCollection)); } home/c14075/dragmet-ural.ru/www/desktop_app/storage.php 0000644 00000004445 15147721701 0016656 0 ustar 00 <?php use Bitrix\Main\Application; use Bitrix\Main\Config\Configuration; use Bitrix\Main\Diag\ExceptionHandlerFormatter; use Bitrix\Main\Engine\Response\AjaxJson; use Bitrix\Main\Error; use Bitrix\Main\ErrorCollection; try { require($_SERVER["DOCUMENT_ROOT"]."/desktop_app/headers.php"); if (!defined("BX_FORCE_DISABLE_SEPARATED_SESSION_MODE")) { if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('%Bitrix24.Disk/([0-9.]+)%i', $_SERVER['HTTP_USER_AGENT'])) { define("BX_FORCE_DISABLE_SEPARATED_SESSION_MODE", true); } } require_once($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php"); /** @var CAllMain $APPLICATION */ $diskEnabled = false; if(IsModuleInstalled('disk')) { $diskEnabled = \Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk'); if($diskEnabled && \Bitrix\Disk\Configuration::REVISION_API >= 5) { $storageController = new Bitrix\Disk\Bitrix24Disk\Legacy\StorageController(); $storageController ->setActionName($_REQUEST['action']) ->exec() ; } else { $diskEnabled = false; } } if(!$diskEnabled) { $APPLICATION->IncludeComponent('bitrix:webdav.disk', '', array('VISUAL' => false)); CMain::FinalActions(); die(); } } catch (\Throwable $e) { $errorCollection = new ErrorCollection(); $exceptionHandling = Configuration::getValue('exception_handling'); if (!empty($exceptionHandling['debug'])) { $errorCollection[] = new Error(ExceptionHandlerFormatter::format($e)); if ($e->getPrevious()) { $errorCollection[] = new Error(ExceptionHandlerFormatter::format($e->getPrevious())); } } if ($e instanceof \Exception || $e instanceof \Error) { $exceptionHandler = Application::getInstance()->getExceptionHandler(); $exceptionHandler->writeToLog($e); } global $APPLICATION; $application = Application::getInstance(); if (($APPLICATION instanceof \CMain) && $application->isInitialized()) { $APPLICATION->RestartBuffer(); while (ob_end_clean()); Application::getInstance()->end(0, AjaxJson::createError($errorCollection)); } if (!headers_sent()) { header('Content-Type: application/json; charset=UTF-8'); echo json_encode([ 'status' => 'error', 'errors' => [ [ 'message' => 'Application can\'t start ', ], ], ]); } } home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/sale/lib/internals/analytics/storage.php 0000644 00000004363 15150404076 0025047 0 ustar 00 <?php namespace Bitrix\Sale\Internals\Analytics; use Bitrix\Main; /** * Class Storage * * @package Bitrix\Sale\Internals * @internal */ final class Storage { /** @var Provider $provider */ private $provider; /** * @param Provider $provider */ public function __construct(Provider $provider) { $this->provider = $provider; } /** * @return void */ public function save(): void { $providerData = $this->provider->getData(); if ($providerData) { $this->savePayload($providerData); } } /** * @param string $code * @param Main\Type\DateTime $dateTo * @return array */ public static function getPayloadByCode(string $code, Main\Type\DateTime $dateTo): array { if (empty($code)) { return []; } $result = []; $analyticsIterator = AnalyticsTable::getList([ 'select' => ['ID', 'PAYLOAD'], 'filter' => [ '=CODE' => $code, '<=CREATED_AT' => $dateTo, ], ]); while ($analyticsData = $analyticsIterator->fetch()) { $result[] = [ 'data' => $analyticsData['PAYLOAD'], 'hash' => self::calculateHash($analyticsData), ]; } return $result; } /** * @param string $providerCode * @param Main\Type\DateTime $dateTo * @return void */ public static function clean(string $providerCode, Main\Type\DateTime $dateTo): void { if (empty($providerCode)) { return; } AnalyticsTable::deleteByCodeAndDate($providerCode, $dateTo); } private function savePayload(array $data): void { AnalyticsTable::add([ 'CODE' => $this->provider::getCode(), 'PAYLOAD' => $data, ]); } /** * @param array $data * @return string */ private static function calculateHash(array $data): string { if (self::isB24()) { $uniqParam = BX24_HOST_NAME; } else { $uniqParam = Main\Analytics\Counter::getPrivateKey(); } return md5(serialize($data) . $uniqParam); } /** * @return bool */ private static function isB24(): bool { return Main\Loader::includeModule('bitrix24'); } /** * Cleans up old events * * @return string */ public static function cleanUpAgent(): string { $dateTo = new Main\Type\DateTime(); $dateTo->add('-30D'); AnalyticsTable::deleteByDate($dateTo); return '\Bitrix\Sale\Internals\Analytics\Storage::cleanUpAgent();'; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.28 |
proxy
|
phpinfo
|
Settings