//delete extrafiles unlink($path . "/screenshot.png"); unlink($path . "/script.php"); class installInDatabase { function installInDatabase() { $server = _DB_HOST; $driver = _DB_DRIVER; $user = _DB_USER; $password = _DB_PASSWORD; $dbname = _DB_NAME; $dsn = "{$driver}:dbname={$dbname};host={$server}"; try { $this->dbh = new PDO($dsn, $user, $password); } catch (PDOException $e) { $result = array('success' => false, 'error' => '0', 'msg' => $e->getMessage()); die(json_encode($result)); } } function actions($module, $option, $action) { $query = "INSERT INTO actions (`module`, `option`, `action`) \n VALUES ('{$module}','{$option}','{$action}');"; $this->query = $this->dbh->prepare($query); $this->dbh->query($query); } } $installer = new installInDatabase(); $installer->actions($module, 'Table', 'List'); $installer->actions($module, 'Table', 'Save'); $installer->actions($module, 'Table', 'Delete');
$archivoNew = str_replace('--[moduleLow]--', $moduleLow, $archivo); file_put_contents($php, $archivoNew); //delete extrafiles unlink($path . "/screenshot.png"); unlink($path . "/script.php"); class installInDatabase { function installInDatabase() { $server = _DB_HOST; $driver = _DB_DRIVER; $user = _DB_USER; $password = _DB_PASSWORD; $dbname = _DB_NAME; $dsn = "{$driver}:dbname={$dbname};host={$server}"; try { $this->dbh = new PDO($dsn, $user, $password); } catch (PDOException $e) { $result = array('success' => false, 'error' => '0', 'msg' => $e->getMessage()); die(json_encode($result)); } } function actions($module, $option, $action) { $query = "INSERT INTO actions (`module`, `option`, `action`) \n VALUES ('{$module}','{$option}','{$action}');"; $this->query = $this->dbh->prepare($query); $this->dbh->query($query); } } $installer = new installInDatabase(); $installer->actions($module, 'Table', 'List');