xoops forums

Mamba

Moderator
Posted on: 2018/4/10 1:47
Mamba
Mamba (Show more)
Moderator
Posts: 10760
Since: 2004/4/23
#1

Wfdownloads 3.30 Beta-1 for XOOPS 2.5.9 and PHP 5.6+

Resized Image

The Wfdownloads 3.30 Beta-1 is available for testing on XOOPS 2.5.9 and PHP 5.6.+

New in this version: namespaces, autoloading, various fixes, PHP 7 compatibility (tested on PHP 7.2.4)

You can download it from GitHub.

And you can fork it from GitHub as well, and submit your improvements or bug fixes there.

We encourage everybody to open an account on GitHub and get used to working with Git, as this is the current Industry Standard.

Please note:

a) This version is developed and tested ONLY on XOOPS 2.5.9
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

luciorota

Module Developer
Posted on: 2018/6/9 19:47
luciorota
luciorota (Show more)
Module Developer
Posts: 192
Since: 2007/4/20
#2

Re: Wfdownloads 3.30 Beta-1 for XOOPS 2.5.9 and PHP 5.6+

Hi
I fork to test but I cannot install.

Fatal error: Class 'WfdownloadsUtility' not found in C:\wamp64\www\xoops.259\modules\wfdownloads\include\oninstall.php on line 49

zyspec

Module Developer
Posted on: 2018/6/11 0:34
zyspec
zyspec (Show more)
Module Developer
Posts: 1042
Since: 2004/9/21
#3

Re: Wfdownloads 3.30 Beta-1 for XOOPS 2.5.9 and PHP 5.6+

Unfortunately it looks like Mamba forgot to rewrite part of the install function in the ./include/oninstall.php file. You might try replacing lines 41-64 (the xoops_module_pre_install_wfdownloads function) with:
function xoops_module_pre_install_wfdownloads(XoopsModule $module)
{
    include 
__DIR__ '/common.php';
    
/** @var XoopsModulesWfdownloadsUtility $utility */
    
$utility = new XoopsModulesWfdownloadsUtility();
    
//check for minimum XOOPS version
    
$xoopsSuccess $utility::checkVerXoops($module);
    
// check for minimum PHP version
    
$phpSuccess   $utility::checkVerPhp($module);
    if (
false !== $xoopsSuccess && false !==  $phpSuccess) {
        
$moduleTables =& $module->getInfo('tables');
        foreach (
$moduleTables as $table) {
            
$GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' $GLOBALS['xoopsDB']->prefix($table) . ';');
        }
    }
    return 
$xoopsSuccess && $phpSuccess;
}


That should at least get you past the pre-install check for PHP and XOOPs versions.

heyula

Theme Designer
Posted on: 6/26 17:35
heyula
heyula (Show more)
Theme Designer
Posts: 467
Since: 2008/4/24
#4

Re: Wfdownloads 3.30 Beta-1 for XOOPS 2.5.9 and PHP 5.6+

Quote:

zyspec wrote:
Unfortunately it looks like Mamba forgot to rewrite part of the install function in the ./include/oninstall.php file. You might try replacing lines 41-64 (the xoops_module_pre_install_wfdownloads function) with:
function xoops_module_pre_install_wfdownloads(XoopsModule $module)
{
    include 
__DIR__ '/common.php';
    
/** @var XoopsModulesWfdownloadsUtility $utility */
    
$utility = new XoopsModulesWfdownloadsUtility();
    
//check for minimum XOOPS version
    
$xoopsSuccess $utility::checkVerXoops($module);
    
// check for minimum PHP version
    
$phpSuccess   $utility::checkVerPhp($module);
    if (
false !== $xoopsSuccess && false !==  $phpSuccess) {
        
$moduleTables =& $module->getInfo('tables');
        foreach (
$moduleTables as $table) {
            
$GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' $GLOBALS['xoopsDB']->prefix($table) . ';');
        }
    }
    return 
$xoopsSuccess && $phpSuccess;
}


That should at least get you past the pre-install check for PHP and XOOPs versions.

I get an error in setup
Error: Class 'WfdownloadsUtility' not found

zyspec

Module Developer
Posted on: 6/26 22:09
zyspec
zyspec (Show more)
Module Developer
Posts: 1042
Since: 2004/9/21
#5

Re: Wfdownloads 3.30 Beta-1 for XOOPS 2.5.9 and PHP 5.6+

looks like this forum "ate" the '\' in the previous post...

replace line 5:
$utility = new XoopsModulesWfdownloadsUtility();

with:
$utility = new XoopsModules\Wfdownloads\Utility();

heyula

Theme Designer
Posted on: 6/27 5:01
heyula
heyula (Show more)
Theme Designer
Posts: 467
Since: 2008/4/24
#6

Re: Wfdownloads 3.30 Beta-1 for XOOPS 2.5.9 and PHP 5.6+

@Zyspec
Thanks.