39 private static $instance =
null;
40 private $sanitizer =
null;
41 private function __construct()
51 if (self::$instance ===
null)
53 self::$instance =
new Helper();
56 return self::$instance;
71 return Option::get(
'rest', $this->optionEnableZipMod,
'N') ==
'Y';
82 $size = Option::get(
'rest', $this->optionMaxImportFileSize,
'');
102 $postfix = preg_replace(
'/[^a-zA-Z0-9_]/',
'', $postfix);
105 if ($USER->IsAuthorized())
107 $user = $USER->GetID();
114 $result .= $user.$postfix;
125 $result =
'external';
126 $appId = intval($appId);
129 $result = $this->prefixAppContext.$appId;
142 public function sanitize($value, &$bad =
false, $splitter =
' ')
149 if ($this->sanitizer ===
null)
151 $this->sanitizer =
false;
152 if (Loader::includeModule(
'security'))
154 $this->sanitizer =
new Auditor\Xss(
160 if ($this->sanitizer)
163 if (is_array($value))
165 foreach ($value as &$val)
167 $val = $this->
sanitize($val, $bad, $splitter);
171 elseif ($this->sanitizer->process($value))
174 $value = $this->sanitizer->getFilteredValue();
185 'MODULE_ID' =>
'rest',
186 'ENTITY_TYPE' => ProxyDiskType::className(),
194 if (Loader::includeModule(
'disk'))
196 $storage = \Bitrix\Disk\Driver::getInstance()->addStorageIfNotExist(
211 return (in_array($code, $this->basicManifest)) ? true :
false;
223 if (isset($appList[$manifestCode]))
225 $result = $appList[$manifestCode];
236 $data = Option::get(
'rest', $this->optionBasicAppList);
239 $data = Json::decode($data);
260 $appList[$manifestCode] = $appCode;
261 Option::set(
'rest', $this->optionBasicAppList, Json::encode($appList));
278 if (isset($appList[$manifestCode]))
280 unset($appList[$manifestCode]);
281 Option::set(
'rest', $this->optionBasicAppList, Json::encode($appList));
295 foreach ($appList as $manifest => $appCode)
312 return '\Bitrix\Rest\Configuration\Helper::sendStatisticAgent();';
static isModuleInstalled($moduleName)
const STRUCTURE_FILES_NAME
getContextAction($appId=0)
deleteBasicApp($manifestCode)
setBasicApp($manifestCode, $appCode)
static checkAccessManifest($params, $uses=[])
$appConfigurationFolderBackup
getBasicApp($manifestCode)
const CONFIGURATION_FILE_EXTENSION
const DEFAULT_ARCHIVE_NAME
const DEFAULT_ARCHIVE_FILE_EXTENSIONS
sanitize($value, &$bad=false, $splitter=' ')
static sendStatisticAgent()
const STRUCTURE_SMALL_FILES_NAME
static isEntityAvailable(string $entityCode, array $option, $uses=[])
static logConfiguration($clientId, $clientCode)