mirror of
https://github.com/kvazar-network/crawler.git
synced 2025-02-02 02:04:30 +00:00
add drop index argument
This commit is contained in:
parent
47b1cad89a
commit
6a2ebab6f5
@ -9,4 +9,5 @@
|
|||||||
* `composer create-project kvazar/crawler crawler`
|
* `composer create-project kvazar/crawler crawler`
|
||||||
* `cd crawler`
|
* `cd crawler`
|
||||||
* `cp example/config.json config.json`
|
* `cp example/config.json config.json`
|
||||||
* `crontab -e`:`* * * * * php kvazar/crawler/src/index.php`
|
* `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
|
Loading…
x
Reference in New Issue
Block a user