當前位置: 首頁>>代碼示例>>PHP>>正文


PHP tao_helpers_Uri::getPath方法代碼示例

本文整理匯總了PHP中tao_helpers_Uri::getPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP tao_helpers_Uri::getPath方法的具體用法?PHP tao_helpers_Uri::getPath怎麽用?PHP tao_helpers_Uri::getPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tao_helpers_Uri的用法示例。


在下文中一共展示了tao_helpers_Uri::getPath方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testUriPath

 public function testUriPath()
 {
     $uri = 'http://www.google.fr';
     $path = tao_helpers_Uri::getPath($uri);
     $this->assertNull($path);
     $uri = 'http://www.google.fr/';
     $path = tao_helpers_Uri::getPath($uri);
     $this->assertEquals($path, '/');
     $uri = 'http://www.google.fr/translate';
     $path = tao_helpers_Uri::getPath($uri);
     $this->assertEquals($path, '/translate');
     $uri = 'http://www.google.fr/translate?word=yes';
     $path = tao_helpers_Uri::getPath($uri);
     $this->assertEquals($path, '/translate');
     $uri = 'http://www.google.fr/translate/funky?word=yes';
     $path = tao_helpers_Uri::getPath($uri);
     $this->assertEquals($path, '/translate/funky');
     $uri = 'http://www.google.fr/translate/funky/?word=yes';
     $path = tao_helpers_Uri::getPath($uri);
     $this->assertEquals($path, '/translate/funky/');
     $uri = 'ftp://sub.domain.filetransfer.ulc.ag.be';
     $path = tao_helpers_Uri::getPath($uri);
     $this->assertNull($path);
     $uri = 'flupsTu8tridoujkek';
     $path = tao_helpers_Uri::getPath($uri);
     $this->assertNull($path);
     $uri = 'http://mytaoplatform/';
     $path = tao_helpers_Uri::getPath($uri);
     $this->assertEquals($path, '/');
 }
開發者ID:nagyist,項目名稱:tao-core,代碼行數:30,代碼來源:UriHelperTest.php

示例2: session

 /**
  * Start the session
  */
 protected function session()
 {
     if (tao_helpers_Context::check('APP_MODE')) {
         // Set a specific ID to the session.
         $request = new Request();
         if ($request->hasParameter('session_id')) {
             session_id($request->getParameter('session_id'));
         }
     }
     // set the session cookie to HTTP only.
     $this->configureSessionHandler();
     $sessionParams = session_get_cookie_params();
     $cookieDomain = true == tao_helpers_Uri::isValidAsCookieDomain(ROOT_URL) ? tao_helpers_Uri::getDomain(ROOT_URL) : $sessionParams['domain'];
     session_set_cookie_params($sessionParams['lifetime'], tao_helpers_Uri::getPath(ROOT_URL), $cookieDomain, $sessionParams['secure'], TRUE);
     session_name(GENERIS_SESSION_NAME);
     if (isset($_COOKIE[GENERIS_SESSION_NAME])) {
         // Resume the session
         session_start();
         //cookie keep alive, if lifetime is not 0
         if ($sessionParams['lifetime'] !== 0) {
             $expiryTime = $sessionParams['lifetime'] + time();
             setcookie(session_name(), session_id(), $expiryTime, tao_helpers_Uri::getPath(ROOT_URL), $cookieDomain, $sessionParams['secure'], true);
         }
     }
 }
開發者ID:swapnilaptara,項目名稱:tao-aptara-assess,代碼行數:28,代碼來源:class.Bootstrap.php


注:本文中的tao_helpers_Uri::getPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。