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

remove some code duplication from syntax plugins #496

Merged
merged 2 commits into from Jan 19, 2014
Merged

Conversation

splitbrain
Copy link
Collaborator

Until now syntax plugins did not inherit from DokuPlugin but instead duplicated quite a bit of code from it. This should make the code easier to maintain.

This makes Doku_Parser_Mode inherit from DokuWiki_Plugin which allows
for the removal of a bunch of duplicate code form
DokuWiki_Syntax_Plugin. This makes the code easier to maintain and makes
sure all DokuWiki plugins are actual instances of DokuWiki_Plugin.

However this adds a bunch of functions to the "normal" parser modes that
don't need them which could have performance/RAM implications.
This reads some duplication in the from of haveing a Doku_Parser_Mode
and Doku_Parser_Mode_Plugin class which are basically the same but only
the latter extends DokuWiki_Plugin. This avoids the performance/RAM
problems mentioned in my previous commit. An interface keeps both
logically together.

With PHP 5.4 further deduplication could be done via Traits.
splitbrain added a commit that referenced this pull request Jan 19, 2014
remove some code duplication from syntax plugins
@splitbrain splitbrain merged commit 48e8e6f into master Jan 19, 2014
@splitbrain splitbrain deleted the plugindedup branch January 19, 2014 19:39
@Klap-in
Copy link
Collaborator

Klap-in commented Jan 20, 2014

After update of master branch:
PHP Fatal error: Class 'Doku_Parser_Mode_Plugin' not found in /.../.../.../dokuwiki/lib/plugins/syntax.php on line 15

@Klap-in
Copy link
Collaborator

Klap-in commented Jan 20, 2014

PHP Version 5.5.3-1ubuntu2.1
Doku_Parser_Mode_Plugin exists in inc/parser/parser.php and my IDEA Intellij doesn't complain about missing classes or something like that. Have others this issue as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants