PHP 8.3.30
Preview: FileInfo.php Size: 1.26 KB
/home/getspomw/.trash/vendor/nette/utils/src/Utils/FileInfo.php

<?php

/**
 * This file is part of the Nette Framework (https://nette.org)
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
 */

declare(strict_types=1);

namespace Nette\Utils;

use Nette;


/**
 * Represents the file or directory returned by the Finder.
 * @internal do not create instances directly
 */
final class FileInfo extends \SplFileInfo
{
	private string $relativePath;


	public function __construct(string $file, string $relativePath = '')
	{
		parent::__construct($file);
		$this->setInfoClass(static::class);
		$this->relativePath = $relativePath;
	}


	/**
	 * Returns the relative directory path.
	 */
	public function getRelativePath(): string
	{
		return $this->relativePath;
	}


	/**
	 * Returns the relative path including file name.
	 */
	public function getRelativePathname(): string
	{
		return ($this->relativePath === '' ? '' : $this->relativePath . DIRECTORY_SEPARATOR)
			. $this->getBasename();
	}


	/**
	 * Returns the contents of the file.
	 * @throws Nette\IOException
	 */
	public function read(): string
	{
		return FileSystem::read($this->getPathname());
	}


	/**
	 * Writes the contents to the file.
	 * @throws Nette\IOException
	 */
	public function write(string $content): void
	{
		FileSystem::write($this->getPathname(), $content);
	}
}

Directory Contents

Dirs: 0 × Files: 25

Name Size Perms Modified Actions
1.86 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
2.61 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
13.59 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
3.50 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
2.85 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
775 B lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
1.26 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
9.07 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
13.05 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
2.07 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
2.50 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
19.03 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
24.03 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
1.60 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
421 B lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
5.59 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
2.22 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
6.85 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
4.38 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
1.20 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
8.48 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
812 B lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
22.41 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
6.36 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download
10.41 KB lrw-rw-rw- 2025-09-17 06:53:29
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).