本文整理汇总了PHP中Gems_Util::getCurrentURI方法的典型用法代码示例。如果您正苦于以下问题:PHP Gems_Util::getCurrentURI方法的具体用法?PHP Gems_Util::getCurrentURI怎么用?PHP Gems_Util::getCurrentURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gems_Util
的用法示例。
在下文中一共展示了Gems_Util::getCurrentURI方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Should handle execution of the task, taking as much (optional) parameters as needed
*
* The parameters should be optional and failing to provide them should be handled by
* the task
*/
public function execute($trackId = null, $exportOrganizations = false)
{
$versions = $this->loader->getVersions();
$data = array('gems_version' => $versions->getGemsVersion(), 'project' => $this->project->getName(), 'project_env' => APPLICATION_ENV, 'project_url' => $this->util->getCurrentURI(), 'project_version' => $versions->getProjectVersion());
// Main version data
$this->exportTypeHeader('version', false);
$this->exportFieldHeaders($data);
$this->exportFieldData($data);
$this->exportFlush();
}
示例2: getLoginUrl
/**
* Return org dependent login url
*
* @return string
*/
public function getLoginUrl()
{
if ($base = $this->_get('base_url')) {
return $base;
} else {
return $this->util->getCurrentURI();
}
}
示例3: getOrganizationIdByUrl
/**
* Returns the current organization according to the current site url.
*
* @static array $url An array of url => orgId values
* @return int An organization id or null
*/
public function getOrganizationIdByUrl()
{
static $urls;
if (!is_array($urls)) {
if ($this->cache) {
$cacheId = GEMS_PROJECT_NAME . '__' . get_class($this) . '__organizations_url';
$urls = $this->cache->load($cacheId);
} else {
$cacheId = false;
}
// When we don't use cache or cache reports 'false' for a miss or expiration
// then try to reload the data
if ($cacheId === false || $urls === false) {
$urls = array();
try {
$data = $this->db->fetchPairs("SELECT gor_id_organization, gor_url_base FROM gems__organizations WHERE gor_active=1 AND gor_url_base IS NOT NULL");
} catch (\Zend_Db_Exception $zde) {
// Table might not be filled
$data = array();
}
foreach ($data as $orgId => $urlsBase) {
foreach (explode(' ', $urlsBase) as $url) {
if ($url) {
$urls[$url] = $orgId;
}
}
}
if ($cacheId) {
$this->cache->save($urls, $cacheId, array('organization', 'organizations'));
}
}
// \MUtil_Echo::track($urls);
}
$current = $this->util->getCurrentURI();
if (isset($urls[$current])) {
return $urls[$current];
}
}
示例4: calculateReturnUrl
/**
* Returns the full url Gems should forward to after survey completion.
*
* This fix allows multiple sites with multiple url's to share a single
* installation.
*
* @return string
*/
protected function calculateReturnUrl()
{
$currentUri = $this->util->getCurrentURI();
/*
// Referrer would be powerful when someone is usng multiple windows, but
// the loop does not always provide a correct referrer.
$referrer = $_SERVER["HTTP_REFERER"];
// If a referrer was specified and that referral is from the current site, then use it
// as it is more dependable when the user has multiple windows open on the application.
if ($referrer && (0 == strncasecmp($referrer, $currentUri, strlen($currentUri)))) {
return $referrer;
// \MUtil_Echo::track($referrer);
} // */
// Use the survey return if available.
$surveyReturn = $this->loader->getCurrentUser()->getSurveyReturn();
if ($surveyReturn) {
// Do not show the base url as it is in $currentUri
$surveyReturn['NoBase'] = true;
// Add route reset to prevet the current parameters to be
// added to the url.
$surveyReturn['RouteReset'] = true;
// \MUtil_Echo::track($currentUri, \MUtil_Html::urlString($surveyReturn));
return $currentUri . \MUtil_Html::urlString($surveyReturn);
}
// Ultimate backup solution for return
return $currentUri . '/ask/forward/' . \MUtil_Model::REQUEST_ID . '/' . urlencode($this->getTokenId());
}