public function packageInfo(Request $request)
    {
        $packageName = $request->get('package');
        $reqVersion = $request->get('version');

        try {
            $response = $this->manager()->showPackage('installed', $packageName, $reqVersion);
        } catch (\Exception $e) {
            return $this->getJsonException($e);
        }

        if (isset($response[$packageName]['package'])) {
            /** @var PackageInterface $package */
            $package = $response[$packageName]['package'];

            return $this->json([
                'name'    => $packageName,
                'version' => $package->getPrettyVersion(),
                'type'    => $package->getType(),
            ]);
        }

        return $this->getJsonException(new PackageManagerException(Trans::__('page.extend.message.package-install-info-fail', ['%PACKAGE%' => $packageName, '%VERSION%' => $reqVersion])));
    }
public function packageInfo(Request $request)
    {
        $packageName = $request->get('package');
        $reqVersion = $request->get('version');

        try {
            $response = $this->manager()->showPackage('installed', $packageName, $reqVersion);
        } catch (\Exception $e) {
            return $this->getJsonException($e);
        }

        if (isset($response[$packageName]['package'])) {
            /** @var PackageInterface $package */
            $package = $response[$packageName]['package'];

            return $this->json([
                'name'    => $packageName,
                'version' => $package->getPrettyVersion(),
                'type'    => $package->getType(),
            ]);
        }

        return $this->getJsonException(new PackageManagerException(Trans::__('page.extend.message.package-install-info-fail', ['%PACKAGE%' => $packageName, '%VERSION%' => $reqVersion])));
    }
public function packageInfo ( Request $ request ) { $ packageName = $ request -> get ( 'package' ) ; $ reqVersion = $ request -> get ( 'version' ) ; try { $ response = $ this -> manager ( ) -> showPackage ( 'installed' , $ packageName , $ reqVersion ) ; } catch ( \ Exception $ e ) { return $ this -> getJsonException ( $ e ) ; } if ( isset ( $ response [ $ packageName ] [ 'package' ] ) ) { /** @var PackageInterface $package */ $ package = $ response [ $ packageName ] [ 'package' ] ; return $ this -> json ( [ 'name' => $ packageName , 'version' => $ package -> getPrettyVersion ( ) , 'type' => $ package -> getType ( ) , ] ) ; } return $ this -> getJsonException ( new PackageManagerException ( Trans :: __ ( 'page.extend.message.package-install-info-fail' , [ '%PACKAGE%' => $ packageName , '%VERSION%' => $ reqVersion ] ) ) ) ; }
Show installed packages.

@param Request $request

@throws PackageManagerException]

@return \Symfony\Component\HttpFoundation\JsonResponse
Show installed packages .