# Development tips

**URL:** <https://discourse.equality-tech.com/t/development-tips/234>\
**Category:** Development\
**Created:** [March 7, 2018, 12:22am UTC](https://discourse.equality-tech.com/t/development-tips/234 "2018-03-07T00:22:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eqt](https://discourse.equality-tech.com/user_avatar/discourse.equality-tech.com/eqt/32/16_2.png) [@eqt](https://discourse.equality-tech.com/u/eqt)\
**Post date:** [March 7, 2018, 12:22am UTC](https://discourse.equality-tech.com/t/development-tips/234/1 "2018-03-07T00:22:58Z")

</div>

One thing that you can do in development (and even production for relatively low-volume wikis) is to invalidate caches whenever there are changes to LocalSettings.php

In previous versions of MediaWiki, this was done by default in “LocalSettings.php” using the following code:

```php
$wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) );

```

and there is the similar boolean variable [$wgInvalidateCacheOnLocalSettingsChange](https://www.mediawiki.org/wiki/Manual:%24wgInvalidateCacheOnLocalSettingsChange)

---

<div class="post-metadata">

**Author:** ![eqt](https://discourse.equality-tech.com/user_avatar/discourse.equality-tech.com/eqt/32/16_2.png) [@eqt](https://discourse.equality-tech.com/u/eqt)\
**Post date:** [March 7, 2018, 3:31pm UTC](https://discourse.equality-tech.com/t/development-tips/234/2 "2018-03-07T15:31:13Z")

</div>

## Too many configuration files?

Find out what is set, and where with these one-liners.

```bash
# Show a list of what php variables are set in the MezaLocalExtensions.yml
grep --perl-regexp --only-matching "^\s*(\\\$[^\[]+)" MezaLocalExtensions.yml | sed -e "s/^[[:space:]]*//" | sort -u 

# Or more generally, all files in the configuration directory
find /opt/conf-meza/public -name '*yml' -o -name '*php' -exec bash -c 'echo -e "\n$0\n"; grep --perl-regexp --only-matching "^\s*(\\\$[^\[]+)" '{}' | sed -e "s/^[[:space:]]*//" | sort -u ' '{}' \;

# Just looking for one variable?
grep -r wgCacheEpoch /opt/.deploy-meza/ /opt/conf-meza/ /opt/htdocs/w/LocalSettings.php 2>/dev/null
# Above, we send errors to the bit bucket because you'll always get permission errors searching 
# in /opt/conf-meza/secret/ (and users)
# Or, just --exclude those directories from the grep
grep -r wgCacheEpoch --exclude-dir secret --exclude-dir users /opt/.deploy-meza/ /opt/conf-meza/ /opt/htdocs/w/LocalSettings.php

```

---

<div class="post-metadata">

**Author:** ![eqt](https://discourse.equality-tech.com/user_avatar/discourse.equality-tech.com/eqt/32/16_2.png) [@eqt](https://discourse.equality-tech.com/u/eqt)\
**Post date:** [March 18, 2018, 8:14pm UTC](https://discourse.equality-tech.com/t/development-tips/234/3 "2018-03-18T20:14:11Z")

</div>

If you are making repeated deploys, you may want to add a line in `/src/roles/mediawiki/tasks/main.yml` of `force: no` for tasks like “Ensure core meza extensions installed” so that you don’t have to wait for each extension repo to be queried and fetched. Note: you can also just skip installing extensions if you aren’t dealing with any extension code. `meza deploy monolith --skip-tags extensions,core-extensions,smw-data,search-index`
