Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php include_once __DIR__ . '/../../lib/clave_db.php'; class Conexion{ public ..
Decoded Output download
<?php
include_once __DIR__ . '/../../lib/clave_db.php';
class Conexion{
public $dominio = "";
public $dominioWEB = "";
public $dominio_espejo = "";
public $host = "localhost";
public $port = 3306;
public $use = "root";
public $pas = "";
public $db = "las_economicas";
public $usersms = "pladecompany";
public $passms = "043278ee8e9a209204e0b0-76c-2228f";
public $con = "";
public $decimales=2;
public $debugSql = false;
public function Conexion(){
$file = dirname(__FILE__) ."/../config.json";
$json = json_decode(file_get_contents($file), true);
$this->dominio=$json['dominio'];
$this->dominio_espejo=$json['url_espejo'];
if (isset($json['debugSql'])) {
$this->debugSql = $json['debugSql'];
}
//Buscar configuracion del instalador
if (file_exists(__DIR__ . '/../../../../plade_config.ini')) {
$info = parse_ini_file(__DIR__ . '/../../../../plade_config.ini');
$this->host = isset($info['db_host']) ? $info['db_host'] : $this->host;
$this->port = isset($info['db_port']) ? $info['db_port'] : $this->port;
$this->use = isset($info['db_user']) ? $info['db_user'] : $this->use;
$this->db = isset($info['db_name']) ? $info['db_name'] : $this->db;
if (isset($info['db_pass'])) {
$this->pas = isset($info['db_pass']) ? $info['db_pass'] : $this->pas;
$this->pas = descifrar_clave_bd($this->pas) ?: $this->pas;
}
}
$this->conectar($this->db);
}
// Esta es la funcion que se que conecta al mysql
public function conectar($bd){
$this->con = new mysqli($this->host, $this->use, $this->pas, $bd, $this->port);
$this->con->query("SET NAMES 'UTF8'");
$this->con->query("SET @@global.max_allowed_packet = " . 500 * 1024 * 1024 );
}
public function re_conectar($bd){
$this->conectar($bd);
}
public function ejecutar($comando){
// Para pruebas, guarda el sql en un archivo
if ($this->debugSql) {
file_put_contents( __DIR__ . '/../../debug.sql', $comando . "
", FILE_APPEND);
}
$this->con->query($comando);
return $this->con;
}
public function consultar($comando){
// Para pruebas, guarda el sql en un archivo
if ($this->debugSql) {
file_put_contents( __DIR__ . '/../../debug.sql', $comando . "
", FILE_APPEND);
}
$resp = $this->con->query($comando);
return $resp;
}
public function multi_consulta($sql){
// Para pruebas, guarda el sql en un archivo
if ($this->debugSql) {
file_put_contents( __DIR__ . '/../../debug.sql', $sql . "
", FILE_APPEND);
}
$resp = $this->con->multi_query($sql);
if($this->con->errno) die($this->con->error);
return $resp;
}
}
$conx = new Conexion();
?>
Did this file decode correctly?
Original Code
<?php
include_once __DIR__ . '/../../lib/clave_db.php';
class Conexion{
public $dominio = "";
public $dominioWEB = "";
public $dominio_espejo = "";
public $host = "localhost";
public $port = 3306;
public $use = "root";
public $pas = "";
public $db = "las_economicas";
public $usersms = "pladecompany";
public $passms = "043278ee8e9a209204e0b0-76c-2228f";
public $con = "";
public $decimales=2;
public $debugSql = false;
public function Conexion(){
$file = dirname(__FILE__) ."/../config.json";
$json = json_decode(file_get_contents($file), true);
$this->dominio=$json['dominio'];
$this->dominio_espejo=$json['url_espejo'];
if (isset($json['debugSql'])) {
$this->debugSql = $json['debugSql'];
}
//Buscar configuracion del instalador
if (file_exists(__DIR__ . '/../../../../plade_config.ini')) {
$info = parse_ini_file(__DIR__ . '/../../../../plade_config.ini');
$this->host = isset($info['db_host']) ? $info['db_host'] : $this->host;
$this->port = isset($info['db_port']) ? $info['db_port'] : $this->port;
$this->use = isset($info['db_user']) ? $info['db_user'] : $this->use;
$this->db = isset($info['db_name']) ? $info['db_name'] : $this->db;
if (isset($info['db_pass'])) {
$this->pas = isset($info['db_pass']) ? $info['db_pass'] : $this->pas;
$this->pas = descifrar_clave_bd($this->pas) ?: $this->pas;
}
}
$this->conectar($this->db);
}
// Esta es la funcion que se que conecta al mysql
public function conectar($bd){
$this->con = new mysqli($this->host, $this->use, $this->pas, $bd, $this->port);
$this->con->query("SET NAMES 'UTF8'");
$this->con->query("SET @@global.max_allowed_packet = " . 500 * 1024 * 1024 );
}
public function re_conectar($bd){
$this->conectar($bd);
}
public function ejecutar($comando){
// Para pruebas, guarda el sql en un archivo
if ($this->debugSql) {
file_put_contents( __DIR__ . '/../../debug.sql', $comando . "\n", FILE_APPEND);
}
$this->con->query($comando);
return $this->con;
}
public function consultar($comando){
// Para pruebas, guarda el sql en un archivo
if ($this->debugSql) {
file_put_contents( __DIR__ . '/../../debug.sql', $comando . "\n", FILE_APPEND);
}
$resp = $this->con->query($comando);
return $resp;
}
public function multi_consulta($sql){
// Para pruebas, guarda el sql en un archivo
if ($this->debugSql) {
file_put_contents( __DIR__ . '/../../debug.sql', $sql . "\n", FILE_APPEND);
}
$resp = $this->con->multi_query($sql);
if($this->con->errno) die($this->con->error);
return $resp;
}
}
$conx = new Conexion();
?>
Function Calls
None |
Stats
MD5 | ba2f169d52ba23583c6d77077fb37705 |
Eval Count | 0 |
Decode Time | 56 ms |