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


PHP IRequest::getScriptName方法代码示例

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


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

示例1: generateHeaders

 /**
  * @param array $headers
  * @param bool $hasMoreActivities
  * @return array
  */
 protected function generateHeaders(array $headers, $hasMoreActivities)
 {
     if ($hasMoreActivities && isset($headers['X-Activity-Last-Given'])) {
         // Set the "Link" header for the next page
         $nextPageParameters = ['since' => $headers['X-Activity-Last-Given'], 'limit' => $this->limit, 'sort' => $this->sort];
         if ($this->objectType && $this->objectId) {
             $nextPageParameters['object_type'] = $this->objectType;
             $nextPageParameters['object_id'] = $this->objectId;
         }
         if ($this->request->getParam('format') !== null) {
             $nextPageParameters['format'] = $this->request->getParam('format');
         }
         $nextPage = $this->request->getServerProtocol();
         # http
         $nextPage .= '://' . $this->request->getServerHost();
         # localhost
         $nextPage .= $this->request->getScriptName();
         # /ocs/v2.php
         $nextPage .= $this->request->getPathInfo();
         # /apps/activity/api/v2/activity
         $nextPage .= '?' . http_build_query($nextPageParameters);
         $headers['Link'] = '<' . $nextPage . '>; rel="next"';
     }
     return $headers;
 }
开发者ID:ynott,项目名称:activity,代码行数:30,代码来源:ocsendpoint.php

示例2: isV2

 /**
  * @return bool
  */
 protected function isV2()
 {
     return $this->request->getScriptName() === '/ocs/v2.php';
 }
开发者ID:gvde,项目名称:core,代码行数:7,代码来源:sharees.php

示例3: isV2

 /**
  * @param \OCP\IRequest $request
  * @return bool
  */
 protected static function isV2(\OCP\IRequest $request)
 {
     $script = $request->getScriptName();
     return substr($script, -11) === '/ocs/v2.php';
 }
开发者ID:nem0xff,项目名称:core,代码行数:9,代码来源:api.php

示例4: checkMaintenanceMode

 /**
  * Limit maintenance mode access
  * @param IRequest $request
  */
 public static function checkMaintenanceMode(IRequest $request)
 {
     // Check if requested URL matches 'index.php/occ'
     $isOccControllerRequested = preg_match('|/index\\.php$|', $request->getScriptName()) === 1 && strpos($request->getPathInfo(), '/occ/') === 0;
     // Allow ajax update script to execute without being stopped
     if (\OC::$server->getSystemConfig()->getValue('maintenance', false) && OC::$SUBURI != '/core/ajax/update.php' && !$isOccControllerRequested) {
         // send http status 503
         header('HTTP/1.1 503 Service Temporarily Unavailable');
         header('Status: 503 Service Temporarily Unavailable');
         header('Retry-After: 120');
         // render error page
         $template = new OC_Template('', 'update.user', 'guest');
         OC_Util::addScript('maintenance-check');
         $template->printPage();
         die;
     }
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:21,代码来源:base.php


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