<?php pathinfo(string $path, int $flags = PATHINFO_ALL): array|string
<?php protected function fileIsServable(string $publicPath, string $pathToFile): bool { return $pathToFile && ! in_array(pathinfo($pathToFile, PATHINFO_EXTENSION), ['php', 'htaccess', 'config']) && str_starts_with($pathToFile, $publicPath) && is_file($pathToFile); }
<?php $publicPath = $context->publicPath; $swooleResponse->status(200); $swooleResponse->header('Content-Type', MimeType::get(pathinfo($request->path(), PATHINFO_EXTENSION))); $swooleResponse->sendfile(realpath($publicPath.'/'.$request->path())); }