本文整理汇总了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));
}
示例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();
}
示例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();
}