You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my module I have a separated php files which are in their own namespace but other than \ProcessWire. That is a problem because these files are not therefore compiled.
These files should be compiled as well. I'm not sure if it is complicated for you.
The text was updated successfully, but these errors were encountered:
uiii
changed the title
Files with namespace other than \ProcessWire won't compile
Files with namespace other than \ProcessWire won't compile
Aug 25, 2016
ProcessWire just supports compilation of modules that don't already have a namespace. The purpose of it is only to support that most PW 2.x modules continue to work in 3.x. Or to put it another way, the FileCompiler was built specifically to deal with non-namespaced files in order to make them compatible with the ProcessWire namespace. If it sees a file that already has a namespace, then it leaves it alone. I think the module you linked might be the only example I've seen of a 2.x module using namespaces in files that reference PW classes (which is good to see btw). If this were the case for lots and lots of modules, then no doubt we would have had to make the FileCompiler something entirely different than it is. So this is one case where the module probably has to be adjusted to support PW3. I've had to do the same with a couple of mine as well, and it's not unexpected for this to be the case now and then given the scope of the change between 2.x and 3.x. If I can be of any assistance in updating your module for PW3 support, please let me know and I'm happy to assist.
Yes, I understand the purpose of compiling and I agree.
The solution for my problem I see is to compile all files that have namespace other than \ProcessWire including no namespace. Will this be difficult or will it raise any issues?
So if I want to support PW 3.x as well as 2.x I have to get rid of the custom namespace or make two versions of the module?
In my module I have a separated php files which are in their own namespace but other than
\ProcessWire
. That is a problem because these files are not therefore compiled.Look here: https://github.com/uiii/ProcessWire-FieldtypePDF/blob/ec18e7d731da8f2113e356688ec97334c393a5e9/FieldtypePDF/PagePDF.php
These files should be compiled as well. I'm not sure if it is complicated for you.
The text was updated successfully, but these errors were encountered: