Server IP : 85.193.89.191 / Your IP : 18.226.93.191 Web Server : Apache System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : bitrix ( 600) PHP Version : 8.1.27 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/bitrix/www/bitrix/modules/main/lib/web/webpacker/ |
Upload File : |
<?php namespace Bitrix\Main\Web\WebPacker; use Bitrix\Main\ArgumentException; /** * Class FileController * * @package Bitrix\Main\Web\WebPacker */ class FileController extends Builder { /** @var Output\File $file File. */ private $file; /** @var Loader $loader Loader. */ private $loader; /** * Delete. * * @return void */ public function delete() { $this->getOutputFile()->remove(); } /** * Configure file. * * @param string $id File ID. * @param string $moduleId Bitrix module ID. * @param string $dir File directory. * @param string $name Filename. * @return $this */ public function configureFile($id, $moduleId, $dir, $name) { $this->getOutputFile()->setId($id)->setModuleId($moduleId)->setDir($dir)->setName($name); return $this; } /** * @return Loader */ public function getLoader() { if (!$this->loader) { $this->loader = new Loader($this->getOutputFile()); } return $this->loader; } /** * Get output file. * * @return Output\File */ protected function getOutputFile() { if (!$this->file) { $this->file = new Output\File(); } $this->setOutput($this->file); return $this->file; } /** * Set output. * * @param Output\Base $output Output. * @return $this */ public function setOutput(Output\Base $output) { if (! $output instanceof Output\File) { throw new ArgumentException('Output File expected.'); } parent::setOutput($output); return $this; } /** * Get output. * * @return Output\Base */ public function getOutput() { if (!$this->output) { $this->output = new Output\File(); } return $this->output; } }