Miscellaneous ⇒ Chit-Chat ⇒ Class names conflict with installer classes possible ? ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexChit-Chat

Class names conflict with installer classes possible ? Reply to topic


Hello,

i asked myself what effets could occur if a module has defined a class in the module itself with the same class name as defined in the cpg_inst.php file.

As most will have a module "ModuleName" that defines a class "ModuleName" and has a cpg_inst.php with a class "ModuleName"

I did not noticed any issues, i was just wondering about that.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache/MySQL 5.1.49/PHP 5.3.6/ DF 9.3.2.0


There it will be issues in admin modules and the credits page, we thought already about this, we just didn't come up with a plan yet.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


why not simply define the installer class as "ModuleName_install" ?

I guess if it would have been as simple as that it had allready be done Smile

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache/MySQL 5.1.49/PHP 5.3.6/ DF 9.3.2.0


Compatibility for existing modules!

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache/MySQL 5.1.49/PHP 5.3.6/ DF 9.3.2.0


hmmm, this gives me a lot of work to fix.

Could you please give me more details about the possible issues.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache/MySQL 5.1.49/PHP 5.3.6/ DF 9.3.2.0


Generally it's just plain wrong having two scripts using the same class name.

We basing v10 on the autoloader and as of today no modules classes are considered unless the class it self its placed in proper locations inside /includes.

We COULD use Dragonfly_Module_Statistics to load the module's main class and leave the installer as it is, unless we decide to autoload installers as well.

In the latter case, we SHOULD use Module_Statistics for the main class and Module_Statistics_Installer for the installer. Compatibility issues will raise in this case.

Both methods will remove the ability to share module classes when you multi-install a module, unless the module place the class in /includes, class name will be forced in this case.

Both methods will create issues with, for example, Module_Your_Account ...

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS

All times are UTC


Jump to: