Ejemplo n.º 1
0
 public function writeMysqlConfig($mysqlData)
 {
     if ($this->mysqlConfigExists()) {
         return false;
     }
     if (!$this->mysqlConfigWritable()) {
         return false;
     }
     $configTmplPath = '../../.htsecret/etc/tmpl/';
     // from ../tmpl/setup/
     $mysql_cfg = new tmpl('mysql.php', $mysqlData, $configTmplPath);
     $mysql_cfg->data = $mysql_cfg->fdata;
     $mysql_cfg->path .= '../';
     $mysql_cfg->write();
     $mysql_cfg->chmod(0600);
     $random = md5($this->randomString());
     $randomTmplData = array('random' => $random);
     $random_pw = new tmpl('random.php', $randomTmplData, $configTmplPath);
     $random_pw->data = $random_pw->fdata;
     $random_pw->path .= '../';
     $random_pw->write();
     $random_pw->chmod(0600);
     return true;
 }