Admidio / admidio

Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.
https://www.admidio.org
GNU General Public License v2.0
336 stars 131 forks source link

Check compatibility for PHP 7.0 #175

Closed sirnone closed 9 years ago

sirnone commented 9 years ago

we should check if our Code will work with the new version of PHP that come end of 2015. many hosting services will upgrade in a short time period i think, because the new Version is more then 50% faster on the same Hardware (this is a big cost-factor for them)

Big Projects like Wordpress and Joomla are already prepared for it because of this.

we can use for a general test: https://github.com/Alexia/php7mar

Fasse commented 9 years ago

I found two documentations: https://blog.engineyard.com/2015/what-to-expect-php-7 https://wiki.php.net/rfc/remove_deprecated_functionality_in_php7

With our switch to PDO in the master we have done the major step. As I have understand all the other things of the deprecated and removed functions we don't use. (but please also check this)

Maybe the problem with the uniform variable syntax and the example $obj->$properties['name'] could be a problem.

ximex commented 9 years ago

Report of php7mar without libs directory (master branch)

# critical
#### /home/thomas/GitHub/admidio/adm_program/installation/db_scripts/upd_2_2_11_conv.php
* deprecatedFunctions
 * Line 29: `    while($row = mysql_fetch_object($result))`
 * Line 62: `while($row = mysql_fetch_array($result))`

# nuance
#### /home/thomas/GitHub/admidio/adm_program/modules/ecards/ecards.php
* arrayValueByReference
 * Line 51: `    $_SESSION['photo_album'] =& $photo_album;`

#### /home/thomas/GitHub/admidio/adm_program/modules/photos/photo_function.php
* arrayValueByReference
 * Line 142: `    $_SESSION['photo_album'] =& $photo_album;`

#### /home/thomas/GitHub/admidio/adm_program/modules/photos/photo_presenter.php
* arrayValueByReference
 * Line 39: `    $_SESSION['photo_album'] =& $photoAlbum;`

#### /home/thomas/GitHub/admidio/adm_program/modules/photos/photo_show.php
* arrayValueByReference
 * Line 48: `    $_SESSION['photo_album'] =& $photoAlbum;`

#### /home/thomas/GitHub/admidio/adm_program/modules/photos/photos.php
* arrayValueByReference
 * Line 54: `    $_SESSION['photo_album'] =& $photoAlbum;`

#### /home/thomas/GitHub/admidio/adm_program/system/classes/language.php
* funcGetArg
 * Line 123: `            $paramArray = func_get_args();`

#### /home/thomas/GitHub/admidio/adm_program/system/common.php
* arrayValueByReference
 * Line 122: `    $_SESSION['gCurrentSession'] =& $gCurrentSession;`

#### /home/thomas/GitHub/admidio/adm_program/system/file_upload.php
* arrayValueByReference
 * Line 46: `        $_SESSION['photo_album'] =& $photoAlbum;`

Report of libs dir:

# critical
#### /home/thomas/GitHub/admidio/adm_program/libs/phpmailer/class.phpmailer.php
* deprecatedFunctions
 * Line 2176: `            $magic_quotes = get_magic_quotes_runtime();`
 * Line 2179: `                    set_magic_quotes_runtime(false);`
 * Line 2191: `                    set_magic_quotes_runtime($magic_quotes);`

#### /home/thomas/GitHub/admidio/adm_program/libs/tcpdf/include/tcpdf_static.php
* deprecatedFunctions
 * Line 128: `          @set_magic_quotes_runtime($mqr);`
 * Line 143: `          return @get_magic_quotes_runtime();`

# nuance
#### /home/thomas/GitHub/admidio/adm_program/libs/tcpdf/include/barcodes/qrcode.php
* foreachByReference
 * Line 601: `      foreach ($frame as &$frameLine) {`

Note that i got this message in both reports: ERROR! Syntax checking was selected and a PHP binary lower than 7.0.0-dev was specified.

Fasse commented 9 years ago

I fix the problems of Admidio without libs but I don't know whats wrong with func_get_args(). This function is still supported with PHP7.

Now we must look at phpmailer and tcpdf if they get PHP7 compatible releases.

ximex commented 9 years ago

if i understand this right, nuance means that there is a possible error because of change of the behaviour.

From the lib comments:

Using func_get_arg()/func_get_args() after modifying a parameter passed to a function will now return the modified value.

or

Using variables by reference in a foreach statement no longer works the same way.

Fasse commented 9 years ago

I have checked PHPMailer. There the set_magic_quotes calls are behind a PHP version check. get_magic_quotes_runtime is still available in PHP7 so PHPMailer is currently PHP7 ready.

Fasse commented 9 years ago

The same for TCPDF. There is also a version check.

So in my opinion we can close this issue. Admidio should now be PHP7 compatible. @ximex and @sirnone what do you think?

ximex commented 9 years ago

I think the same. And if we found another problem later we open a new issue