/** * * @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); } }
/** * */ 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); }