21 protected const LANG_RESOURCE =
'/bitrix/js/landing/webpackassets/message_loader.js';
68 $this->fileController =
new WebPacker\FileController();
69 $this->
package = new WebPacker\Resource\Package();
79 $this->landingId = $lid;
88 $this->packageHash = $hash;
97 $this->filename = $name;
102 if($this->packageHash)
104 $this->filename = self::DEFAULT_NAME .
'_' . $this->packageHash .
'_' . time() .
'.js';
108 $this->filename = self::DEFAULT_NAME .
'_' . Random::getString(16) .
'.js';
119 $this->package->addAsset(WebPacker\Resource\Asset::create($resource));
133 $res = $this->fileController->build();
134 if ($res->isSuccess())
136 $this->fileId = $res->getId();
153 $file = \CFile::GetByID(
$fileId)->Fetch();
157 $this->fileController->configureFile(
171 if ($this->landingId)
177 && $this->packageHash
178 && ($file = \CFile::GetByID(
$fileId)->Fetch())
179 && strpos($file[
'ORIGINAL_NAME'], self::DEFAULT_NAME .
'_' . $this->packageHash) === 0
190 $fileQuery = FileTable::query()
192 ->addSelect(
'ORIGINAL_NAME')
193 ->where(
'MODULE_ID', self::MODULE_ID)
194 ->where(
'%ORIGINAL_NAME', self::DEFAULT_NAME)
196 $file = $fileQuery->fetch();
198 return $file ? $file[
'ID'] :
null;
203 $this->profile->useAllLangs(
true);
209 $this->fileController->addExtension(self::CORE_EXTENSION);
210 $this->fileController->addModule(
226 return $this->fileController
228 ->setCacheTtl(self::$cacheTtl)
240 if (!$lid || empty($lid))
static addUniqueAgent(string $funcName, array $params=[], int $time=7200, ?int $nextExecDelay=null)
static markToRebuild($lid)
addResource(string $resource)
setPackageHash(string $hash)
setFileName(string $name)
static markAllToRebuild()
static markAssetToRebuild($assetId=[])
static addToAsset($assetId, $fileId)
static getFilesFromAsset($assetId)
static clearCacheForLanding(int $lid)