Find "depends" package dependencies.

@param Request $request

@return JsonResponse
346175
public function dependsPackage(Request $request)
    {
        $package = $request->get('needle');
        $constraint = $request->get('constraint', '*');

        try {
            $response = $this->manager()->dependsPackage($package, $constraint);
        } catch (\Exception $e) {
            return $this->getJsonException($e);
        }

        return $this->json($response);
    }
307655
public function detectScope(Request $request){

        $firstSegment = $this->getFirstSegment($request);

        try {
            return $this->repository->getByPathPrefix($firstSegment);
        } catch(OutOfBoundsException $e) {}

        try {
            return $this->repository->get(TreeScope::DEFAULT_NAME);
        } catch(OutOfBoundsException $e) {
            return new TreeScope;
        }

    }
285770
private function resolveRequest(Request $request = null)
    {
        if (null === $request) {
            return $this->get('request_stack')->getCurrentRequest();
        }

        return $request;
    }
1080998
public function whatYouWantAction(Request $request)
    {
        // app already installed
        if ($this->container->getParameter('anime_db.catalog.installed')) {
            return $this->redirect($this->generateUrl('home'));
        }

        $response = $this->getCacheTimeKeeper()->getResponse();
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        if ($request->isMethod('POST')) {
            $storage = $this->getRepository()->getLast();
            $this->get('event_dispatcher')->dispatch(StoreEvents::INSTALL_SAMPLES, new SamplesInstall($storage));

            return $this->redirect($this->generateUrl('install_end_skip', ['from' => 'install_sample']));
        }

        return $this->render('AnimeDbCatalogBundle:Install:what_you_want.html.twig', [
            'guide' => $this->get('anime_db.api.client')->getSiteUrl(self::GUIDE_LINK_SCAN),
        ], $response);
    }
1337432
public function lookup(Request $request)
    {
        $cacheKey = $this->getCacheKey($request);

        $item = $this->cache->getItem($cacheKey);

        if (!$item->isHit()) {
            return null;
        }

        $entries = $item->get();

        foreach ($entries as $varyKeyResponse => $responseData) {
            // This can only happen if one entry only
            if (self::NON_VARYING_KEY === $varyKeyResponse) {
                return $this->restoreResponse($responseData);
            }

            // Otherwise we have to see if Vary headers match
            $varyKeyRequest = $this->getVaryKey(
                $responseData['vary'],
                $request
            );

            if ($varyKeyRequest === $varyKeyResponse) {
                return $this->restoreResponse($responseData);
            }
        }

        return null;
    }
303655
public static function checkPlatformDependencies($dependencies) {
        if (is_array($dependencies)) {
            foreach ($dependencies as $depName => $depRequire) {
                switch ($depName) {
                    case 'php':
                        if (self::satisfies(PHP_VERSION, $depRequire)) {
                            unset($dependencies[$depName]);
                        }
                        break;
                    default:
                        break;
                }
            }
        }
        return $dependencies;
    }
759020
protected function resolveValidator(Request $request)
    {
        if (! isset($this->validators[$request->getHandler()])) {
            return null;
        }

        try {
            $validatorClass = $this->validators[$request->getHandler()];
            return $this->container->make($validatorClass);
        } catch (BindingResolutionException $e) {
            return null;
        }
    }
22901
public function getFilters(Request $request): Request
    {
        // check for exist filters in request and get filters
        if (isset($request['filters'])) {
            $filters = json_decode($request['filters'], true);
        } else {
            $filters = [];
        }

        $request[$this->getRequestTagName('filter')] = $filters;

        return $request;
    }
680775
public function listAction(Request $request)
    {
        $tid = $request->get('tid');
        $language = $request->get('language');
        $version = $request->get('version');
        $incoming = $request->get('incoming', false);

        $treeManager = $this->get('phlexible_tree.tree_manager');
        $elementService = $this->get('phlexible_element.element_service');
        $linkFetcher = $this->get('phlexible_element.link_fetcher');

        $tree = $treeManager->getByNodeId($tid);
        $node = $tree->get($tid);

        $element = $elementService->findElement($node->getTypeId());
        $elementVersion = $elementService->findElementVersion($element, $version);

        return new JsonResponse(['links' => $linkFetcher->fetch($elementVersion, $language, $incoming ? $node : null)]);
    }
186362
public function update(Request $request)
    {
        $package = $request->query->get('package');

        try {
            $response = $this->app['extend.manager']->updatePackage((array) $package);
        } 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));
    }
911823
public function getMapping(Request $request): array
    {
        return $this->cache->load($this->getCacheKey($request), function (&$dependencies) use ($request) {
            return $this->loadMapping($request->getPresenterName(), $request->getParameters(), $dependencies);
        });
    }
420820
public function search(Request $request)
    {
        $input = $request->all();

        $result = $this->repository->search($input);

        return view('cms::modules.files.index')
            ->with('files', $result[0]->get())
            ->with('pagination', $result[2])
            ->with('term', $result[1]);
    }
1243713
public function determineLocale(Request $request)
    {
        $locale = $this->determiners
            ->map(function ($determiner) use ($request) {
                return $determiner->determineLocale($request);
            })
            ->filter()
            ->first();

        return $locale ?: $this->fallback;
    }
364037
protected function getCallbackFromRequest(Request $request)
    {
        $response = new JsonResponse('');
        $response->setCallback($request->query->get(self::PARAMETER_CALLBACK));

        return $response->getCallback();
    }
4836
public function resolve(Request $request)
    {
        $request->databaseQueries = array_merge($request->databaseQueries, $this->getDatabaseQueries());

        return $request;
    }
1062730
function dependencyItems( $dependencySection, $parameters = false )
    {
        if ( !in_array( $dependencySection,
                        array( 'provides', 'requires',
                               'obsoletes', 'conflicts' ) ) )
            return false;

        if ( $parameters === false )
        {
            return $this->Parameters['dependencies'][$dependencySection];
        }

        $matches = array();
        $dependencyItems = $this->Parameters['dependencies'][$dependencySection];
        foreach ( $dependencyItems as $dependencyItem )
        {
            $found = true;

            foreach ( $parameters as $paramName => $paramValue )
            {
                if ( !isset( $dependencyItem[$paramName] ) ||
                     $dependencyItem[$paramName] != $paramValue )
                {
                    $found = false;
                    break;
                }
            }

            if ( $found )
                $matches[] = $dependencyItem;
        }

        return $matches;
    }
1241512
public function typesAction(Request $request)
    {
        $component = $request->request->get('component');

        $taskTypes = $this->get('phlexible_task.types');

        $types = [];
        foreach ($taskTypes->all() as $type) {
            /* @var $type TypeInterface */
            if ($component && $type->getComponent() !== $component) {
                continue;
            }

            $types[] = [
                'id' => $type->getName(),
                'name' => $type->getName(),
            ];
        }

        return new JsonResponse(['types' => $types]);
    }