2p2r / velobs_web

Application web permettant aux cyclistes de signaler les problèmes sur les aménagements cyclables.
GNU General Public License v3.0
22 stars 14 forks source link

87 occurences of mysql_connect #111

Open vinsnet opened 6 years ago

vinsnet commented 6 years ago

mysql_connect(HOST,DB_USER,DB_PASS) was found 87

I would try to rewrote it

vinsnet commented 6 years ago

92 occurrences of mysql_connect

vinsnet commented 6 years ago

I've start to fix this issue, but the problem is deep into the code.

gerald2545 commented 6 years ago

yes, I know..., I get the code some months ago and duplication code was a nightmare (and the work is not finished to clean all of that). Thank you for your help!!

Did you manage to replace all of the mysql_connect stuff?

vinsnet commented 6 years ago

Yes I've done, But i did not create a PR because i can not test it for the moment. I think we could remove duplicate code and upgrade to another database driver... or build an API based on the same database (Laravel, Loopback.js, ...).

gerald2545 commented 6 years ago

just tested, https://github.com/vinsnet/velobs_web/blob/c66f263ade9c11cf262d9168a3c09a29addb60f3/lib/php/database.php#L50 : unexpected var then another : PHP Fatal error: Call to undefined method Database::getIntance() in /save/devcrgs/src/velobs_web/velobs_web/lib/php/public/getJsonStats.php on line 7

I stopped the tests here. Didn't find the problem

fgaroby commented 6 years ago

You call the static function with the wrong name : "getIntance" instead of "getInstance" (with a 's')

gerald2545 commented 6 years ago

you mean "I call the static function with the wrong name : "getIntance" instead of "getInstance" (with a 's')", no? ;) you are right, the "s" is missing in all php files. Can you modify your code (along with DB_HOST and the "var" keyword in database.php) and test it please, then commit and PR?

thank you for your time

PS : oups, I thought it was @vinsnet who answered, sorry @windu2b