S2OJ/web/app/upgrade/31_problem_resources/upgrade.php

14 lines
242 B
PHP
Raw Normal View History

2023-01-30 10:53:20 +00:00
<?php
return function ($type) {
if ($type == 'up') {
DB::init();
$problems = DB::selectAll("select id from problems");
foreach ($problems as $row) {
mkdir(UOJContext::storagePath() . "/problem_resources/{$row['id']}");
2023-01-30 10:53:20 +00:00
}
}
};