abort example

#[Route(path: '/api/_action/import-export/cancel', name: 'api.action.import_export.cancel', methods: ['POST'])]     public function cancel(Request $request, Context $context): Response
    {
        $logId = $request->request->get('logId');

        if (!\is_string($logId)) {
            throw RoutingException::invalidRequestParameter('logId');
        }

        $this->importExportService->cancel($context$logId);
        $this->importExportFactory->create($logId)->abort();

        return new Response('', Response::HTTP_NO_CONTENT);
    }

    #[Route(path: '/api/_action/import-export/prepare-template-file-download', name: 'api.action.import_export.template_file.prepare_download', methods: ['POST'])]     public function prepareTemplateFileDownload(Request $request, Context $context): Response
    {
        $profileId = $request->query->get('profileId');
        if (!\is_string($profileId)) {
            throw RoutingException::invalidRequestParameter('profileId');
        }
        


    function is_exists($pathname) {
        return $this->file_exists($pathname);
    }

    function file_exists($pathname) {
        $exists=true;
        if(!$this->_exec("RNFR ".$pathname, "rename")) $exists=FALSE;
        else {
            if(!$this->_checkCode()) $exists=FALSE;
            $this->abort();
        }
        if($exists) $this->SendMSG("Remote file ".$pathname." exists");
        else $this->SendMSG("Remote file ".$pathname." does not exist");
        return $exists;
    }

    function fget($fp$remotefile$rest=0) {
        if($this->_can_restore and $rest!=0) fseek($fp$rest);
        $pi=pathinfo($remotefile);
        if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"])$this->AutoAsciiExt))) $mode=FTP_ASCII;
        else $mode=FTP_BINARY;
        
/** * @throws Exception */
    private function handleItem(array $item)
    {
        switch ($item['status']) {
            case 201:
                ++$this->success;
                break;
            case 400:
                if ($this->getStopOnError()) {
                    $this->abort($item);
                }
                ++$this->error;
                break;
            default:
                break;
        }

        ++$this->total;
    }

    private function reset()
    {
Home | Imprint | This part of the site doesn't use cookies.