Skip to content

Commit 13a6771

Browse files
committed
Add autoload.php for EaseTWB4 library autoloading
1 parent 711dfd6 commit 13a6771

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

debian/autoload.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
// autoload.php for EaseTWB4
3+
4+
// Register the autoloader for the EaseTWB4 library
5+
spl_autoload_register(function ($class) {
6+
// Only autoload classes from the Ease namespace
7+
if (strpos($class, 'Ease\\') === 0) {
8+
$baseDir = __DIR__ . '/Ease/';
9+
$relativeClass = substr($class, strlen('Ease\\'));
10+
$file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php';
11+
if (file_exists($file)) {
12+
require $file;
13+
}
14+
}
15+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
src/Ease/TWB4/* usr/share/php/EaseTWB4/
22
debian/composer.json usr/share/php/EaseTWB4/
3+
debian/autoload.php usr/share/php/EaseTWB4/

0 commit comments

Comments
 (0)