install/includes/payload.php
changeset 857 f3a5a276208c
parent 832 7152ca0a0ce9
child 861 b550f497cdbf
equal deleted inserted replaced
856:0b7ff06aad13 857:f3a5a276208c
   166   return true;
   166   return true;
   167 }
   167 }
   168 
   168 
   169 function stg_write_config()
   169 function stg_write_config()
   170 {
   170 {
   171   global $dbhost, $dbuser, $dbpasswd, $dbname, $dbdriver;
   171   global $dbhost, $dbuser, $dbpasswd, $dbname, $dbdriver, $dbport;
   172   $db_data = array(
   172   $db_data = array(
   173       'host' => str_replace("'", "\\'", $dbhost),
   173       'host' => str_replace("'", "\\'", $dbhost),
   174       'user' => str_replace("'", "\\'", $dbuser),
   174       'user' => str_replace("'", "\\'", $dbuser),
   175       'pass' => str_replace("'", "\\'", $dbpasswd),
   175       'pass' => str_replace("'", "\\'", $dbpasswd),
   176       'name' => str_replace("'", "\\'", $dbname),
   176       'name' => str_replace("'", "\\'", $dbname),
       
   177       'port' => intval($dbport),
   177       'tp' => table_prefix,
   178       'tp' => table_prefix,
   178       'drv' => $dbdriver
   179       'drv' => $dbdriver
   179     );
   180     );
   180   
   181   
   181   // Retrieves the existing key
   182   // Retrieves the existing key
   216 // Database type to use, currently mysql and postgresql are supported
   217 // Database type to use, currently mysql and postgresql are supported
   217 \$dbdriver = '{$db_data['drv']}';
   218 \$dbdriver = '{$db_data['drv']}';
   218 
   219 
   219 // Hostname of your database server, probably localhost
   220 // Hostname of your database server, probably localhost
   220 \$dbhost = '{$db_data['host']}';
   221 \$dbhost = '{$db_data['host']}';
       
   222 
       
   223 // Port number for database server, probably 3306 (MySQL) or 5432 (PostgreSQL)
       
   224 \$dbport = '{$db_data['port']}';
   221 
   225 
   222 // Username used to connect to the database
   226 // Username used to connect to the database
   223 \$dbuser = '{$db_data['user']}';
   227 \$dbuser = '{$db_data['user']}';
   224 // Database password
   228 // Database password
   225 \$dbpasswd = '{$db_data['pass']}';
   229 \$dbpasswd = '{$db_data['pass']}';