Changeset View
Changeset View
Standalone View
Standalone View
branches/5.3.x/core/kernel/managers/url_processor.php
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | |||||
$pass_info = array_unique(explode(',', $pass)); // array( prefix[.special], prefix[.special] ... | $pass_info = array_unique(explode(',', $pass)); // array( prefix[.special], prefix[.special] ... | ||||
// we need to keep that sorting despite the sorting below, because this sorts prefixes with same priority by name | // we need to keep that sorting despite the sorting below, because this sorts prefixes with same priority by name | ||||
sort($pass_info, SORT_STRING); // to be prefix1,prefix1.special1,prefix1.special2,prefix3.specialX | sort($pass_info, SORT_STRING); // to be prefix1,prefix1.special1,prefix1.special2,prefix3.specialX | ||||
foreach ($pass_info as $prefix) { | foreach ($pass_info as $prefix) { | ||||
list ($prefix_only,) = explode('.', $prefix, 2); | list ($prefix_only,) = explode('.', $prefix, 2); | ||||
$sorted[$prefix] = $this->Application->getUnitConfig($prefix_only)->getRewritePriority(0); | |||||
if ( isset($this->Application->routers[$prefix_only]) ) { | |||||
$sorted[$prefix] = (int)$this->Application->routers[$prefix_only]['priority']; | |||||
} | |||||
else { | |||||
$sorted[$prefix] = 0; | |||||
} | |||||
} | } | ||||
asort($sorted, SORT_NUMERIC); | asort($sorted, SORT_NUMERIC); | ||||
$pass_info = array_keys($sorted); | $pass_info = array_keys($sorted); | ||||
// ensure that "m" prefix is at the beginning | // ensure that "m" prefix is at the beginning | ||||
$main_index = array_search('m', $pass_info); | $main_index = array_search('m', $pass_info); | ||||
if ( $main_index !== false ) { | if ( $main_index !== false ) { | ||||
Show All 33 Lines | |||||
* | * | ||||
* @param string $prefix_special item's prefix & [special] | * @param string $prefix_special item's prefix & [special] | ||||
* @param Array $params url params | * @param Array $params url params | ||||
* @param bool $pass_events | * @param bool $pass_events | ||||
* @return string | * @return string | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
abstract protected function BuildModuleEnv($prefix_special, &$params, $pass_events = false); | abstract protected function BuildModuleEnv($prefix_special, &$params, $pass_events = false); | ||||
} | } | ||||
No newline at end of file |