Closed mckaygerhard closed 8 years ago
$rows[] = $res;
is compatible with PHP 5.3.
Also, from the PHP manual:
Note: If you use array_push() to add one element to the array it's better to use $array[] = because in that way there is no overhead of calling a function.
are u sure? i read the php manual, and of course said that its compatible, but the table in configuration->last login are not fill!
i write log of the retun value and does not retun sometigh
the query are good, i sustitue the ip of select and only removed the if conditional , the select returns 8 rows but the array are not fill with those rows (column names date, geo, dns, and from are in right place)
Yes i'm sure :) What is the SQL driver you are using? Also, please try the code with changes i've made today.
i comment in the commit, thanks, this solved the string show to user of location in human readable format.. now correctly said "From Caracas, Venezuela, etc etc"
i used the sqlite, postgres and orafe(oracle/postgres) drivers, in production i used only postgres.
thanks, but i used the array_merge due are only available since php 5.3.10, so this issue still are opened..
so i research more around the arrray changes in php 5.3/5.4 api and report feeedback here!
I'm going to close this issue because i'm pretty sure that the line $rows[] = $res;
is compatible with PHP 5.3 (and previous versions and 5.4 and 5.5). There's no need of array_merge()
ou array_push()
.
in function load_log the return value are seted in a while using a php 5.4 only line code:
$rows[] = $res;
so must be changed to complaint php 5.3 as:array_push($rows, $res)
here: https://github.com/dsoares/Roundcube-Plugin-Lastlogin/blob/master/lastlogin.php#L193
and with that are compatible with php 5.3.3