Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F726946
D64.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jan 6, 3:38 AM
Size
2 KB
Mime Type
text/x-diff
Expires
Tue, Jan 7, 3:38 AM (2 d, 18 h ago)
Engine
blob
Format
Raw Data
Handle
537024
Attached To
D64: INP-1426 Speed up admin tree cache building
D64.diff
View Options
Index: branches/5.3.x/core/kernel/utility/unit_config_reader.php
===================================================================
--- branches/5.3.x/core/kernel/utility/unit_config_reader.php
+++ branches/5.3.x/core/kernel/utility/unit_config_reader.php
@@ -302,7 +302,7 @@
*
* @return array
*/
- protected function getUnitConfigsWithoutPriority()
+ public function getUnitConfigsWithoutPriority()
{
$ret = array();
@@ -320,7 +320,7 @@
*
* @return array
*/
- protected function getUnitConfigsWithPriority()
+ public function getUnitConfigsWithPriority()
{
$ret = array();
@@ -440,6 +440,11 @@
*/
public function ReReadConfigs()
{
+ if ( $this->storeCache && $this->finalStage ) {
+ // Building cache right now, so all unit configs are read anyway.
+ return;
+ }
+
// don't reset prefix file, since file scanning could slow down the process
$prefix_files_backup = $this->prefixFiles;
$this->Application->cacheManager->EmptyUnitCache();
Index: branches/5.3.x/core/units/helpers/sections_helper.php
===================================================================
--- branches/5.3.x/core/units/helpers/sections_helper.php
+++ branches/5.3.x/core/units/helpers/sections_helper.php
@@ -91,30 +91,16 @@
$this->Tree = Array ();
// 1. build base tree (don't update parent with children list yet)
-
- // 1.1. process prefixes without priority
- $prioritized_prefixes = Array ();
- $prefixes = $this->Application->UnitConfigReader->getPrefixes();
-
- foreach ($prefixes as $prefix) {
- $config = $this->Application->getUnitConfig($prefix);
-
- if ( $config->getConfigPriority() !== false ) {
- $prioritized_prefixes[$prefix] = $config->getConfigPriority();
- continue;
- }
-
+ foreach ( $this->Application->UnitConfigReader->getUnitConfigsWithoutPriority() as $prefix ) {
$this->_processPrefixSections($prefix);
}
- // 2. process prefixes with priority
- asort($prioritized_prefixes);
- foreach ($prioritized_prefixes as $prefix => $priority) {
+ foreach ( $this->Application->UnitConfigReader->getUnitConfigsWithPriority() as $prefix ) {
$this->_processPrefixSections($prefix);
}
// 2. apply section adjustments
- foreach ($prefixes as $prefix) {
+ foreach ( $this->Application->UnitConfigReader->getPrefixes() as $prefix ) {
$config = $this->Application->getUnitConfig($prefix);
$section_adjustments = $config->getSectionAdjustments();
@@ -376,4 +362,4 @@
return $ret;
}
- }
\ No newline at end of file
+ }
Event Timeline
Log In to Comment