-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.php
44 lines (35 loc) · 1.26 KB
/
test.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
<?php
use App\Service\Lexicon\Word;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use function Thermage\render;
use function Thermage\div;
use function Thermage\breakline;
require_once __DIR__. '/vendor/autoload.php';
require_once __DIR__. '/app/helpers.php';
$args = $_SERVER['argv'];
array_shift($args);
//$lexiconService = new \App\Service\Lexicon\LexiconService();
//$lexicons = $lexiconService->getAll();
$dg = new \App\Service\Lexicon\Data\DrawNGuess();
$lexicons = \App\Service\Lexicon\Data\DrawNGuess::load();
foreach ($lexicons as $lexicon) {
$word4 = collect($lexicon->getPlainWords())->shuffle()->take(4)->implode(',');
vlog("{$lexicon->name}: ID:{$lexicon->uniqueId}, 作者:{$lexicon->author}, 任意4词:{$word4}");
}
//$infos = \App\Service\Lexicon\Data\DrawNGuess::reqGetList('游戏王');
//foreach ($infos as $info) {
// var_dump($info->getId() . ' ' . $info->getName());
//}
//
//$target = \App\Service\Lexicon\Data\DrawNGuess::reqGetLib('DJQXAO5DDC');
//if ($target) {
// var_dump($target->getCreatedAt());
// var_dump($target->getUpdatedAt());
// $words = [];
// foreach ($target->getWords() as $word) {
// $words[] = $word;
// }
// $wordsAfter = array_slice($words, 0, 10);
// var_dump($wordsAfter);
//}