mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-06 12:38:41 +00:00
Pull out general functionality
This commit is contained in:
parent
9cdb79ca9b
commit
eac5fb4084
|
|
@ -69,8 +69,7 @@ final class ApiController extends Controller
|
|||
$ids[] = $file->getId();
|
||||
}
|
||||
|
||||
$response->getHeader()->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true);
|
||||
$response->set($request->getUri()->__toString(), $ids);
|
||||
$this->fillJsonRawResponse($request, $response, $ids);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -163,9 +162,15 @@ final class ApiController extends Controller
|
|||
|
||||
private static function normalizeDbPath(string $path) : string
|
||||
{
|
||||
$realpath = \realpath(__DIR__ . '/../../');
|
||||
|
||||
if ($realpath === false) {
|
||||
throw new \Exception();
|
||||
}
|
||||
|
||||
return \str_replace('\\', '/',
|
||||
\str_replace(realpath(__DIR__ . '/../../'), '',
|
||||
rtrim($path, '/')
|
||||
\str_replace($realpath, '',
|
||||
\rtrim($path, '/')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user