@ -10,3 +10,4 @@
* `cd crawler`
* `cp example/config.json config.json`
* `crontab -e`:`* * * * * php kvazar/crawler/src/index.php`
* drop index: `php kvazar/crawler/src/index.php drop`
@ -84,3 +84,27 @@ catch (Exception $exception)
)
);
}
// Init optional commands
if (isset($argv[1]))
{
switch ($argv[1])
// Drop index request
case 'drop':
$index->drop(
true
exit(
_('Index dropped!')
break;
// Begin crawler
// @TODO