Example #1
0
 public function set($section, $valor)
 {
     if (trim(session_id()) == "") {
         self::$instance = new self();
     }
     $_SESSION[$section] = Crypt::encrypt($valor);
 }
Example #2
0
 /**
  * Adds new connection data for a DB
  * @param  string $id       
  * @param  string $type     
  * @param  string $host     
  * @param  string $user     
  * @param  string $bdname   
  * @param  string $password 
  * @return none           
  */
 public function app_db($id, $type, $host, $user, $dbname, $password)
 {
     echo 'Registrando base de datos...' . PHP_EOL;
     $config = Reader::get();
     $config['bases'][$id]['type'] = $type;
     $config['bases'][$id]['host'] = $host;
     $config['bases'][$id]['user'] = $user;
     $config['bases'][$id]['dbname'] = $dbname;
     $config['bases'][$id]['password'] = Crypt::encrypt($password);
     Writer::write($config, 'config', 'etc/config/config.xml');
     chmod("./etc/config/config.xml", 0775);
     echo 'OK' . PHP_EOL;
 }