*Question 1*

I see a file called Module.php in a lot of PHP packages. What is it, what
does it do, and why is it there? Who calls it, and how and why does it work?
Are there any hidden magic PHP methods or other packages that call it and
how? Doing short yet reasonable Googling I could not find a good intro and
thorough explanation of all that.

*Question 2*

I see that some packages have two Module.php files. Example: BjyAuthorize
package:

     master/Module.php
<https://github.com/bjyoungblood/BjyAuthorize/blob/master/Module.php>  
     master/src/BjyAuthorize/Module.php
<https://github.com/bjyoungblood/BjyAuthorize/blob/master/src/BjyAuthorize/Module.php>
  

I see that the first module is placed there as per  recommended structure of
a typical MVC-oriented ZF2 module
<http://framework.zend.com/manual/2.2/en/modules/zend.module-manager.intro.html>
 
, so I understand that it is there because it has been defined by ZF2 and
ZF2 has code that expects this Module.php to be there. It would not be there
if ZF2 did not define it. Why would ZF2 create a module system that provides
the need to duplicate this file, when most modules already have a designated
placement for it elsewhere?

*Question 3*

The first Module.php I linked mentions that the 2nd Module.php is there to
support PSR-0. But PSR-0 has no mention of a Module.php file name what so
ever. So I understand that the name of "Module" has nothing special as far
as PSR-0 is concerned, and Module.php is there purely to respect
vendor\Namespace\ClassName paths, and is just like any other class.  Is that
correct?

*Question 4*

What happens if I delete the master/Module.php only and keep the other one
and restructure my code to work using some kind of my own custom
configuration? What is that I will break exactly?

*Question 5*

what happens if I delete the master/src/BjyAuthorize/Module.php only, and
keep the other one, and restructure my code to work using some kind of my
own custom configuration? What is that I will break exactly?

*Question 6*

ZF2 by default creates Application/Module.php and no other Module file. 
Does this mean that ZF2 module system is NOT compliant with PSR-0?  This
can't be so, so why did ZF2 create such a module system to cause duplication
necessity in some cases when there was already an established PSR-0
standard?



--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/What-is-Module-php-and-why-some-packages-have-two-of-them-tp4661261.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to