fwolf /
config.php
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Fwolf\Config; |
||
| 4 | |||
| 5 | /** |
||
| 6 | * Limit or check app running on server with preferred id |
||
| 7 | * |
||
| 8 | * @copyright Copyright 2013-2017 Fwolf |
||
| 9 | * @license https://opensource.org/licenses/MIT MIT |
||
| 10 | */ |
||
| 11 | class GlobalConfigWithCheckServerId extends GlobalConfig |
||
| 12 | { |
||
| 13 | use CheckServerIdTrait; |
||
| 14 | |||
| 15 | |||
| 16 | const KEY_SERVER_ID = 'server.id'; |
||
| 17 | |||
| 18 | |||
| 19 | /** |
||
| 20 | * @return string |
||
| 21 | */ |
||
| 22 | public function getServerId() |
||
| 23 | { |
||
| 24 | return $this->get(static::KEY_SERVER_ID); |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 25 | } |
||
| 26 | |||
| 27 | |||
| 28 | /** |
||
| 29 | * @param string|int $serverId |
||
| 30 | * @return $this |
||
| 31 | */ |
||
| 32 | public function setServerId($serverId) |
||
| 33 | { |
||
| 34 | $this->set(static::KEY_SERVER_ID, $serverId); |
||
| 35 | |||
| 36 | return $this; |
||
| 37 | } |
||
| 38 | } |
||
| 39 |