Re: editing registry.php directly

Michael J Rubinsky <[email protected]> Tue, 29 Nov 2016 16:42:14 +0000
Newsgroups gmane.comp.horde.devel
Message-ID <20161129164214.Horde.axxxDkcsoviZbJHpj-wtHQc@h4.theupstairsroom.com>
Quoting Sebastian Birnbach <[email protected]>:

> To change the order of entries in the topbar, I wrote some code for
> registry.local.php. It stores the items, removes them and puts them back in
> an order I like better:
>
> $wicked = $this->applications['wicked'];
> $turba = $this->applications['turba'];
> $nag = $this->applications['nag'];
>
> unset ($this->applications['wicked']);
> unset ($this->applications['turba']);
> unset ($this->applications['nag']);
>
> $this->applications['turba'] = $turba;
> $this->applications['nag'] = $nag;
> $this->applications['wicked'] = $wicked;
>
> The code works nicely but I am concerned about performance as it may be
> executed once upon every request.
>
>
> Question 1: is it any better to put this code in config/registry.d/foo.php,
> which file will not be re-read upon every request?

The registry data is cached. It's only reloaded if the modification  
times of the file in question has changed. So, it really doesn't  
matter where you put it. If you already have a .local file anyway, I  
would place it in there to avoid the extra stat on the additional file.

> Question 2: is it acceptable to edit registry.php directly to obtain the
> desired order? I suspect one main reason for prohibiting editing
> registry.php is that it may be parsed and manipulated. The parsing routines
> should not rely on the order of the entries, do they?

The main reason for this is because registry.php (and just about every  
other configuration file) is overwritten when upgrading while the  
*.local.php files are not.



> Kind regards
>
>   Sebastian
> --
> dev mailing list
> Frequently Asked Questions: http://wiki.horde.org/FAQ
> To unsubscribe, mail: [email protected]



-- 
mike
The Horde Project
http://www.horde.org
https://www.facebook.com/hordeproject
https://www.twitter.com/hordeproject

-- 
dev mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: [email protected]
smime.p7s (application/pkcs7-signature, 2 KB) - not displayed