| 1 | <?php |
||
| 10 | class HostnameLocator implements TenantLocator |
||
| 11 | { |
||
| 12 | private $pattern = '#^(?P<tenant>.+?)\.(.*?)\.#'; |
||
| 13 | private $request; |
||
| 14 | |||
| 15 | public function __construct( Request $request ) |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @return string Tenant key |
||
| 22 | */ |
||
| 23 | public function getTenant() { |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Gets the REGEX pattern used to match a tenant |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | public function getPattern() |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Sets the REGEX pattern used to match a tenant |
||
| 45 | * @param string $pattern |
||
| 46 | * @return $this |
||
| 47 | */ |
||
| 48 | public function setPattern( $pattern ) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param Request $request |
||
| 57 | * @return string Tenant key |
||
| 58 | */ |
||
| 59 | public static function getTenantFromRequest(Request $request) { |
||
| 63 | } |
||
| 64 |