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


PHP SS_HTTPRequest::getExtension方法代码示例

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


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

示例1: parseFilename

 /**
  * Get the file component from the request
  *
  * @param \SS_HTTPRequest $request
  * @return string
  */
 protected function parseFilename(\SS_HTTPRequest $request)
 {
     $filename = '';
     $next = $request->param('Filename');
     while ($next) {
         $filename = $filename ? \File::join_paths($filename, $next) : $next;
         $next = $request->shift();
     }
     if ($extension = $request->getExtension()) {
         $filename = $filename . "." . $extension;
     }
     return $filename;
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:19,代码来源:ProtectedFileController.php

示例2: emailsent

 /**
  * Show the "password sent" page, after a user has requested
  * to reset their password.
  *
  * @param SS_HTTPRequest $request The SS_HTTPRequest for this action.
  * @return string Returns the "password sent" page as HTML code.
  */
 public function emailsent($request)
 {
     Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
     Requirements::javascript(SAPPHIRE_DIR . '/javascript/loader.js');
     Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
     Requirements::javascript(SAPPHIRE_DIR . '/javascript/prototype_improvements.js');
     Requirements::javascript(THIRDPARTY_DIR . '/scriptaculous/effects.js');
     $tmpPage = new Page();
     $tmpPage->Title = _t('Security.LOSTPASSWORDHEADER');
     $tmpPage->URLSegment = 'Security';
     $tmpPage->ID = -1;
     // Set the page ID to -1 so we dont get the top level pages as its children
     $controller = new Page_Controller($tmpPage);
     $controller->init();
     $email = Convert::raw2xml($request->param('ID') . '.' . $request->getExtension());
     $customisedController = $controller->customise(array('Title' => sprintf(_t('EmailVerifiedMember.EMAILSENTHEADER', "Verify Email link sent to '%s'"), $email), 'Content' => "<p>" . sprintf(_t('EmailVerifiedMember.EMAILSENTTEXT', "Thank you! A verify email link has been sent to  '%s', provided an account exists for this email address."), $email) . "</p>", 'Email' => $email));
     return $customisedController->renderWith(array('Security_emailsent', 'Security', $this->owner->stat('template_main'), 'ContentController'));
 }
开发者ID:helpfulrobot,项目名称:exadium-emailverifiedmember,代码行数:25,代码来源:EmailVerifiedSecurity.php

示例3: passwordsent

 /**
  * Show the "password sent" page, after a user has requested
  * to reset their password.
  *
  * @param SS_HTTPRequest $request The SS_HTTPRequest for this action.
  * @return string Returns the "password sent" page as HTML code.
  */
 public function passwordsent($request)
 {
     if (class_exists('SiteTree')) {
         $tmpPage = new Page();
         $tmpPage->Title = _t('Security.LOSTPASSWORDHEADER', 'Lost Password');
         $tmpPage->URLSegment = 'Security';
         // Disable ID-based caching  of the log-in page by making it a random number
         $tmpPage->ID = -1 * rand(1, 10000000);
         $controller = Page_Controller::create($tmpPage);
         $controller->init();
     } else {
         $controller = $this;
     }
     // if the controller calls Director::redirect(), this will break early
     if (($response = $controller->getResponse()) && $response->isFinished()) {
         return $response;
     }
     $email = Convert::raw2xml(rawurldecode($request->param('ID')) . '.' . $request->getExtension());
     $customisedController = $controller->customise(array('Title' => _t('Security.PASSWORDSENTHEADER', "Password reset link sent to '{email}'", array('email' => $email)), 'Content' => "<p>" . _t('Security.PASSWORDSENTTEXT', "Thank you! A reset link has been sent to '{email}', provided an account exists for this email" . " address.", array('email' => $email)) . "</p>", 'Email' => $email));
     //Controller::$currentController = $controller;
     return $customisedController->renderWith($this->getTemplate('passwordsent'));
 }
开发者ID:congaaids,项目名称:silverstripe-framework,代码行数:29,代码来源:Security.php

示例4: passwordsent

 /**
  * Show the "password sent" page, after a user has requested
  * to reset their password.
  *
  * @param SS_HTTPRequest $request The SS_HTTPRequest for this action.
  * @return string Returns the "password sent" page as HTML code.
  */
 public function passwordsent($request)
 {
     $controller = $this->getResponseController(_t('Security.LOSTPASSWORDHEADER', 'Lost Password'));
     // if the controller calls Director::redirect(), this will break early
     if (($response = $controller->getResponse()) && $response->isFinished()) {
         return $response;
     }
     $email = Convert::raw2xml(rawurldecode($request->param('ID')) . '.' . $request->getExtension());
     $customisedController = $controller->customise(array('Title' => _t('Security.PASSWORDSENTHEADER', "Password reset link sent to '{email}'", array('email' => $email)), 'Content' => "<p>" . _t('Security.PASSWORDSENTTEXT', "Thank you! A reset link has been sent to '{email}', provided an account exists for this email" . " address.", array('email' => $email)) . "</p>", 'Email' => $email));
     //Controller::$currentController = $controller;
     return $customisedController->renderWith($this->getTemplatesFor('passwordsent'));
 }
开发者ID:miamollie,项目名称:echoAerial,代码行数:19,代码来源:Security.php

示例5: passwordsent

 /**
  * Show the "password sent" page, after a user has requested
  * to reset their password.
  *
  * @param SS_HTTPRequest $request The SS_HTTPRequest for this action. 
  * @return string Returns the "password sent" page as HTML code.
  */
 public function passwordsent($request)
 {
     if (class_exists('SiteTree')) {
         $tmpPage = new Page();
         $tmpPage->Title = _t('Security.LOSTPASSWORDHEADER');
         $tmpPage->URLSegment = 'Security';
         $tmpPage->ID = -1;
         // Set the page ID to -1 so we dont get the top level pages as its children
         $controller = Page_Controller::create($tmpPage);
         $controller->init();
     } else {
         $controller = $this;
     }
     // if the controller calls Director::redirect(), this will break early
     if (($response = $controller->getResponse()) && $response->isFinished()) {
         return $response;
     }
     $email = Convert::raw2xml(rawurldecode($request->param('ID')) . '.' . $request->getExtension());
     $customisedController = $controller->customise(array('Title' => _t('Security.PASSWORDSENTHEADER', "Password reset link sent to '{email}'", array('email' => $email)), 'Content' => "<p>" . _t('Security.PASSWORDSENTTEXT', "Thank you! A reset link has been sent to '{email}', provided an account exists for this email" . " address.", array('email' => $email)) . "</p>", 'Email' => $email));
     //Controller::$currentController = $controller;
     return $customisedController->renderWith(array('Security_passwordsent', 'Security', $this->stat('template_main'), 'BlankPage'));
 }
开发者ID:jareddreyer,项目名称:catalogue,代码行数:29,代码来源:Security.php

示例6: transferlog

 /**
  * Action - Get the latest deploy log
  *
  * @return string
  */
 public function transferlog(SS_HTTPRequest $request)
 {
     $params = $request->params();
     $transfer = DNDataTransfer::get()->byId($params['Identifier']);
     if (!$transfer || !$transfer->ID) {
         throw new SS_HTTPResponse_Exception('Transfer not found', 404);
     }
     if (!$transfer->canView()) {
         return Security::permissionFailure();
     }
     $environment = $transfer->Environment();
     $project = $environment->Project();
     if ($project->Name != $params['Project']) {
         throw new LogicException("Project in URL doesn't match this deploy");
     }
     $log = $transfer->log();
     if ($log->exists()) {
         $content = $log->content();
     } else {
         $content = 'Waiting for action to start';
     }
     $sendJSON = strpos($request->getHeader('Accept'), 'application/json') !== false || $request->getExtension() == 'json';
     $content = preg_replace('/(?:(?:\\r\\n|\\r|\\n)\\s*){2}/s', "\n", $content);
     if ($sendJSON) {
         $this->response->addHeader("Content-type", "application/json");
         return json_encode(array('status' => $transfer->ResqueStatus(), 'content' => $content));
     } else {
         $this->response->addHeader("Content-type", "text/plain");
         return $content;
     }
 }
开发者ID:adrexia,项目名称:deploynaut,代码行数:36,代码来源:DNRoot.php

示例7: readFile

 /**
  * Read a file and output its contents.
  *
  * SideEffects:
  *  Sets Content-Type: text/plain header.
  *  Outputs file contents to output buffer via readfile, so can't echo ReplicantProgressLogEntry here.
  *
  * @param SS_HTTPRequest $request
  * @internal param $id
  * @return bool|int false if fails, otherwise number of bytes read
  */
 protected function readFile(SS_HTTPRequest $request)
 {
     $options = array('FileName' => $request->param('ID') . ($request->getExtension() ? '.' . $request->getExtension() : ''));
     return ReplicantActionReadFile::create()->checkPerm()->update($options)->execute();
 }
开发者ID:helpfulrobot,项目名称:govtnz-replicant,代码行数:16,代码来源:ReplicantController.php

示例8: passwordsent

 /**
  * Show the "password sent" page, after a user has requested
  * to reset their password.
  *
  * @param SS_HTTPRequest $request The SS_HTTPRequest for this action.
  * @return string Returns the "password sent" page as HTML code.
  */
 public function passwordsent($request)
 {
     $controller = $this;
     // if the controller calls Director::redirect(), this will break early
     if (($response = $controller->getResponse()) && $response->isFinished()) {
         return $response;
     }
     $email = Convert::raw2xml(rawurldecode($request->param('ID')) . '.' . $request->getExtension());
     return $this->customiseSummitPage(array('Title' => 'Password Reset Link Sent', 'Email' => $email, 'ClassName' => 'SummitLostPassword'))->renderWith(array('SummitSecurity_passwordsent', 'SummitPage'), $this);
 }
开发者ID:rbowen,项目名称:openstack-org,代码行数:17,代码来源:SummitSecurity.php


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