Add Composer autoloading

This commit is contained in:
Gogs
2026-07-06 20:31:04 +02:00
parent 249bcb1f1b
commit 79d0976b80
13 changed files with 102 additions and 14 deletions
+23 -7
View File
@@ -1,9 +1,25 @@
app/cache/*
epg/*
logs/*
posters/*
logos/*
backups/*
.env
!.gitkeep
# Cache
app/cache/*
!app/cache/.gitkeep
# EPG-Dateien
epg/*
!epg/.gitkeep
# Logdateien
logs/*
!logs/.gitkeep
# Senderlogos
logos/*
!logos/.gitkeep
# Poster
posters/*
!posters/.gitkeep
# Backups
backups/*
!backups/.gitkeep
+21
View File
@@ -0,0 +1,21 @@
# Changelog
## v0.2.0 - Unreleased
### Added
- Configuration system
- `config.json`
- `channels.json`
- Automatic channel synchronization
- Channel visibility and ordering
## v0.1.0
### Added
- Initial Docker setup
- PHP/Apache web container
- XMLTV test file
- Basic TVGuide web interface
- Template structure
+3
View File
@@ -0,0 +1,3 @@
FROM php:8.4-apache
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
+7
View File
@@ -0,0 +1,7 @@
Copyright (c) 2026 Herwig Birke
All rights reserved.
This project is currently private. No permission is granted to copy,
modify, distribute, or use this software outside the author's environment
without explicit written permission.
+21
View File
@@ -0,0 +1,21 @@
# TVGuide
Self-hosted electronic TV guide based on XMLTV data.
## Goals
- Self-hosted web TV guide
- Docker-first setup
- XMLTV import
- Configurable channels
- Favorites
- Search
- Modern responsive UI
- Optional poster metadata via TMDb later
## Project path
Default installation path:
```text
/opt/tvguide-docker
+5 -3
View File
@@ -1,8 +1,10 @@
<?php
require_once '/var/www/src/Config.php';
require_once '/var/www/src/XmlTv.php';
require_once '/var/www/src/View.php';
require_once '/var/www/vendor/autoload.php';
use TVGuide\Config;
use TVGuide\XmlTv;
use TVGuide\View;
$config = new Config(
'/var/www/config/config.json',
+5
View File
@@ -1,5 +1,10 @@
<?php
namespace TVGuide;
use DateTime;
use DateTimeZone;
class Config
{
private array $config = [];
+2
View File
@@ -1,5 +1,7 @@
<?php
namespace TVGuide;
class View
{
public static function render(string $template, array $data = []): void
+1 -1
View File
@@ -9,7 +9,7 @@
</div>
<?php else: ?>
<?php foreach ($programmes as $p): ?>
<?php View::render('programme', ['p' => $p]); ?>
<?php \TVGuide\View::render('programme', ['p' => $p]); ?>
<?php endforeach; ?>
<?php endif; ?>
</section>
+1 -2
View File
@@ -5,10 +5,9 @@
<?php endif; ?>
<?php foreach ($channels as $channelId => $channel): ?>
<?php View::render('channel', [
<?php \TVGuide\View::render('channel', [
'channelId' => $channelId,
'channel' => $channel,
'programmes' => $programmes[$channelId] ?? []
]); ?>
<?php endforeach; ?>
View File
+11
View File
@@ -0,0 +1,11 @@
{
"name": "herwigbirke/tvguide",
"description": "Self-hosted electronic TV guide based on XMLTV data.",
"type": "project",
"autoload": {
"psr-4": {
"TVGuide\\": "app/src/"
}
},
"require": {}
}
+2 -1
View File
@@ -1,6 +1,6 @@
services:
tvguide:
image: php:8.4-apache
build: .
container_name: tvguide
restart: unless-stopped
ports:
@@ -11,6 +11,7 @@ services:
- ./app/templates:/var/www/templates
- ./app/config:/var/www/config
- ./app/cache:/var/www/cache
- ./vendor:/var/www/vendor
- ./epg:/var/www/epg
- ./logos:/var/www/html/logos
- ./posters:/var/www/html/posters