[dev] editing registry.php directly

Sebastian Birnbach birnbacs at gmail.com
Tue Nov 29 16:10:09 UTC 2016


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?

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?


Kind regards

  Sebastian


More information about the dev mailing list