-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.php
47 lines (39 loc) · 1.38 KB
/
build.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
$YEAR = 2023;
function make_regular_year($year): string
{
return strval($year - 1) . '-12 ' . strval($year + 1) . '-3';
}
function make_school_year($year): string
{
return strval($year) . '-7 ' . strval($year + 1) . '-10';
}
$languages = ['en'];
$option_names = [
['sunday', 'monday'],
['lined', 'dot'],
['200', '40'],
['24hr', '12hr'],
['day', 'night'],
];
foreach ($languages as $lang) {
for ($i = 0; $i < 1 << 5; $i ++) {
if (($i & 1) === 1 || ($i >> 1 & 1) === 1 || ($i >> 2 & 1) === 1) {
// Only do more common config
continue;
}
$options = sprintf("%05b", $i);
$name = [];
for ($j = 0; $j < 5; $j++) {
$name[] = $option_names[$j][intval($options[$j])];
}
// $filename = 'Planner.' . implode('.', $name) . '.school-' . strval($YEAR) . '.' . $lang . '.pdf';
// $cmd = 'php make-planner.php ' . $lang . ' ' . $options . ' ' . make_school_year($YEAR) . ' "Planner" "School-' . strval($YEAR) . '" ' . $filename;
// echo $cmd, "\n";
// system($cmd);
$filename = 'Planner.' . implode('.', $name) . '.' . strval($YEAR) . '.' . $lang . '.pdf';
$cmd = 'php make-planner.php ' . $lang . ' ' . $options . ' ' . make_regular_year($YEAR) . ' "Planner" "' . strval($YEAR) . '" ' . $filename;
echo $cmd, "\n";
system($cmd);
}
}