Bolt\Controller\Backend\Extend::update PHP Method

update() public method

Update a package(s).
public update ( Request $request ) : Symfony\Component\HttpFoundation\JsonResponse
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\JsonResponse
    public function update(Request $request)
    {
        $package = $request->get('package') ? $request->get('package') : null;
        $update = $package ? [$package] : [];
        try {
            $response = $this->app['extend.manager']->updatePackage($update);
        } catch (\Exception $e) {
            return $this->getJsonException($e);
        }
        if ($response === 0) {
            $this->app['logger.system']->info("Updated {$package}", ['event' => 'extensions']);
            return $this->json($this->manager()->getOutput());
        }
        return $this->getJsonException(new PackageManagerException($this->manager()->getOutput(), $response));
    }