1
wishcraft
Not Executing: function xoops_module_pre_install_dirname()

I am working on a bug ticketing module, for release in a number of weeks, for some reason in XOOPS 2.5.9 I am not sure how long this bug has existed by for example in xoops_version.php the following is specified:

$modversion['onInstall']                 = "include/install.php";
$modversion['onUpdate']                 = "include/onupdate.php";
$modversion['onUninstall']                 = "include/uninstall.php";


and in include/install.php the following function is specified but not being called by the installation in system:-

function xoops_module_pre_install_tickets($module) {
    ....
}


the problem is the call is incorrect on line 98 of /system/admin/modulesadmin/modulesadmin.php when backtracking it for some reason the call for single parthensis is being used in double quote

ie with the code
$func "xoops_module_pre_install_{$dirname}";


Should read as follows
$func "xoops_module_pre_install_$dirname";


it doesn't require double brackets from PHP 2

2
iHackCode
Re: Not Executing: function xoops_module_pre_install_dirname()

What version of PHP were you using?

3
zyspec
Re: Not Executing: function xoops_module_pre_install_dirname()
  • 2017/12/5 22:03

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


@wishcraft,

I haven't checked to see if the pre_install function is being called but the line you called out above is perfectly valid. The "double brackets" (curly braces) {} is only there for code clarity and does not affect the string's interpretation by the PHP compiler. If the string's within the double-quote then the brackets are preferred by most PHP coding standards.

In fact, it makes it much easier to read if you want to include an array element in the string directly. Something like:
$myVar "This is a string that identifies a value from the array:  {$someArray['anIndex']}";

Login

Who's Online

370 user(s) are online (291 user(s) are browsing Support Forums)


Members: 0


Guests: 370


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