| Conditions | 4 |
| Paths | 6 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types = 1); |
||
| 27 | public function run(\SilverStripe\Control\HTTPRequest $request) |
||
| 28 | { |
||
| 29 | // check this script is being run by admin |
||
| 30 | $canAccess = (Director::isDev() || Director::is_cli() || Permission::check("ADMIN")); |
||
| 31 | if (!$canAccess) { |
||
| 32 | return Security::permissionFailure($this); |
||
| 33 | } |
||
| 34 | |||
| 35 | $name = $request->param('index'); |
||
| 36 | |||
| 37 | $factory = new IndexCreatorFactory(); |
||
| 38 | $indexCreator = $factory->getIndexCreator(); |
||
| 39 | |||
| 40 | // @todo Does the index need dropped prior to re-creation? |
||
| 41 | $indexCreator->createIndex($name); |
||
| 42 | } |
||
| 44 |