-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.php
26 lines (22 loc) · 900 Bytes
/
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
<?php
declare(strict_types=1);
namespace hexydec\ipaddresses;
require __DIR__.'/src/autoload.php';
// define files
$cache = \in_array('--cache', $argv ?? []) ? __DIR__.'/cache/' : null;
// create object and generate output
$files = [__DIR__.'/output/datacentres.csv', __DIR__.'/output/datacentres.txt', __DIR__.'/output/datacentres.json'];
$obj = new datacentres();
if (($count = $obj->save($files, $cache)) !== false) {
echo 'Saved '.$count.' Datacentre IP Ranges'."\n";
} else {
exit('Could not generate file: the output could not be written');
}
// create object and generate output
$files = [__DIR__.'/output/crawlers.csv', __DIR__.'/output/crawlers.txt', __DIR__.'/output/crawlers.json'];
$obj = new crawlers();
if (($count = $obj->save($files, $cache)) !== false) {
exit('Saved '.$count.' Crawler IP Ranges');
} else {
exit('Could not generate file: the output could not be written');
}