Conditions | 7 |
Paths | 24 |
Total Lines | 38 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 7.0119 |
Changes | 0 |
1 | <?php |
||
13 | 45 | public function run(Client $client, Filesystem $fs) |
|
14 | { |
||
15 | 45 | $space = $client->getSpace('_vspace'); |
|
16 | |||
17 | 45 | $client->evaluate(" |
|
18 | if box.space._queue ~= nil then |
||
19 | if queue == nil then |
||
20 | queue = require('queue') |
||
21 | end |
||
22 | for i, q in box.space._queue:pairs() do |
||
23 | queue.tube[q.tube_name]:drop() |
||
24 | end |
||
25 | end |
||
26 | "); |
||
27 | |||
28 | 45 | $data = $space->select(Criteria::key([])); |
|
29 | |||
30 | 45 | foreach ($data as $row) { |
|
31 | 45 | if ($row[0] >= 512) { |
|
32 | // user space |
||
33 | 45 | if (strpos($row[2], '_queue') === false) { |
|
34 | 45 | $client->evaluate('box.space.'.$row[2].':drop()'); |
|
35 | } |
||
36 | } |
||
37 | } |
||
38 | |||
39 | 45 | $schema = $client->getSpace('_schema')->select(Criteria::key([])); |
|
40 | 45 | foreach ($schema as $tuple) { |
|
41 | 45 | if (strpos($tuple[0], 'mapper-once') === 0) { |
|
42 | 10 | $client->getSpace('_schema')->delete([$tuple[0]]); |
|
43 | } |
||
44 | } |
||
45 | |||
46 | 45 | $filename = $fs->getPath('.cache/mapper-meta.php'); |
|
47 | 45 | if (file_exists($filename)) { |
|
48 | unlink($filename); |
||
49 | } |
||
50 | 45 | } |
|
51 | } |
||
52 |