CMS 2.0 - Theme engine, logging, admin improvements
Major changes: - New ThemeManager with Twig templating and SCSS compilation - Dynamic themes system (themes/default, themes/demo) - LogManager with SQLite storage and syslog forwarding - RequestLogger with static helper methods - Admin UI overhaul (Bootstrap 5, dark mode) - Admin config page with logging and theme settings - Admin logs page with filters and search - Removed legacy Mustache templates - Removed test plugin and theme - Composer dependencies: Twig, scssphp, CommonMark, MaxMind GeoIP
This commit is contained in:
+52
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace SourceSpan;
|
||||
|
||||
use League\Uri\Contracts\UriInterface;
|
||||
|
||||
/**
|
||||
* The implementation of {@see SourceLocation} based on a {@see SourceFile}.
|
||||
*
|
||||
* @see SourceFile::location()
|
||||
*/
|
||||
final class FileLocation extends SourceLocationMixin
|
||||
{
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function __construct(
|
||||
private readonly SourceFile $file,
|
||||
private readonly int $offset,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getFile(): SourceFile
|
||||
{
|
||||
return $this->file;
|
||||
}
|
||||
|
||||
public function getOffset(): int
|
||||
{
|
||||
return $this->offset;
|
||||
}
|
||||
|
||||
public function getLine(): int
|
||||
{
|
||||
return $this->file->getLine($this->offset);
|
||||
}
|
||||
|
||||
public function getColumn(): int
|
||||
{
|
||||
return $this->file->getColumn($this->offset);
|
||||
}
|
||||
|
||||
public function getSourceUrl(): ?UriInterface
|
||||
{
|
||||
return $this->file->getSourceUrl();
|
||||
}
|
||||
|
||||
public function pointSpan(): FileSpan
|
||||
{
|
||||
return new ConcreteFileSpan($this->file, $this->offset, $this->offset);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user