Skip to content
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
Merged

Local configuration negation #1158

merged 6 commits into from May 19, 2015

Conversation

@Chris--S
Copy link
Collaborator

@Chris--S 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 3 commits May 17, 2015
This applies to:
- acronyms
- entities
- interwiki
- mime
- smileys
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
Copy link
Collaborator

@michitux 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
Copy link
Collaborator Author

@Chris--S Chris--S commented May 18, 2015

patch pushed to address @michitux concern.

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

@scrutinizer-notifier
Copy link

@scrutinizer-notifier 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
Copy link
Owner

@splitbrain 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
Copy link
Collaborator Author

@Chris--S 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
Copy link
Owner

@splitbrain splitbrain commented May 19, 2015

ah. good to merge then :-)

splitbrain added a commit that referenced this pull request May 19, 2015
Local configuration negation
@splitbrain splitbrain merged commit 3bc8c0d into master May 19, 2015
2 checks passed
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
Copy link
Collaborator

@Klap-in 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants