Does ini pars a file in PHP better than variables defined in the code?

I read about PDO and I came across the parse_ini_file function. A number of developers have suggested using this function to parse db parameters rather than hard-coding db parameters in code for security reasons.

My question is for you: does it make sense to make a file readable for every download of your PHP application for this extra "security"?

I wonder how expensive this file is to read ..

php 5.3 in the comments http://www.php.net/manual/en/class.pdo.php

+3
source share
4 answers

I really don't see how safer it is.

, "config.php" -, , .ini, ( ).

+5

PHP , PHP , , .. . , , .

, PHP . PHP, , .

, PHP ... , , , (, memcache) .

+1

, , db, ini . , 10 3 //. , , php ( ), , , ini/php -.

+1
source

Probably not. If its .ini file, then the browser can just visit it and download it. At least .php has blank screen decency.

+1
source

Source: https://habr.com/ru/post/1781926/


All Articles