feat: add videodb media index with Docker stack
- Add videodb PHP/MySQL media collection manager (Blu-ray, DVD, CD) - Dockerfile: PHP 8.1 + Apache with GD/mysqli/exif extensions - docker-compose.yml: app on port 6761 + MySQL 8.0 with health checks - docker-entrypoint.sh: auto-generates config.inc.php from env vars, waits for MySQL, initializes DB schema idempotently - init-db.php: CLI schema installer using app's own prefix_query() logic - Persistent volumes for DB, cache, and cover images Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
71
videodb/test/index.php
Normal file
71
videodb/test/index.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
// move out of contrib for includes
|
||||
chdir('..');
|
||||
|
||||
require_once './core/functions.php';
|
||||
|
||||
if (version_compare(phpversion(), '5.3') >= 0)
|
||||
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
|
||||
else
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
|
||||
localnet_or_die();
|
||||
permission_or_die(PERM_ADMIN);
|
||||
|
||||
if (!defined('SIMPLE_TEST')) define('SIMPLE_TEST', './test/simpletest/');
|
||||
|
||||
require_once(SIMPLE_TEST . 'unit_tester.php');
|
||||
require_once(SIMPLE_TEST . 'reporter.php');
|
||||
|
||||
function findTestCases($dir, $pattern=null)
|
||||
{
|
||||
$res = array();
|
||||
|
||||
if ($dh = @opendir($dir))
|
||||
{
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if (preg_match("/^test_(.+)\.php$/", $file, $matches))
|
||||
{
|
||||
if ($pattern && (stristr($file, $pattern) == false)) continue;
|
||||
|
||||
$res[$matches[1]] = $dir.'/'.$file;
|
||||
// get meta data
|
||||
# require_once($dir.'/'.$file);
|
||||
/*
|
||||
$func = $engine.'Meta';
|
||||
|
||||
if (function_exists($func))
|
||||
{
|
||||
$engines[$engine] = $func();
|
||||
|
||||
// required php version present?
|
||||
if ($engines[$engine]['php'] && (version_compare(phpversion(), $engines[$engine]['php']) < 0))
|
||||
{
|
||||
unset($engines[$engine]);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
$res = findTestCases('./test', $_REQUEST['test']);
|
||||
|
||||
echo "Starting tests.<br/>";
|
||||
|
||||
foreach ($res as $case => $file)
|
||||
{
|
||||
$test = new TestSuite($case);
|
||||
$test->addFile($file);
|
||||
$test->run(new HtmlReporter('utf-8'));
|
||||
}
|
||||
|
||||
echo "<br/>All tests completed.<br/>";
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user