Handles PATCH actions.

@return \DreamFactory\Core\Utility\ServiceResponse
763930
protected function handlePATCH()
    {
        $content = $this->getPayloadData();
        if (empty($this->folderPath)) {
            // update container properties
            $this->driver->updateContainerProperties($this->container, $content);
        } else {
            if (empty($this->filePath)) {
                // update folder properties
                $this->driver->updateFolderProperties($this->container, $this->folderPath, $content);
            } else {
                // update file properties?
                $this->driver->updateFileProperties($this->container, $this->filePath, $content);
            }
        }

        return ResponseFactory::create(['success' => true]);
    }
1295084
private function handle(){
        $params = [
            "start"     => null,
            "finish"    => null,
            "response"  => null,
            "error"     => null,
        ];

        try{
            $params["start"]    = microtime(true);
            $params["response"] = $this->handler->handle($this->request);
        }catch(\Throwable $e){
            $params["error"]    = $e;
            $this->error        = $e;
        }finally{
            $params["finish"]   = microtime(true);
        }

        $this->event(new Event("response.handle.after", $params));

        return $params["response"];
    }
1037929
public function indexAction()
	{
		$resource = null;

		if( $this->request->hasArgument( 'resource' )
			&& ( $value = $this->request->getArgument( 'resource' ) ) != ''
		) {
			$resource = $value;
		}

		switch( $this->request->getMethod() )
		{
			case 'DELETE': return $this->deleteAction( $resource );
			case 'PATCH': return $this->patchAction( $resource );
			case 'POST': return $this->postAction( $resource );
			case 'PUT': return $this->putAction( $resource );
			case 'GET': return $this->getAction( $resource );
			default: return $this->optionsAction( $resource );
		}
	}
500975
public function handler(): Response
    {
        $mailer = new Mailer([
            'driver' => 'smtp',
            'host' => 'host',
            'port' => 0,
            'encryption' => '',
            'username' => 'username',
            'password' => 'password',
            'sender' => 'sender',
            'remark' => ''
        ]);
        if (Mailer::count() === 0) {
            $mailer->default(true);
        }
        $mailer->save();
        $this->log('info', 'Create a mailer [' . $mailer->getSender() . ']');
        return response([
            'id' => $mailer->getId()
        ]);
    }
1161387
public function treat()
    {
        if (!$this->isTreated) {
            $this->initFetchValues();
            $this->isTreated = TRUE;
            if ($this->isActive()) {
                $this->validFetchValues();
            }
        }
        return $this;
    }
1229063
public function response()
    {
        return new MultiErrorResponse($this->httpStatusCode, $this->code, $this->message, $this->validationMessages);
    }
884938
public function handler(): Response
    {
        $bulletin = (new Bulletin())
            ->title(date('Ymd', time()) . '公告')
            ->content('全体 ' . Config::get('name') . ' 成员:')
            ->save();
        $this->log('info', 'Create a bulletin [' . $bulletin->getId() . ']');
        return response([
            'id' => $bulletin->getId()
        ]);
    }
1287375
public function releasePatch()
    {
        $execution = $this->taskExecStack()
                          ->stopOnFail()
                          ->exec(
                              '"./vendor/bin/robo" git:stash "release-patch-'
                              . (new \DateTime)->format(\DateTime::ISO8601) . '"'
                          )
                          ->exec('"./vendor/bin/robo" lint')
                          ->exec('"./vendor/bin/robo" test')
                          ->exec('"./vendor/bin/robo" git:stash-pop')
                          ->exec('"./vendor/bin/robo" bump:patch')
                          ->exec('"./vendor/bin/robo" bump:commit')
                          ->exec('"./vendor/bin/robo" git:push-master')
                          ->run();

        if (!$execution->wasSuccessful()) {
            $this->io()->error('PATCH RELEASE FAILED!');
            $this->_exec('"./vendor/bin/robo" git:stash-pop');
        }

        return $execution;
    }
1049454
protected function addHtaccessPatch() {
    $this->taskFilesystemStack()
      ->copy($this->bltRoot . "/scripts/simplesamlphp/htaccess-saml.patch",
        $this->repoRoot . "/patches/htaccess-saml.patch")
      ->run();
    $composer_json = json_decode(file_get_contents($this->getConfigValue('repo.root') . '/composer.json'));
    $composer_json->scripts->{"post-drupal-scaffold-cmd"}[] = "cd docroot && patch -p1 <../patches/htaccess-saml.patch";
    file_put_contents($this->getConfigValue('repo.root') . '/composer.json',
      json_encode($composer_json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
    $this->taskExecStack()
      ->dir($this->getConfigValue('repo.roou'))
      ->exec("composer post-drupal-scaffold-cmd")
      ->run();
    // @todo throw exceptions.
  }
1253926
public function handleRequest()
    {
        try {
            $this->response = parent::handleRequest();
        } catch (HttpException $ex) {
            $this->config->set('page_title', 'Error');

            $view = new View('exception');
            $view->exception = $ex;

            $this->response->setResponseCode($ex->getErrorCode());
            $this->response->setContent($view->render());
        } catch (\Exception $ex) {
            $this->config->set('page_title', 'Error');

            $view = new View('exception');
            $view->exception = $ex;

            $this->response->setResponseCode(500);
            $this->response->setContent($view->render());
        }

        if ($this->response->hasLayout() && $this->controller->layout) {
            $this->setLayoutVariables($this->controller->layout);

            $this->controller->layout->content  = $this->response->getContent();
            $this->response->setContent($this->controller->layout->render());
        }

        return $this->response;
    }
141220
public function execute()
    {
        $this->_setOptions();

        $response = $this->_execute();
        $this->_saveStatusCode();

        $curlErrorNumber = $this->_getErrorNumber();

        $this->_close();

        if ($curlErrorNumber) {
            /**
             * @var \OxidEsales\Eshop\Core\Exception\StandardException $exception
             */
            $exception = oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class);
            $lang = \OxidEsales\Eshop\Core\Registry::getLang();
            $exception->setMessage(sprintf($lang->translateString('EXCEPTION_CURL_ERROR', $lang->getTplLanguage()), $curlErrorNumber));
            throw $exception;
        }

        return $response;
    }
1060108
public function patch($service, $headers = [], $body = '', $form_params = [])
    {
        return $this->callRestService('PATCH', $service, $headers, $body, $form_params);
    }
458338
public function patchAction( $resource )
	{
		$response = $this->createAdmin( $resource )->patch( $this->getPsrRequest(), new Response() );
		return $this->setPsrResponse( $response );
	}
417820
public function onCheckForUpdates()
    {
        try {
            $manager = UpdateManager::instance();
            $result = $manager->requestUpdateList();

            $result = $this->processUpdateLists($result);
            $result = $this->processImportantUpdates($result);

            $this->vars['core'] = array_get($result, 'core', false);
            $this->vars['hasUpdates'] = array_get($result, 'hasUpdates', false);
            $this->vars['hasImportantUpdates'] = array_get($result, 'hasImportantUpdates', false);
            $this->vars['pluginList'] = array_get($result, 'plugins', []);
            $this->vars['themeList'] = array_get($result, 'themes', []);
        }
        catch (Exception $ex) {
            $this->handleError($ex);
        }

        return ['#updateContainer' => $this->makePartial('update_list')];
    }
925913
public function handleRequest(): self
    {
        if ($this->params->getBotParam('webhook.url')) {
            return $this->handleWebhook();
        }

        if ($loop_time = $this->getLoopTime()) {
            return $this->handleGetUpdatesLoop($loop_time, $this->getLoopInterval());
        }

        return $this->handleGetUpdates();
    }
554824
public function update()
    {
        $result = $this->connection()->patch($this->getEndpoint() . '/' . urlencode($this->id), $this->jsonWithNamespace());
        if ($result === 200) {
            return true;
        }

        return $this->selfFromResponse($result);
    }
811847
public function processUpdateAction()
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth($this->resourceCode, $this->getModuleCode(), AccessManager::UPDATE)) {
            return $response;
        }

        // Error (Default: false)
        $error_msg = false;

        // Create the Form from the request
        $changeForm = $this->getUpdateForm($this->getRequest());

        try {
            // Check the form against constraints violations
            $form = $this->validateForm($changeForm, "POST");

            // Get the form field values
            $data = $form->getData();

            // Create a new event object with the modified fields
            $changeEvent = $this->getUpdateEvent($data);
            $changeEvent->bindForm($form);

            // Dispatch Update Event
            $this->dispatch($this->updateEventIdentifier, $changeEvent);

            // Check if object exist
            if (! $this->eventContainsObject($changeEvent)) {
                throw new \LogicException(
                    $this->getTranslator()->trans("No %obj was updated.", ['%obj' => $this->objectName])
                );
            }

            // Log object modification
            if (null !== $changedObject = $this->getObjectFromEvent($changeEvent)) {
                $this->adminLogAppend(
                    $this->resourceCode,
                    AccessManager::UPDATE,
                    sprintf(
                        "%s %s (ID %s) modified",
                        ucfirst($this->objectName),
                        $this->getObjectLabel($changedObject),
                        $this->getObjectId($changedObject)
                    ),
                    $this->getObjectId($changedObject)
                );
            }

            // Execute additional Action
            $response = $this->performAdditionalUpdateAction($changeEvent);

            if ($response == null) {
                // If we have to stay on the same page, do not redirect to the successUrl,
                // just redirect to the edit page again.
                if ($this->getRequest()->get('save_mode') == 'stay') {
                    return $this->redirectToEditionTemplate($this->getRequest());
                }

                // Redirect to the success URL
                return $this->generateSuccessRedirect($changeForm);
            } else {
                return $response;
            }
        } catch (FormValidationException $ex) {
            // Form cannot be validated
            $error_msg = $this->createStandardFormValidationErrorMessage($ex);
        } catch (\Exception $ex) {
            // Any other error
            $error_msg = $ex->getMessage();
        }

        if (false !== $error_msg) {
            // At this point, the form has errors, and should be redisplayed.
            $this->setupFormErrorContext(
                $this->getTranslator()->trans("%obj modification", ['%obj' => $this->objectName]),
                $error_msg,
                $changeForm,
                $ex
            );

            return $this->renderEditionTemplate();
        }
    }