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


PHP Zend_Controller_Request_Http::get方法代码示例

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


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

示例1: onAfterInitController

 public function onAfterInitController($event)
 {
     //this extension should only run if no explicit model is given via request parameter "m"
     $request = new Zend_Controller_Request_Http();
     if ($request->get("m")) {
         return;
     }
     $config = $this->_privateConfig->toArray();
     $efApp = Erfurt_App::getInstance();
     // disable model box if config value is true and modelmanangement isn't allowed
     if ($config['modelsHide'] && !$efApp->getAc()->isActionAllowed($config['modelsExclusiveRight'])) {
         $registry = OntoWiki_Module_Registry::getInstance();
         $registry->disableModule('modellist', 'main.sidewindow');
     }
     //only do this once (so if the model is changed later, this plugin will not prevent it)
     if ($config['setOnce'] && isset($_SESSION['defaultModelHasBeenSet']) && $_SESSION['defaultModelHasBeenSet']) {
         return;
     }
     $_SESSION['defaultModelHasBeenSet'] = true;
     require_once 'OntoWiki/Module/Registry.php';
     $owApp = OntoWiki::getInstance();
     $efStore = $efApp->getStore();
     $availableModels = $efStore->getAvailableModels();
     if (array_key_exists('modelUri', $config) && array_key_exists($config['modelUri'], $availableModels)) {
         $modelUri = $config['modelUri'];
     } elseif (count($availableModels) === 1) {
         $modelUri = current(array_keys($availableModels));
     } else {
         $modelUri = false;
     }
     // set default model if it could be determined
     if ($modelUri && !$efApp->getAc()->isActionAllowed($config['modelsExclusiveRight'])) {
         if (!($owApp->selectedModel && $modelUri == $owApp->selectedModel->getModelUri())) {
             $owApp->selectedModel = $efStore->getModel($modelUri);
             return;
         }
         if ($config['setSelectedResource']) {
             $owApp->selectedResource = $modelUri;
         }
     }
 }
开发者ID:dmj,项目名称:uni-helmstedt.hab.de,代码行数:41,代码来源:DefaultmodelPlugin.php

示例2: testGetIsAlias

 public function testGetIsAlias()
 {
     $this->assertEquals('val1', $this->_request->get('var1'));
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:4,代码来源:HttpTest.php

示例3: sendPackage

 /**
  * @see AM_Handler_Export_Storage_Interface::sendPackage()
  * @throws AM_Handler_Export_Storage_Exception
  */
 public function sendPackage()
 {
     $sFilePath = $this->_buildPackagePath() . DIRECTORY_SEPARATOR . $this->getPackage()->getPackageName();
     $sFileName = $this->getPackage()->getPackageDownloadName();
     if (!file_exists($sFilePath)) {
         throw new AM_Handler_Export_Storage_Exception(sprintf('File "%s" not found', $sFilePath));
     }
     $oResponse = new Zend_Controller_Response_Http();
     $oResponse->setHttpResponseCode(200);
     $oRequest = new Zend_Controller_Request_Http();
     $iFileSize = filesize($sFilePath);
     $sFileMtime = @gmdate("D, d M Y H:i:s", @filemtime($sFilePath)) . " GMT";
     $rFile = @fopen($sFilePath, 'rb');
     $sRange = $oRequest->get('HTTP_RANGE');
     //Trying to resume download according to the HTTP_RANGE header
     if (preg_match('/bytes=(\\d+)-(\\d*)/i', $sRange, $matches)) {
         $sRange = $matches[1];
     } else {
         $sRange = false;
     }
     if ($sRange) {
         fseek($rFile, $sRange);
         $oResponse->setHttpResponseCode(206);
         $oResponse->setHeader('Content-Range', sprintf('bytes %d-%d/%d', $sRange, $iFileSize - 1, $iFileSize));
     }
     $oResponse->setHeader('Content-Disposition', 'attachment; filename=' . $sFileName)->setHeader('Content-Length', $iFileSize - $sRange)->setHeader('Content-Type', 'application/octet-stream')->setHeader('Accept-Ranges', 'bytes')->setHeader('Last-Modified', $sFileMtime);
     while (!feof($rFile)) {
         $sBuffer = fread($rFile, 2048);
         $oResponse->appendBody($sBuffer);
     }
     fclose($rFile);
     $oResponse->sendResponse();
 }
开发者ID:pansot2,项目名称:PadCMS-backend,代码行数:37,代码来源:Local.php


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