当前位置: 首页>>代码示例>>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;未经允许,请勿转载。