1
irmtfan
xoops257 , 256 and xoops26 bug: xoops_version.php of all modules will be included more than once.
  • 2013/5/28 4:46

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


It is an obvious bug.
just put a echo in one modules/MODULE/xoops_version.php and see yourself.
It has a bad impact on site performance. specially it is worse in update and install processes when a module has some special scripts and functionality.

To solve this you should add one static $modVersions to store $modversion from all modules to avoid include xoops_version.php more than one time in XOOPS257|XOOPS256|Xoops26/kernel/module.php in loadInfo function
function loadInfo($dirname$verbose true)
    {
        
// START irmtfan add static $modVersions to store $modversion from all modules to avoid include xoops_version.php more than one time
        
static $modVersions;
        if(isset(
$modVersions[$dirname])) {
            
$this->modinfo $modVersions[$dirname];
            return 
true;
        }
        
// END irmtfan add static $modVersions to store $modversion from all modules to avoid include xoops_version.php more than one time
        
$dirname basename($dirname);
        global 
$xoopsConfig;
        if (
file_exists($file $GLOBALS['xoops']->path('modules/' $dirname '/language/' $xoopsConfig['language'] . '/modinfo.php'))) {
            include_once 
$file;
        } else if (
file_exists($file $GLOBALS['xoops']->path('modules/' $dirname '/language/english/modinfo.php'))) {
            include_once 
$file;
        }

        if (!
file_exists($file $GLOBALS['xoops']->path('modules/' $dirname '/xoops_version.php'))) {
            if (
false != $verbose) {
                echo 
"Module File for $dirname Not Found!";
            }
            return 
false;
        }
        include 
$file;
        
$this->modinfo $modVersions[$dirname] = $modversion;// irmtfan add static $modVersions
        
return true;
    }

It is a bug in xoops 26 alpha too.
Of course it is a bug in xoops256 xoops 255 and all older versions.

please somebody add this bug to sf.net bug tracker on behalf of me.

2
Mamba
Re: xoops257 , 256 and xoops26 bug: xoops_version.php of all modules will be included more than once.
  • 2013/5/28 5:27

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

Login

Who's Online

298 user(s) are online (49 user(s) are browsing Support Forums)


Members: 0


Guests: 298


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits