|
|
@ -1,9 +1,28 @@ |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Prevent multi-thread execution |
|
|
|
|
|
|
|
$semaphore = sem_get( |
|
|
|
|
|
|
|
crc32(__DIR__), 1 |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (false === sem_acquire($semaphore, true)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
exit( |
|
|
|
|
|
|
|
_('Process locked by another thread!') |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Load dependencies |
|
|
|
// Load dependencies |
|
|
|
require_once __DIR__ . '/../vendor/autoload.php'; |
|
|
|
require_once __DIR__ . '/../vendor/autoload.php'; |
|
|
|
|
|
|
|
|
|
|
|
// Init config |
|
|
|
// Init config |
|
|
|
|
|
|
|
if (!file_exists(__DIR__ . '/../config.json')) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
exit( |
|
|
|
|
|
|
|
_('Config not found!') |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$config = json_decode( |
|
|
|
$config = json_decode( |
|
|
|
file_get_contents( |
|
|
|
file_get_contents( |
|
|
|
__DIR__ . '/../config.json' |
|
|
|
__DIR__ . '/../config.json' |
|
|
@ -11,9 +30,44 @@ $config = json_decode( |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Init index |
|
|
|
// Init index |
|
|
|
$index = new \Kvazar\Index\Manticore( |
|
|
|
try |
|
|
|
(string) $config->index->name, |
|
|
|
{ |
|
|
|
(array) $config->index->meta, |
|
|
|
$index = new \Kvazar\Index\Manticore( |
|
|
|
(string) $config->index->host, |
|
|
|
(string) $config->manticore->name, |
|
|
|
(int) $config->index->port |
|
|
|
(array) $config->manticore->meta, |
|
|
|
); |
|
|
|
(string) $config->manticore->host, |
|
|
|
|
|
|
|
(int) $config->manticore->port |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
catch (Exception $exception) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
exit( |
|
|
|
|
|
|
|
print_r( |
|
|
|
|
|
|
|
$exception, |
|
|
|
|
|
|
|
true |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Init kevacoin |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$kevacoin = new \Kevachat\Kevacoin\Client( |
|
|
|
|
|
|
|
(string) $config->kevacoin->protocol, |
|
|
|
|
|
|
|
(string) $config->kevacoin->host, |
|
|
|
|
|
|
|
(int) $config->kevacoin->port, |
|
|
|
|
|
|
|
(string) $config->kevacoin->username, |
|
|
|
|
|
|
|
(string) $config->kevacoin->password |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
catch (Exception $exception) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
exit( |
|
|
|
|
|
|
|
print_r( |
|
|
|
|
|
|
|
$exception, |
|
|
|
|
|
|
|
true |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|