Bolt\Controller\Backend\Upload::processCustomUploadHandler PHP Метод

processCustomUploadHandler() приватный Метод

This handles the more advanced functionality where multiple upload handlers are provided. Only the first one is returned as a result, the result of this first upload is then attempted to copy to the remaining handlers.
private processCustomUploadHandler ( Request $request, array $handler ) : Symfony\Component\HttpFoundation\JsonResponse
$request Symfony\Component\HttpFoundation\Request
$handler array
Результат Symfony\Component\HttpFoundation\JsonResponse
    private function processCustomUploadHandler(Request $request, array $handler)
    {
        list($namespace, $prefix) = $this->parser($handler[0]);
        $this->app['upload.namespace'] = $namespace;
        $this->app['upload.prefix'] = $prefix;
        // Do the upload
        $fullResult = $this->handleUploadFiles($request, $namespace);
        array_shift($handler);
        $original = $namespace;
        if (count($fullResult)) {
            $result = $fullResult[0];
            foreach ($handler as $copy) {
                list($namespace, $prefix) = $this->parser($copy);
                $this->filesystem()->put($namespace . '://' . $prefix . basename($result['name']), $this->filesystem()->read($original . '://' . $result['name']));
            }
        }
        return $this->json($fullResult, Response::HTTP_OK, ['Content-Type' => 'text/plain']);
    }