New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local configuration negation #1158

Merged
merged 6 commits into from May 19, 2015

Conversation

Projects
None yet
5 participants
@Chris--S
Collaborator

Chris--S commented May 17, 2015

Allows (non-php) configuration values set earlier in the config cascade to be reversed. E.g. to counter a default configuration value.

For key/value config files (e.g. acronyms), include a key with no value

# to set a value
HTML      hypertext markup language
# to unset a value
HTML

For value only config files (e.g. scheme, stopwords), prefix the value with an exclamation mark, '!'.

# to set a value
gopher
# to unset a value
!gopher

Chris--S added some commits May 17, 2015

Add filtering to remove blank entries from key/value config retrieval
This applies to:
- acronyms
- entities
- interwiki
- mime
- smileys
Support negating of config values include earlier in the cascade
To negate a config value, prefix the value with an '!'.

E.g. to disable recognition of the gopher scheme
!gopher

This applies to:
- scheme
- stopwords
@michitux

This comment has been minimized.

Show comment
Hide comment
@michitux

michitux May 17, 2015

Collaborator

So basically this means that you cannot set any of the configuration values to 0 anymore. I'm not sure if this is useful/if we should keep this possibility. Apart from that: 👍

Collaborator

michitux commented May 17, 2015

So basically this means that you cannot set any of the configuration values to 0 anymore. I'm not sure if this is useful/if we should keep this possibility. Apart from that: 👍

@Chris--S

This comment has been minimized.

Show comment
Hide comment
@Chris--S

Chris--S May 18, 2015

Collaborator

patch pushed to address @michitux concern.

also to make negation using '!' resistant to white space differences.

Collaborator

Chris--S commented May 18, 2015

patch pushed to address @michitux concern.

also to make negation using '!' resistant to white space differences.

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier May 18, 2015

The inspection completed: No new issues

scrutinizer-notifier commented May 18, 2015

The inspection completed: No new issues

@@ -196,7 +208,7 @@ function confToHash($file,$lower=false) {
* @param array $params optional additional params to pass to the callback
* @return array configuration values
*/
function retrieveConfig($type,$fn,$params=null) {
function retrieveConfig($type,$fn,$params=null,$combine='array_merge') {

This comment has been minimized.

@splitbrain

splitbrain May 19, 2015

Owner

the doc block should be adjusted for the new paramter

@splitbrain

splitbrain May 19, 2015

Owner

the doc block should be adjusted for the new paramter

@splitbrain

This comment has been minimized.

Show comment
Hide comment
@splitbrain

splitbrain May 19, 2015

Owner

This means we can no longer have entities starting with a !, right? This is not a theoretical problem. Our current entity.conf on dokuwiki.org has these lines currently:

!cr!  <div style="clear: right; float: right;"></div>
!cl!  <div style="clear: left; float: left;"></div>
!cb!  <div class="clearer"></div>
Owner

splitbrain commented May 19, 2015

This means we can no longer have entities starting with a !, right? This is not a theoretical problem. Our current entity.conf on dokuwiki.org has these lines currently:

!cr!  <div style="clear: right; float: right;"></div>
!cl!  <div style="clear: left; float: left;"></div>
!cb!  <div class="clearer"></div>
@Chris--S

This comment has been minimized.

Show comment
Hide comment
@Chris--S

Chris--S May 19, 2015

Collaborator

No. Entities are key/value conf., so are cleared by putting no value
for the key. Key is unchanged.

Only scheme and stopwords are single value, so needed a different
method, hence using a '!' prefix.

  • Chris
Collaborator

Chris--S commented May 19, 2015

No. Entities are key/value conf., so are cleared by putting no value
for the key. Key is unchanged.

Only scheme and stopwords are single value, so needed a different
method, hence using a '!' prefix.

  • Chris
@splitbrain

This comment has been minimized.

Show comment
Hide comment
@splitbrain

splitbrain May 19, 2015

Owner

ah. good to merge then :-)

Owner

splitbrain commented May 19, 2015

ah. good to merge then :-)

splitbrain added a commit that referenced this pull request May 19, 2015

@splitbrain splitbrain merged commit 3bc8c0d into master May 19, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@splitbrain splitbrain deleted the local_conf_negation branch May 19, 2015

@Klap-in

This comment has been minimized.

Show comment
Hide comment
@Klap-in

Klap-in Jul 1, 2015

Collaborator

Needs still an update of the docs

Collaborator

Klap-in commented Jul 1, 2015

Needs still an update of the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment