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


PHP CopixUrl::parse方法代碼示例

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


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

示例1: testParse

 public function testParse()
 {
     $testUrl = "test.php?var=value";
     CopixConfig::instance()->significant_url_mode = 'default';
     $this->assertContains("value", CopixUrl::parse($testUrl, true));
     CopixConfig::instance()->significant_url_mode = 'prepend';
     $this->assertContains("value", CopixUrl::parse($testUrl, true));
 }
開發者ID:JVS-IS,項目名稱:ICONITO-EcoleNumerique,代碼行數:8,代碼來源:copixtest_copixurltest.class.php

示例2: __construct

 /**
  * Construction du controller
  * @param   string  $configFile     chemin du fichier de configuration du projet
  */
 public function __construct($configFile)
 {
     self::$_instance = $this;
     // creating CopixConfig Object and includes the asked configuration file.
     $config = CopixConfig::instance();
     require $configFile;
     if ($config->copixerrorhandler_enabled) {
         Copix::setErrorHandler(new CopixErrorHandler($config));
     }
     CopixRequest::setRequest(array_merge(array('module' => 'default', 'group' => 'default', 'action' => 'default'), CopixUrl::parse(CopixUrl::getRequestedPathInfo(), false, true)));
     // do what we need for each plugin before starting the session
     $this->_beforeSessionStart();
     if ($config->sessionName != null) {
         session_name($config->sessionName);
     }
     session_start();
     $config->afterSessionStart();
 }
開發者ID:JVS-IS,項目名稱:ICONITO-EcoleNumerique,代碼行數:22,代碼來源:CopixController.class.php

示例3: CopixCoordination

 /**
  * It set many properties of the object, get all GET and POST parameters, and start session.
  * @param   string  $configFile     chemin du fichier de configuration du projet
  */
 function CopixCoordination($configFile)
 {
     // register itself in the global variable.
     $GLOBALS['COPIX']['COORD'] =& $this;
     // creating CopixConfig Object and includes the asked configuration file.
     $GLOBALS['COPIX']['CONFIG'] =& CopixConfig::instance();
     require $configFile;
     /**
      * EXPERIMENTAL : support des URLs significatifs
      */
     $scriptNameAndPath = $_SERVER['SCRIPT_NAME'];
     //condidering : http://mysite.com/subdir/index.php/mypath/myaction?myparams=myvalues
     //following is subdir/
     $GLOBALS['COPIX']['CONFIG']->significant_url_script_path = substr($scriptNameAndPath, 0, strrpos($scriptNameAndPath, '/')) . '/';
     //following is index.php
     $GLOBALS['COPIX']['CONFIG']->significant_url_script_name = substr($scriptNameAndPath, strrpos($scriptNameAndPath, '/') + 1);
     //following is mysite.com
     $GLOBALS['COPIX']['CONFIG']->significant_url_domain = $_SERVER['HTTP_HOST'];
     //following is http://mysite.com/subdir/
     $GLOBALS['COPIX']['CONFIG']->significant_url_basepath = 'http://' . $GLOBALS['COPIX']['CONFIG']->significant_url_domain . $GLOBALS['COPIX']['CONFIG']->significant_url_script_path;
     //following is index.php/mypath/myaction
     if (isset($_SERVER['PATH_INFO'])) {
         $pathinfo = $_SERVER['PATH_INFO'];
         $pos = strpos($_SERVER['PATH_INFO'], $GLOBALS['COPIX']['CONFIG']->significant_url_script_path . $GLOBALS['COPIX']['CONFIG']->significant_url_script_name);
         if ($pos !== false) {
             //under IIS, we may get as PATH_INFO /subdir/index.php/mypath/myaction (wich is incorrect)
             $pathinfo = substr($_SERVER['PATH_INFO'], strlen($GLOBALS['COPIX']['CONFIG']->significant_url_script_path . $GLOBALS['COPIX']['CONFIG']->significant_url_script_name));
         }
     } else {
         $pathinfo = substr($_SERVER["PHP_SELF"], strlen($_SERVER['SCRIPT_NAME']));
     }
     $GLOBALS['COPIX']['CONFIG']->significant_url_path_info = $pathinfo;
     /**
      * Fin de "en développement / Test"
      */
     if ($GLOBALS['COPIX']['CONFIG']->errorHandlerOn) {
         $ficEH = COPIX_CONFIG_PATH . $GLOBALS['COPIX']['CONFIG']->errorHandlerConfigFile;
         if (file_exists($ficEH)) {
             require_once COPIX_CORE_PATH . 'CopixErrorHandler.lib.php';
             $GLOBALS['COPIX']['CONFIG']->errorHandler = new CopixErrorHandlerConfig();
             require $ficEH;
             set_error_handler('CopixErrorHandler');
         }
     }
     // registering and creating plugins.
     foreach ($GLOBALS['COPIX']['CONFIG']->plugins as $name => $conf) {
         // pour create, on ne donne pas $conf, car le foreach fait une copie du tableau plugins pour le parcourir
         // et cela ne prend donc pas en compte les eventuelles modifs effectuées dans plugins par un plugin,
         // notament dans debug, si celui ci précise un fichier de conf spécifique
         if ($plug =& CopixPluginFactory::create($name, $GLOBALS['COPIX']['CONFIG']->plugins[$name])) {
             $this->plugins[strtolower($name)] =& $plug;
         }
     }
     $this->url =& new CopixUrl($_SERVER['SCRIPT_NAME'], $_GET, $GLOBALS['COPIX']['CONFIG']->significant_url_path_info);
     $this->vars = CopixUrl::parse($GLOBALS['COPIX']['CONFIG']->significant_url_path_info, false, true);
     // do what we need for each plugin before starting the session
     $this->_beforeSessionStart();
     session_start();
 }
開發者ID:BackupTheBerlios,項目名稱:phpannu-svn,代碼行數:63,代碼來源:CopixCoordination.class.php


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