Get a profiler

@return ProfilerInterface
181284
public function getProfiler() {
		if ($this->_profiler === null) {
			$this->_profiler = new Profiler();
			$this->onProfilerInit($this->_profiler);
		}
		
		return $this->_profiler;
	}
1199451
public function getProfileSettings($profile)
    {
        $search = $this->repo->createSearch();
        $termQuery = new TermQuery('profile', $profile);
        $search->addQuery($termQuery);
        $search->setSize(1000);

        $settings = $this->repo->findArray($search);

        return $settings;
    }
106723
public function getResolver()
    {
        if ($this->resolver instanceof Resolver) {
            return $this->resolver;
        }

        $factory = new Factory();
        $this->resolver = $factory->createCached($this->getDnsServer(), $this->getLoop());

        return $this->resolver;
    }
835532
protected function getSeeder()
    {
        $class = $this->laravel->make($this->input->getOption('class'));

        return $class->setContainer($this->laravel)->setCommand($this);
    }
1367665
public function actionProfile()
    {
        $model = UserProfile::findOne(['user_id' => Yii::$app->user->identity->getId()]);
        if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
            Yii::$app->response->format = Response::FORMAT_JSON;
            return ActiveForm::validate($model);
        }
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->getSession()->setFlash('success', Yii::t('yuncms', 'Your profile has been updated'));
            return $this->refresh();
        }
        return $this->render('profile', [
            'model' => $model,
        ]);
    }
391964
public function getRouteCollector(){
        if(null === $this->routeCollector){
            $this->routeCollector   = new RouteCollector();
            $resolver               = new Controller\ControllerResolver(
                $this,
                new \Doctrine\Common\Annotations\AnnotationReader(null)
            );

            foreach($this->bundles as $bundle){
                foreach($bundle->getControllers() as $controller){
                    foreach($resolver->getRoutes($controller) as $route){
                        $this->routeCollector->add($route);
                    }
                }
            }
        }

        return $this->routeCollector;
    }
893128
public function getProfile($type) {
    // Get the OAuth token from LinkedIn.
    if (!$access_token = $this->authManager->getAccessToken($type)) {
      drupal_set_message($this->t('@network login failed. Token is not valid.', [
        '@network' => $this->t('LinkedIn'),
      ]), 'error');
      return $this->redirect('user.' . $type);
    }

    // Get user's LinkedIn profile from LinkedIn API.
    if (!($profile = $this->authManager->getProfile()) || empty($profile['id'])) {
      drupal_set_message($this->t('@network login failed, could not load @network profile. Contact the site administrator.', [
        '@network' => $this->t('LinkedIn'),
      ]), 'error');
      return $this->redirect('user.' . $type);
    }

    $this->accessToken = $access_token;

    return $profile;
  }
266405
public function getMapper()
    {
        if (!$this->mapper instanceof UserProviderInterface) {
            $this->setMapper($this->getServiceLocator()->get('SocialAuth-UserProviderMapper'));
        }

        return $this->mapper;
    }
1000429
public function profileAction()
    {
      // fix new implementation of servicelocator
        try {
            $translator = $this->getServiceLocator()->get('MvcTranslator');
        } catch (\Exception $e) {
          //echo ($e->getMessage());
        }
        if (! $this->zfcUserAuthentication()->hasIdentity()) {
            return $this->redirect()->toUrl(
                $this->url()->fromRoute(
                    $this->getOptions()->getLoginRedirectRoute(),
                    array(),
                    array('force_canonical' => true)
                )
            );
        }
        $formEmail     = $this->getChangeEmailForm();
        $formEmail->get('credential')
                  ->setLabel($translator->translate('Your password', 'playgrounduser'))
                  ->setAttributes(array(
                      'type'            => 'password',
                      'class'        => 'large-input',
                      'placeholder'    => $translator->translate('Your password', 'playgrounduser')
                  ));
        $formEmail->get('newIdentity')
                  ->setLabel($translator->translate('Your new email', 'playgrounduser'))
                  ->setAttributes(array(
                      'type'            => 'email',
                      'class'        => 'large-input',
                      'placeholder'    => $translator->translate('Your new email', 'playgrounduser')
                  ));
        $formEmail->get('newIdentityVerify')
                  ->setLabel($translator->translate('Confirm the new email', 'playgrounduser'))
                  ->setAttributes(array(
                      'type'            => 'email',
                      'class'        => 'large-input',
                      'placeholder'    => $translator->translate('Confirm the new email', 'playgrounduser')
                  ));
        $formPassword  = $this->getChangePasswordForm();
        $formPassword->get('credential')
                     ->setLabel($translator->translate('Your current password', 'playgrounduser'))
                     ->setAttributes(array(
                         'class'    => 'large-input',
                         'type'        => 'password',
                         'placeholder' => $translator->translate('Your current password', 'playgrounduser')
                     ));
        $formPassword->get('newCredential')
                     ->setLabel($translator->translate('New Password', 'playgrounduser'))
                     ->setAttributes(array(
                         'class'    => 'large-input',
                         'type'        => 'password',
                         'placeholder' => $translator->translate('New Password', 'playgrounduser')
                     ));
        $formPassword->get('newCredentialVerify')
                     ->setLabel($translator->translate('Verify New Password', 'playgrounduser'))
                     ->setAttributes(array(
                         'class'    => 'large-input',
                         'type'        => 'password',
                         'placeholder' => $translator->translate('Verify New Password', 'playgrounduser')
                     ));
        ;
        $formInfo      = $this->getChangeInfoForm();
        $formPrize     = $this->getPrizeCategoryForm();
        $formBlock     = $this->getBlockAccountForm();
        if ($this->zfcUserAuthentication()->getIdentity()->getState() == 2) {
            $formBlock->get('activate')->setAttribute('value', 1);
            $formBlock->get('submit')->setAttribute('value', $translator->translate('Reactivate my account', 'playgrounduser'));
            $formBlock->get('confirm_submit')->setAttribute('value', $translator->translate('Confirm account reactivation', 'playgrounduser'));
        }

        $categoryService = $this->getServiceLocator()->get('playgroundgame_prizecategoryuser_service');
        $categoriesUser = $categoryService->getPrizeCategoryUserMapper()->findBy(array('user' => $this->zfcUserAuthentication()->getIdentity()));
        $existingCategories = array();

        foreach ($categoriesUser as $categoryUser) {
            $existingCategories[] = $categoryUser->getPrizeCategory()->getId();
        }

        $formPrize->get('prizeCategory')->setAttribute('value', $existingCategories);

        $request = $this->getRequest();
        // I don't want to rely on the browser's info for these key datas
        $request->getPost()->set(
            'identity',
            $this->getUserService()->getAuthService()->getIdentity()->getEmail()
        );
        $request->getPost()->set(
            'email',
            $this->getUserService()->getAuthService()->getIdentity()->getEmail()
        );
        $userId = $this->getUserService()->getAuthService()->getIdentity()->getId();

        $user = $this->getUserService()->getUserMapper()->findById($userId);
        $formInfo->bind($user);

        $username = $formInfo->get('username')->getValue();
        $userFirstLastName = $user->getFirstName().' '.substr($user->getLastName(), 0, 1);
        if (empty($username) || $username == $userFirstLastName) {
            $usernamePoint = '+ 150 pts';
        } else {
            $usernamePoint = '';
        }

        $fmPassword = $this->flashMessenger()->setNamespace('change-password')->getMessages();

        if (isset($fmPassword[0])) {
            $statusPassword = $fmPassword[0];
        } else {
            $statusPassword = null;
        }

        $fmEmail = $this->flashMessenger()->setNamespace('change-email')->getMessages();
        if (isset($fmEmail[0])) {
            $statusEmail = $fmEmail[0];
        } else {
            $statusEmail = null;
        }

        $fmInfo = $this->flashMessenger()->setNamespace('change-info')->getMessages();
        if (isset($fmInfo[0])) {
            $statusInfo = $fmInfo[0];
        } else {
            $statusInfo = null;
        }

        if ($request->isPost() && array_key_exists('firstname', $this->params()->fromPost())) {
            $result = false;
            $data = $request->getPost()->toArray();

            $file = $this->params()->fromFiles('avatar');
            if ($file['name']) {
                $data = array_merge(
                    $data,
                    ['avatar' => $file['name']]
                );
            }

            $result = $this->getUserService()->updateInfo($data, $user);

            if (! $result) {
                return array(
                    'statusPassword' => null,
                    'changePasswordForm' => $formPassword,
                    'statusEmail' => null,
                    'changeEmailForm' => $formEmail,
                    'statusInfo' => false,
                    'changeInfoForm' => $formInfo,
                    'prizeCategoryForm' => $formPrize,
                    'blockAccountForm' => $formBlock,
                    'usernamePoint' => $usernamePoint,
                );
            }

            $this->flashMessenger()->setNamespace('change-info')->addMessage(true);

            $redirect = (!empty($this->params()->fromQuery('redirect')))?
                $this->params()->fromQuery('redirect'):
                $this->getRequest()->getUri();

            return $this->redirect()->toUrl($redirect);
        }

        $redirectUrl = $this->getRequest()->getUri();

        $prg = $this->prg($redirectUrl, true);

        if ($prg instanceof Response) {
            return $prg;
        } elseif ($prg === false) {
            return array(
            'statusPassword' => $statusPassword,
            'changePasswordForm' => $formPassword,
            'statusEmail' => $statusEmail,
            'changeEmailForm' => $formEmail,
            'statusInfo' => $statusInfo,
            'changeInfoForm' => $formInfo,
            'prizeCategoryForm' => $formPrize,
            'blockAccountForm' => $formBlock,
            'usernamePoint' => $usernamePoint,
            );
        }

        if (isset($prg['newCredential'])) {
            $formPassword->setData($prg);
            if (! $formPassword->isValid()) {
                $messages = $formPassword->getMessages();
                if (isset($messages['credential']) && isset($messages['credential']['isEmpty'])) {
                    $messages['credential']['isEmpty'] = 'Saisissez votre mot de passe actuel';
                }
                if (isset($messages['newCredential']) && isset($messages['newCredential']['isEmpty'])) {
                    $messages['newCredential']['isEmpty'] = 'Saisissez votre nouveau mot de passe';
                }
                if (isset($messages['newCredentialVerify']) && isset($messages['newCredentialVerify']['isEmpty'])) {
                    $messages['newCredentialVerify']['isEmpty'] = 'Confirmation du mot de passe ';
                }
                $formPassword->setMessages($messages);

                return array(
                    'statusPassword' => false,
                    'changePasswordForm' => $formPassword,
                    'statusEmail' => null,
                    'changeEmailForm' => $formEmail,
                    'statusInfo' => null,
                    'changeInfoForm' => $formInfo,
                    'prizeCategoryForm' => $formPrize,
                    'blockAccountForm' => $formBlock,
                    'usernamePoint' => $usernamePoint,
                    );
            }

            if (! $this->getUserService()->changePassword($formPassword->getData())) {
                return array(
                'statusPassword' => false,
                'changePasswordForm' => $formPassword,
                'statusEmail' => null,
                'changeEmailForm' => $formEmail,
                'statusInfo' => null,
                'changeInfoForm' => $formInfo,
                'prizeCategoryForm' => $formPrize,
                'blockAccountForm' => $formBlock,
                'usernamePoint' => $usernamePoint,
                );
            }

            $this->flashMessenger()
                ->setNamespace('change-password')
                ->addMessage(true);

            return $this->redirect()->toUrl($this->getRequest()->getUri());
        } elseif (isset($prg['newIdentity'])) {
            $formEmail->setData($prg);

            if (! $formEmail->isValid()) {
                $messages = $formEmail->getMessages();
                if (isset($messages['newIdentity']) && isset($messages['newIdentity']['isEmpty'])) {
                    $messages['newIdentity']['isEmpty'] = 'Saisissez votre nouvel email';
                }
                if (isset($messages['newIdentity']) && isset($messages['newIdentity']['recordFound'])) {
                    $messages['newIdentity']['recordFound'] = 'Cet email existe déjà';
                }
                if (isset($messages['newIdentityVerify']) && isset($messages['newIdentityVerify']['isEmpty'])) {
                    $messages['newIdentityVerify']['isEmpty'] = 'Confirmer votre nouvel email';
                }
                if (isset($messages['newIdentityVerify']) && isset($messages['newIdentityVerify']['notSame'])) {
                    $messages['newIdentityVerify']['notSame'] = 'Les deux emails ne correspondent pas';
                }
                $formEmail->setMessages($messages);

                return array(
                    'statusPassword' => null,
                    'changePasswordForm' => $formPassword,
                    'statusEmail' => false,
                    'changeEmailForm' => $formEmail,
                    'statusInfo' => null,
                    'changeInfoForm' => $formInfo,
                    'prizeCategoryForm' => $formPrize,
                    'blockAccountForm' => $formBlock,
                    'usernamePoint' => $usernamePoint,
                );
            }

            $change = $this->getUserService()->changeEmail($prg);

            if (! $change) {
                $this->flashMessenger()
                ->setNamespace('change-email')
                ->addMessage(false);

                return array(
                    'statusPassword' => null,
                    'changePasswordForm' => $formPassword,
                    'statusEmail' => false,
                    'changeEmailForm' => $formEmail,
                    'statusInfo' => null,
                    'changeInfoForm' => $formInfo,
                    'prizeCategoryForm' => $formPrize,
                    'blockAccountForm' => $formBlock,
                    'usernamePoint' => $usernamePoint,
                );
            }

            $this->flashMessenger()
            ->setNamespace('change-email')
            ->addMessage(true);

            return $this->redirect()->toUrl($this->getRequest()->getUri());
        }

        return array(
            'statusPassword' => null,
            'changePasswordForm' => $formPassword,
            'statusEmail' => null,
            'changeEmailForm' => $formEmail,
            'statusInfo' => null,
            'changeInfoForm' => $formInfo,
            'prizeCategoryForm' => $formPrize,
            'blockAccountForm' => $formBlock,
            'usernamePoint' => $usernamePoint,
            );
    }
1092931
protected function getProfile() {
    if (empty($this->profile)) {
      $profiles = $this->discovery->scan('profile');

      if (empty($profiles['lightning'])) {
        throw new \RuntimeException('Lightning profile not found.');
      }
      $this->profile = $profiles['lightning'];
    }
    return $this->profile;
  }
983338
protected function getLoader(): LoaderInterface
    {
        if (! $this->loader instanceof LoaderInterface) {
            $this->loader = new CacheLoader(sprintf(
                '%s/%s.php',
                rtrim($this->getCacheLocation(), '/'),
                $this->getCacheFilename()
            ));
        }

        return $this->loader;
    }
1039072
public function getProfile($type) {
    $sdk = $this->getSdk($type);
    $data_handler = $this->networkManager->createInstance('social_auth_twitter')->getDataHandler();

    // Get the OAuth token from Twitter.
    if (!($oauth_token = $data_handler->get('oauth_token')) || !($oauth_token_secret = $data_handler->get('oauth_token_secret'))) {
      drupal_set_message($this->t('@network login failed. Token is not valid.', [
        '@network' => $this->t('Twitter'),
      ]), 'error');
      return $this->redirect('user.' . $type);
    }

    $this->authManager->setAccessToken([
      'oauth_token' => $oauth_token,
      'oauth_token_secret' => $oauth_token_secret,
    ]);

    // Gets the permanent access token.
    $this->accessToken = $sdk->oauth('oauth/access_token', [
      'oauth_verifier' => $this->request->get('oauth_verifier'),
    ]);

    $this->authManager->setAccessToken([
      'oauth_token' => $this->accessToken['oauth_token'],
      'oauth_token_secret' => $this->accessToken['oauth_token_secret'],
    ]);

    // Get user's profile from Twitter API.
    if (!($profile = $this->authManager->getProfile()) || !$this->authManager->getAccountId()) {
      drupal_set_message($this->t('@network login failed, could not load @network profile. Contact the site administrator.', [
        '@network' => $this->t('Twitter'),
      ]), 'error');
      return $this->redirect('user.' . $type);
    }

    return $profile;
  }
112697
public function getLogger()
    {
        if ($this->logger instanceof LoggerInterface) {
            return $this->logger;
        }
        if ($this instanceof ServiceLocatorAwareInterface) {
            $logger = $this->getServiceLocator()->get(LoggerService::SERVICE_ID);
        } else {
            $logger = ServiceManager::getServiceManager()->get(LoggerService::SERVICE_ID);
        }
        return ($logger instanceof LoggerInterface) ? $logger : new NullLogger();
    }
673214
public function getProfile()
    {
        $request = new GetAccountProfileRequest([$this->identifier]);
        $response = new GetAccountProfileResponse();
        return $this->client->sendRequest($request, $response);
    }
421563
public function getLoader()
    {
        if (null === $this->loader) {
            $locator  = new FileLocator($this->paths);
            $resolver = new LoaderResolver(array(
                new YamlFileLoader($locator),
                new PhpFileLoader($locator),
                new IniFileLoader($locator),
                new ArrayLoader(),
            ));

            $this->loader = new DelegatingLoader($resolver);
        }

        return $this->loader;
    }
1167655
public function getRouter() : RouterInterface
    {
        if (! $this->router instanceof RouterInterface) {
            $router = new Router();
            $resolver = $this->getCallbackResolver();
            if ($resolver instanceof CallbackResolverInterface) {
                $router->setCallbackResolver($resolver);
            }

            $routerCacheFile = $this->getConfiguration('routerCacheFile', false);
            if ($routerCacheFile) {
                $router->setCacheFile($routerCacheFile);
            }

            $this->router = $router;
        }

        return $this->router;
    }
698217
public function get($profileId, $optParams = array()) {
      $params = array('profileId' => $profileId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new UserProfile($data);
      } else {
        return $data;
      }
    }