dnaextrim / php_zklib

Attendance Machine Library for PHP with a connection to the network using the UDP protocol and port 4370
http://dnaextrim.github.io/php_zklib/
GNU General Public License v2.0
162 stars 135 forks source link

PHP 7.2 Support #30

Open MawiaHL opened 6 years ago

MawiaHL commented 6 years ago

The current codes are not PHP 7.2 compatible. Please can you update the code.

softyaco commented 6 years ago

did you find solution for that .. ?

dnaextrim commented 6 years ago

Hi. I am sorry that I have not been able to develop this library anymore because i busy with my work, so I do not have time to develop this library yet. I try this month I will try to make a video how do I get a command to attendance machine and how do I create this library. So I hope in the future you can modify this library to work with any firmware version of ZK. The video will be uploaded on my youtube. Thank you

MawiaHL commented 6 years ago

Thanks for the reply. I recently looked at Kamshory ZkLibrary, but it does not work well with new Device. It will be very helpful to watch your video. Anxiously waiting for it. I thought it would not be too difficult to make your code compatible with PHP 7.2.

m-elsamman commented 6 years ago

Hello everyone, To make this library work with PHP 7. Just update the while() loop at the line number 90 in zklib.php file because the function each() is deprecated in PHP 7. So, use foreach() loop instead

// while( list( $key ) = each( $u ) ) { $u = $u[$key]; break; } foreach ($u as $val){ $u = $val; break; }

vodvud commented 5 years ago

Hello everyone, To make this library work with PHP 7. Just update the while() loop at the line number 90 in zklib.php file because the function each() is deprecated in PHP 7. So, use foreach() loop instead

// while( list( $key ) = each( $u ) ) { $u = $u[$key]; break; } foreach ($u as $val){ $u = $val; break; }

Make a sense optimize your code

$u = reset($u);