[dev] editing registry.php directly

Michael J Rubinsky mrubinsk at horde.org
Tue Nov 29 16:42:14 UTC 2016


Quoting Sebastian Birnbach <birnbacs at gmail.com>:

> 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: dev-unsubscribe at lists.horde.org



-- 
mike
The Horde Project
http://www.horde.org
https://www.facebook.com/hordeproject
https://www.twitter.com/hordeproject
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2007 bytes
Desc: S/MIME Signature
URL: <https://lists.horde.org/archives/dev/attachments/20161129/160163e2/attachment.bin>


More information about the dev mailing list