Skip to content

Commit

Permalink
autoload out
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgramComputer committed Jan 9, 2024
1 parent 8acf40b commit 040ef3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions inc/database_connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
function customAutoloader($className) {
// Check if the class belongs to your specific package
if (strpos($className, 'Done\\Subtitles\\') === 0) {
$className = preg_replace('/^Done\\\\Subtitles\\\\/', '', $className);
// Convert namespace separators to directory separators
$classFile = str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';

// Build the full path to the class file
$filePath = __DIR__ . '/../vendor/mantas-done/subtitles/src' . $classFile;

$filePath = __DIR__ . '/../vendor/mantas-done/subtitles/src/' . $classFile;
// Include the class file if it exists
if (file_exists($filePath)) {
require_once $filePath;
}
}

}

// Register your custom autoloader
spl_autoload_register('customAutoloader');
require_once __DIR__ . "/kernel_utility.php";
Expand Down Expand Up @@ -1616,7 +1616,7 @@ function splitCheckText($text, $lid, $id)

try {
//TRY and see if file has timed text
$subtitles = Subtitles::loadFromString(get_first_value(
$subtitles = \Done\Subtitles\Subtitles::loadFromString(get_first_value(
'SELECT TxText AS value FROM ' . $tbpref . 'texts
WHERE TxID = ' . $id
));
Expand Down

0 comments on commit 040ef3b

Please sign in to comment.