splitbrain / dokuwiki-plugin-dw2pdf

A fork of Luigi Micco's PDF export plugin for DokuWiki
http://www.dokuwiki.org/plugin:dw2pdf
55 stars 68 forks source link

require autoloader #495

Closed Klap-in closed 1 year ago

Klap-in commented 1 year ago

recent cleanup #494 removed all the requires. As long DokuWiki does not autoload vendor, a plugin has to do it.

@splitbrain or do I overlook something?

splitbrain commented 1 year ago

Hmm, I had moved the require to the constructor...

Klap-in commented 1 year ago

to solve this, I suppose?

FILE: ...2pdf/dokuwiki-plugin-dw2pdf/lib/plugins/dw2pdf/DokuPDF.class.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | WARNING | A file should declare new symbols (classes, functions,
   |         | constants, etc.) and cause no other side effects, or
   |         | it should execute logic with side effects, but should
   |         | not do both. The first symbol is defined on line 19
   |         | and the first side effect is on line 9.
   |         | (PSR1.Files.SideEffects.FoundWithSymbols)
----------------------------------------------------------------------
Klap-in commented 1 year ago

There was a fix somewhere in the tests for the autoload

Klap-in commented 1 year ago

https://github.com/splitbrain/dokuwiki-plugin-dw2pdf/blob/f2422a57d51f721747b15f0b91a8900abc106ed3/DokuPDF.class.php#L25-L32

Is this not too late, because this class inherits also from the mPdf class?

splitbrain commented 1 year ago

Yeah, it was to fix the PSR side effects rule... but you're right, it's probably too late there. Might work moving the require to the action.php's constructor

Klap-in commented 1 year ago

Updated, fixes #496