BuildsQueries.php
3 weeks ago
CompilesJsonPaths.php
3 weeks ago
ExplainsQueries.php
2 years ago
ManagesTransactions.php
3 weeks ago
ParsesSearchPath.php
3 weeks ago
ParsesSearchPath.php
25 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWPSCOPED\Illuminate\Database\Concerns; |
| 4 | |
| 5 | /** @internal */ |
| 6 | trait ParsesSearchPath |
| 7 | { |
| 8 | /** |
| 9 | * Parse the Postgres "search_path" configuration value into an array. |
| 10 | * |
| 11 | * @param string|array|null $searchPath |
| 12 | * @return array |
| 13 | */ |
| 14 | protected function parseSearchPath($searchPath) |
| 15 | { |
| 16 | if (\is_string($searchPath)) { |
| 17 | \preg_match_all('/[^\\s,"\']+/', $searchPath, $matches); |
| 18 | $searchPath = $matches[0]; |
| 19 | } |
| 20 | return \array_map(function ($schema) { |
| 21 | return \trim($schema, '\'"'); |
| 22 | }, $searchPath ?? []); |
| 23 | } |
| 24 | } |
| 25 |