‪TYPO3CMS  10.4
FileLocation.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
23 
30 {
34  protected ‪$path;
35 
39  protected ‪$filePath;
40 
44  protected ‪$baseUrl;
45 
46  public function ‪__construct(string ‪$path)
47  {
48  $this->path = ‪$path;
49  $this->filePath = ‪Environment::getPublicPath() . ‪$path;
50  $this->baseUrl = GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST')
51  . ‪PathUtility::getAbsoluteWebPath($this->filePath);
52  }
53 
57  public function ‪getFilePath(): string
58  {
59  return ‪$this->filePath;
60  }
61 
65  public function ‪getBaseUrl(): string
66  {
67  return ‪$this->baseUrl;
68  }
69 }
‪TYPO3\CMS\Install\SystemEnvironment\ServerResponse\FileLocation\__construct
‪__construct(string $path)
Definition: FileLocation.php:43
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:24
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static string getPublicPath()
Definition: Environment.php:180
‪TYPO3\CMS\Install\SystemEnvironment\ServerResponse\FileLocation\$baseUrl
‪string $baseUrl
Definition: FileLocation.php:41
‪TYPO3\CMS\Install\SystemEnvironment\ServerResponse\FileLocation\$filePath
‪string $filePath
Definition: FileLocation.php:37
‪TYPO3\CMS\Install\SystemEnvironment\ServerResponse
Definition: ContentSecurityPolicyDirective.php:18
‪TYPO3\CMS\Install\SystemEnvironment\ServerResponse\FileLocation
Definition: FileLocation.php:30
‪TYPO3\CMS\Install\SystemEnvironment\ServerResponse\FileLocation\getBaseUrl
‪string getBaseUrl()
Definition: FileLocation.php:62
‪TYPO3\CMS\Install\SystemEnvironment\ServerResponse\FileLocation\getFilePath
‪string getFilePath()
Definition: FileLocation.php:54
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:40
‪TYPO3\CMS\Install\SystemEnvironment\ServerResponse\FileLocation\$path
‪string $path
Definition: FileLocation.php:33
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Utility\PathUtility\getAbsoluteWebPath
‪static string getAbsoluteWebPath($targetPath)
Definition: PathUtility.php:43