tags:

views:

40

answers:

2
 $this->_config = parse_ini_file($configIniFile);

And this is the content of $configIniFile

; <?php exit; ?> DO NOT REMOVE THIS LINE
[database]
host                 = localhost
username             = root
password             = 
dbname               = openslopeone
port                 = 3306
adapter              = PDO_MYSQL ; PDO_MYSQL or MYSQLI
+1  A: 

The parse_ini_file function parses a configuration file (much like the one you have above). The ini file starts with a <?php exit; ?> to ensure that if the configuration file is loaded it won't execute any code. The ini file you are using apparently defines SQL connection information.

Andrew Hare
Might be useful to say if the configuration file is requested (i.e. via http), php will just exit and not display the file contents.
Tim Post
+2  A: 

http://php.net/manual/en/function.parse-ini-file.php

It simply declares the configuration from an ini file within an array.

The exit function exists, so the configuration file cannot be read directly from a browser, (with a leading ; to comment it out).

CodeJoust