fuc-new/vendor/illuminate/database/Concerns/ParsesSearchPath.php
hellcat 1fe8673f62 1
2025-10-01 13:34:29 +08:00

26 lines
578 B
PHP
Executable File

<?php
namespace Illuminate\Database\Concerns;
trait ParsesSearchPath
{
/**
* Parse the Postgres "search_path" configuration value into an array.
*
* @param string|array|null $searchPath
* @return array
*/
protected function parseSearchPath($searchPath)
{
if (is_string($searchPath)) {
preg_match_all('/[^\s,"\']+/', $searchPath, $matches);
$searchPath = $matches[0];
}
return array_map(function ($schema) {
return trim($schema, '\'"');
}, $searchPath ?? []);
}
}