Exemplo n.º 1
0
 /**
  * 
  * @param mixed $pmView
  */
 public function httpView($pmView)
 {
     if ($_SERVER['HTTP_ACCEPT'] == 'application/json') {
         header('Content-type: application/json');
         echo json_encode($pmView);
     } else {
         Debug::display($pmView);
     }
 }
Exemplo n.º 2
0
 /**
  * 
  */
 public function createUserDbAction()
 {
     $lsDbDriver = $this->getRequestArg('driver', 'PDOMySql');
     $lsDbCharset = $this->getRequestArg('charset', 'UTF8');
     $lsDbHost = $this->getRequestArg('host', 'localhost');
     $lsDbUser = $this->getRequestArg('user', null, true);
     $lsDbPass = $this->getRequestArg('pass', null, true);
     $lsDbName = $this->getRequestArg('dbname', null, true);
     $lsDbTable = $this->getRequestArg('table', '*');
     $laDbConf = array('driver' => $lsDbDriver, 'charset' => $lsDbCharset, 'hostname' => '', 'port' => '', 'username' => '', 'password' => '', 'database' => '');
     $this->_aRepository['Db'] = new InstallRepository($laDbConf);
     $lsScript = $this->_aRepository['Db']->createUser($lsDbHost, $lsDbUser, $lsDbPass, $lsDbName, $lsDbTable);
     Debug::display($lsScript);
 }