当前位置: 首页>>代码示例>>PHP>>正文


PHP Request::get方法代码示例

本文整理汇总了PHP中Slim\Http\Request::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::get方法的具体用法?PHP Request::get怎么用?PHP Request::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Slim\Http\Request的用法示例。


在下文中一共展示了Request::get方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get

 public function get($name)
 {
     $value = $this->request->get($name);
     if ($value === null) {
         $value = $this->request->post($name);
     }
     if ($value === null) {
         $value = @$this->defaultValues[$name];
     }
     return $value;
 }
开发者ID:QualityUnit,项目名称:swagger-codegen,代码行数:11,代码来源:Params.class.php

示例2: unpack

 /**
  * @throws \RuntimeException
  */
 public function unpack()
 {
     // Manual updates do not contain files to overwrite
     if (UPDATE_IS_MANUAL) {
         Utils::clearOpcodeCache();
         $this->toJson(200, $this->resultMapper->toExtJs(new FinishResult(0, 0)));
         return;
     }
     $offset = $this->request->get('offset');
     $total = $this->request->get('total');
     /** @var FilesystemFactory $factory */
     $factory = $this->container->get('filesystem.factory');
     $localFilesystem = $factory->createLocalFilesystem();
     $remoteFilesystem = $factory->createRemoteFilesystem();
     if ($offset == 0) {
         $this->validateFilesytems($localFilesystem, $remoteFilesystem);
     }
     /** @var PathBuilder $pathBuilder */
     $pathBuilder = $this->container->get('path.builder');
     $debug = false;
     $step = new UnpackStep($localFilesystem, $remoteFilesystem, $pathBuilder, $debug);
     $result = $step->run($offset, $total);
     if ($result instanceof ValidResult) {
         Utils::clearOpcodeCache();
     }
     $this->toJson(200, $this->resultMapper->toExtJs($result));
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:30,代码来源:BatchController.php

示例3: turorialAction

 /**
  * 
  *
  * @Route /tutorial
  * 
  * 
  * @param \Slim\Http\Request $request
  * @param \Slim\Http\Response $response
  * @param \Slim\Route $route
  */
 public function turorialAction($request, $response, $route)
 {
     $interactive = $this->get('InteractiveManager');
     $user = 'public';
     if ($this->app->getSecurity()->isAuthenticated()) {
         $array = $this->app->getSecurity()->getUser();
         $user = $array['username'];
     }
     $store = json_encode(array('reject' => false, 'tutoriales' => array('interactive' => 'This is interactive')));
     if ($this->app->getCookie('Interactive_' . $user, true) == NULL) {
         $this->app->setCookie('Interactive_' . $user, $store, strtotime('+30 day'));
     } else {
         $store = json_decode($this->app->getCookie('Interactive_' . $user, true));
         $store->tutoriales->{$request->get('name')} = 0;
         $this->app->setCookie('Interactive_' . $user, json_encode($store), strtotime('+30 day'));
     }
     $interactive->setCurrentData($store);
     return $this->JSON($interactive->getTutorial($request->get('name')));
 }
开发者ID:williamamed,项目名称:Raptor2,代码行数:29,代码来源:DefaultController.php

示例4: __construct

 protected function __construct(\Slim\Http\Request $request)
 {
     $key = $request->headers('apikey');
     if ($key == '') {
         $key = $request->post('apikey');
     }
     if ($key == '') {
         $key = $request->get('apikey');
     }
     if ($key == '') {
         return;
     }
     $this->apiKey = $key;
     $this->role = $this->getRoleFromKey($this->apiKey);
 }
开发者ID:QualityUnit,项目名称:swagger-codegen,代码行数:15,代码来源:Auth.class.php

示例5: bundleInstallerModuleAction

 /**
  * 
  *
  * @Route /bundle/installer/module
  * 
  * 
  * @param \Slim\Http\Request $request
  * @param \Slim\Http\Response $response
  * @param \Slim\Route $route
  */
 public function bundleInstallerModuleAction($request)
 {
     $msg = "";
     if ($request->get('name') and $request->get('type') == 'local') {
         $dir = \Raptor2\InstallerBundle\Importer\BundleImporter::prepareCache();
         $meta = \Raptor2\InstallerBundle\Importer\BundleImporter::getMetainformation($request->get('name'));
         if ($meta !== false) {
             \Raptor\Util\Files::copy(__DIR__ . '/../BundleStorage/files/' . $meta['file'], $dir);
             $msg = \Raptor2\InstallerBundle\Importer\BundleImporter::proccesBundle($dir . '/' . $meta['file']);
         }
     } elseif ($request->get('name') and $request->get('type') == 'remote' and $request->get('url')) {
         $file = \Raptor2\InstallerBundle\Importer\BundleImporter::downloadRemoteFile($request->get('url'));
         $msg = \Raptor2\InstallerBundle\Importer\BundleImporter::proccesBundle($file);
     }
     $local = \Raptor2\InstallerBundle\Importer\BundleImporter::getMetainformation();
     $conf = $this->getApp()->getConfigurationLoader()->getConfOption();
     if (isset($conf['raptor']['repository'])) {
         $remote = \Raptor2\InstallerBundle\Importer\BundleImporter::getRemoteMetainformation($conf['raptor']['repository']);
         $local = array_merge($local, $remote);
     }
     return $this->render('@InstallerBundle/installer/index.html.twig', array('modules' => $local, 'message' => $msg));
 }
开发者ID:williamamed,项目名称:Raptor2,代码行数:32,代码来源:DefaultController.php

示例6: createFromRequest

 /**
  * Creates a page object out of a request object
  * @param \Slim\Http\Request $request
  * @return Page
  */
 public static function createFromRequest(\Slim\Http\Request $request)
 {
     return new Page($request->get('offset'), $request->get('limit', 10));
 }
开发者ID:fousheezy,项目名称:slim-core,代码行数:9,代码来源:Page.php

示例7: extractToken

 public function extractToken(Request $request)
 {
     $tokenHeader = $request->headers('Authorization', false);
     $rawTokenHeader = $request->rawHeaders('Authorization', false);
     if ($tokenHeader && preg_match('/Bearer\\s*([^\\s]+)/', $tokenHeader, $matches)) {
         $tokenHeader = $matches[1];
     } elseif ($rawTokenHeader && preg_match('/Bearer\\s*([^\\s]+)/', $rawTokenHeader, $matches)) {
         $tokenHeader = $matches[1];
     } else {
         $tokenHeader = false;
     }
     $tokenRequest = $request->post('access_token', false);
     $tokenQuery = $request->get('access_token', false);
     // At least one (and only one) of client credentials method required.
     if (!$tokenHeader && !$tokenRequest && !$tokenQuery) {
         throw new Exception('The request is missing a required parameter.', Resource::STATUS_BAD_REQUEST);
     } elseif ($tokenHeader && $tokenRequest || $tokenRequest && $tokenQuery || $tokenQuery && $tokenHeader) {
         throw new Exception('The request includes multiple credentials.', Resource::STATUS_BAD_REQUEST);
     }
     $accessToken = $tokenHeader ?: $tokenRequest ?: $tokenQuery;
     try {
         $tokenDocument = $this->fetchToken($accessToken);
     } catch (\Exception $e) {
         throw new Exception('Access token invalid.');
     }
     return $tokenDocument;
 }
开发者ID:rohanabraham,项目名称:lxHive,代码行数:27,代码来源:OAuth.php

示例8: getSlimView

 public function getSlimView(\Slim\Http\Request $request)
 {
     if ($request->isAjax() || $request->isXhr() || $request->get('format', '') == 'json' || $request->post('format', '') == 'json') {
         return $this->slimViewFactory->getJsonSlimView();
     }
     return $this->slimViewFactory->getHtmlSlimView();
 }
开发者ID:anneks,项目名称:rightaboutnow,代码行数:7,代码来源:SlimViewPicker.class.php


注:本文中的Slim\Http\Request::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。