Conditions | 3 |
Paths | 3 |
Total Lines | 25 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
42 | public function handle() |
||
43 | { |
||
44 | $gf = GamesFile::all(); |
||
45 | $i = 0; |
||
46 | $content = ''; |
||
47 | |||
48 | $doc_root = './public'; |
||
49 | echo $doc_root; |
||
50 | |||
51 | $content = 'Missing Gamefiles:'.PHP_EOL; |
||
52 | $content .= 'Created at: '.Carbon::now()->toDateTimeString().PHP_EOL; |
||
53 | $content .= '----------------------------------------------------------------'.PHP_EOL; |
||
54 | $content .= 'No., Title, Subtitle, Developer, Engine, RMAGameID, Version, Uploader'.PHP_EOL; |
||
55 | |||
56 | foreach ($gf as $g) { |
||
57 | $filepath = storage_path('app/public/'.$g->filename); |
||
58 | if (! file_exists($filepath)) { |
||
59 | $i += 1; |
||
60 | $dev = GamesDeveloper::whereGameId($g->id)->first(); |
||
61 | $content .= $i.' - '.$g->game->title.' - '.$g->game->subtitle.' - '.$g->game_id.' - '.$g->game->maker->short.' - '.$g->filename.' - '.$g->release_version.' - '.$g->user->name.PHP_EOL; |
||
62 | } |
||
63 | } |
||
64 | |||
65 | file_put_contents($doc_root.'/missfiles.txt', $content); |
||
66 | } |
||
67 | } |
||
68 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.