Completed
Push — 2.0 ( 82d9cb...93098a )
by Kirill
05:32
created

SphinxDaemon::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of laravel.su package.
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace App\Console\Commands;
11
12
use Carbon\Carbon;
13
use App\Models\Bot;
14
use App\Models\Article;
15
use Illuminate\Config\Repository;
16
use Illuminate\Console\Command;
17
use App\Services\DataProviders\Manager;
18
use App\Services\DataProviders\ExternalArticle;
19
use App\Services\DataProviders\DataProviderInterface;
20
use Illuminate\Database\Eloquent\Relations\MorphMany;
21
22
/**
23
 * Class SphinxDaemon.
24
 */
25
class SphinxDaemon extends Command
26
{
27
    /**
28
     * The name and signature of the console command.
29
     * @var string
30
     */
31
    protected $signature = 'sphinx:run';
32
33
    /**
34
     * The console command description.
35
     * @var string
36
     */
37
    protected $description = '';
38
39
    /**
40
     * @param Repository $conf
41
     */
42
    public function handle(Repository $conf)
43
    {
44
        $cmd = sprintf(
45
            '%s --config "%s"',
46
            $conf->get('sphinx.searchd'),
47
            $conf->get('sphinx.conf')
48
        );
49
50
        system($cmd);
51
    }
52
}
53