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

14 lines
232 B
PHP

<?php
return function ($type) {
if ($type == 'up') {
DB::init();
$problems = DB::selectAll("select id from problems");
foreach ($problems as $id) {
mkdir(UOJContext::storagePath() . "/problem_resources/$id");
}
}
};