exec('BEGIN;'); $db->exec(file_get_contents(__DIR__ . '/../schema.sql')); @session_start(); $users = new Users; $p = Users::generatePassword(); $users->create('demo', $p); $users->edit('demo', ['quota' => 10]); $_SESSION['install_password'] = $p; $users->login('demo', $p); $db->exec('END;'); } function get_directory_size(string $path): int { $total = 0; $path = rtrim($path, '/'); foreach (glob($path . '/*', GLOB_NOSORT) as $f) { if (is_dir($f)) { $total += get_directory_size($f); } else { $total += filesize($f); } } return $total; } function get_directory_mtime(string $path): int { $last = 0; $path = rtrim($path, '/'); foreach (glob($path . '/*', GLOB_NOSORT) as $f) { if (is_dir($f)) { $m = get_directory_mtime($f); if ($m > $last) { $last = $m; } } $m = filemtime($f); if ($m > $last) { $last = $m; } } return $last; } function html_head(string $title): void { $title = htmlspecialchars($title); echo << {$title}

{$title}

EOF; } function html_foot(): void { echo ' '; }