Hi,

Very good module but some problem when I tried to run the module because of some functions used in the module which are only PHP5.

I made some minor changes to the code to make it working with PHP4.

The code I wrote can be made better by testing if the function which doesn't work is tested for existence : if yes ==> use it, if not use alternative (refer below). The test can be done using "if (!function_exists('file_put_contents')) {...."

in deadwood.conversions.inc :
121,142c121,123
< //if (file_put_contents($filename, $new) === FALSE) {
< // drupal_set_message('File could not be written');
< //}
<
<
<
< //PHP 4 alternative to file_put_contents()
< $fh = @fopen($filename, 'w');
< if ($fh === false) {
< //This probably needs to be changed
< drupal_set_message('File could not be written');
< }
< $data = (string) $new;
< $bytes = fwrite($fh, $data);
< fclose($fh);
<
<
<
<
<
<
<
---
> if (file_put_contents($filename, $new) === FALSE) {
> drupal_set_message('File could not be written');
> }

in deadwood.inc
68c68,73
< $files = scandir($path);
---
> $path2 = opendir($path);
> while (false !== ($filename = readdir($path2)))
> $files[] = $filename;
>
>
>
85c90,96
< $files = scandir($path);
---
>
> $path2 = opendir($path);
> while (false !== ($filename = readdir($path2)))
> $files[] = $filename;
>
>
>

Comments

boombatower’s picture

solotandem’s picture

Assigned: Unassigned » solotandem
Status: Active » Closed (works as designed)

As PHP has dropped support for PHP4 there is no reason to add this compatibility code.