Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function safeUp() |
||
20 | { |
||
21 | // set forceConnect setting to true |
||
22 | $row = (new Query()) |
||
23 | ->select('*') |
||
24 | ->from(['{{%plugins}}']) |
||
25 | ->where(['handle' => 'analytics']) |
||
26 | ->one(); |
||
27 | |||
28 | if ($row) { |
||
29 | $settingsJson = $row['settings']; |
||
30 | |||
31 | $settings = Json::decode($settingsJson); |
||
32 | $settings['forceConnect'] = true; |
||
33 | |||
34 | $settingsJson = Json::encode($settings); |
||
35 | |||
36 | $this->update('{{%plugins}}', ['settings' => $settingsJson], ['id' => $row['id']]); |
||
37 | } |
||
38 | |||
39 | return true; |
||
40 | } |
||
52 |