| Conditions | 3 |
| Paths | 3 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function plugin_プラグインインストール(\AcceptanceTester $I) |
||
| 29 | { |
||
| 30 | $I->wantTo('プラグインインストール'); |
||
| 31 | |||
| 32 | foreach ($this->plugins as $num => $plugin) { |
||
| 33 | $OwnersPluginPage = OwnersPluginPage::go($I) |
||
| 34 | ->goInstall($I); |
||
| 35 | $datadir = __DIR__.'/../_data'; |
||
| 36 | |||
| 37 | if (file_exists($datadir.'/'.$plugin['file'])) { |
||
| 38 | unlink($datadir.'/'.$plugin['file']); |
||
| 39 | } |
||
| 40 | $I->amGoingTo($plugin['file'].' を '.$plugin['url'].' からダウンロードします.'); |
||
| 41 | $archive = file_get_contents($plugin['url']); |
||
| 42 | $save_path = $datadir.'/'.$plugin['file']; |
||
| 43 | file_put_contents($save_path, $archive); |
||
| 44 | $I->amGoingTo($plugin['file'].' を '.$save_path.' に保存しました.'); |
||
| 45 | |||
| 46 | $OwnersPluginPage->インストール($plugin['file']); |
||
| 47 | $I->see('プラグインをインストールしました。', OwnersPluginPage::$完了メッセージ); |
||
| 48 | |||
| 49 | // プラグイン有効化 |
||
| 50 | $OwnersPluginPage->有効にする($plugin['code']); |
||
| 51 | $I->see('プラグインを有効にしました。', OwnersPluginPage::$完了メッセージ); |
||
| 52 | } |
||
| 53 | } |
||
| 54 | } |
||
| 55 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.