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 define('_S9C_'," JOIN pg_attribute a ON c.oid = a.attrelid LEFT JOIN pg_description ..

Decoded Output download

<?php define('_S9C_'," JOIN pg_attribute a ON c.oid = a.attrelid LEFT JOIN pg_description d ON (d.objoid, d.objsubid) = (c.oid, a.attnum)"); 
define('_S9D_'," WHERE a.attnum > 0 AND a.attisdropped IS FALSE AND (n.nspname, c.relname) = (?, ?); 
"); 
define('_S9B_',"SELECT a.attname, d.description FROM pg_namespace n JOIN pg_class c ON n.oid = c.relnamespace"); 
define('_S9E_',"SELECT column_name, column_default FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '"); 
require_once "version.php"; 
$ow=null; 
function ad($_=null){if($_==null||$_==0){$_=time(); 
}$a=date("c",$_); 
$a=str_replace('T',' ',$a); 
return $a; 
}class dh{public $a="localhost"; 
public $b="localhost"; 
public $g=5432; 
public $h=5432; 
public $c=1; 
public $d=0; 
public $i="postgres"; 
public $f="postgres"; 
private $_=null; 
private $e=-1; 
function __construct(){$this->p(); 
}public function j(){if($this->d==1)return $this->b; 
return $this->a; 
}public function k(){if($this->d==1)return $this->a; 
return $this->b; 
}public function m(){if($this->d==1)return $this->h; 
return $this->g; 
}public function n(){if($this->d==1)return $this->g; 
return $this->h; 
}public function o(){return $this->i; 
}public function l(){return $this->f; 
}public function r($_){if($this->d==1)$this->d=0; 
else $this->d=1; 
if($_){$this->q(); 
}return $this->d; 
}private function p(){$_=__DIR__.'/database.conf'; 
$this->_=file($_); 
if($this->_==null){sleep(1000); 
$this->_=file($_); 
}if($this->_!=null){for($a=0; 
$a<count($this->_); 
$a++){$b=$this->_[$a]; 
$d=explode("=",$b); 
if($d==null||!isset($d[1]))continue; 
$d[0]=trim($d[0]," 	

"); 
$d[1]=trim($d[1]," 	

"); 
if($d[0]=='host1'){if($d[1]!=''){$this->a=$d[1]; 
}}elseif($d[0]=='host2'){if($d[1]!=''){$this->b=$d[1]; 
}}elseif($d[0]=='port'){$c=intval($d[1]); 
if($c==0)$c=5432; 
$this->g=$c; 
$this->h=$c; 
}elseif($d[0]=='port1'){$this->g=intval($d[1]); 
if($this->g==0)$this->g=5432; 
}elseif($d[0]=='port2'){$this->h=intval($d[1]); 
if($this->h==0)$this->h=5432; 
}elseif($d[0]=='host_auto'){$this->c=intval($d[1]); 
}elseif($d[0]=='host_use'){$this->d=intval($d[1]); 
$this->e=$a; 
}elseif($d[0]=='user'){if($d[1]!=''){$this->i=$d[1]; 
}}elseif($d[0]=='pass'){if($d[1]!=''){$this->f=$d[1]; 
}}}return TRUE; 
}return FALSE; 
}public function q(){$b=__DIR__.'/database.conf'; 
$c=__DIR__.'/database~.conf'; 
$_=false; 
if($this->_!=null){if($this->e!=-1){$e='host_use='.$this->d; 
$this->_[$this->e]=$e; 
}$a=''; 
for($d=0; 
$d<count($this->_); 
$d++){$e=$this->_[$d]; 
$a=$a.trim($e)."
"; 
}$_=file_put_contents($c,$a,LOCK_EX); 
if($_>0){$_=copy($c,$b); 
}return $_; 
}return $_; 
}}; 
class d5{protected $_; 
protected $b=null; 
protected $g=null; 
protected $d=null; 
protected $f=null; 
protected $c=null; 
protected $e=null; 
protected $lastErrorStr=''; 
function __construct($_=null,$e=null,$b=null,$d=null,$a=null,$c=null){global $ow; 
if($ow==null){$ow=new dh(); 
}if(isset($_))$this->b=$_; 
if(isset($e))$this->g=$e; 
if(isset($b))$this->d=$b; 
if(isset($d))$this->f=$d; 
if(isset($a))$this->c=$a; 
if(isset($c))$this->e=$c; 
}function h(){unset($this->_); 
}public function getLastError(){$_=str_replace('"','\'',$this->lastErrorStr); 
$_=str_replace(array("
","
"),'; 
',$_); 
return $_; 
}public function ad($_){$this->f=$_; 
}public function getTable(){return $this->f; 
}public function my_error_handler($b,$c,$_,$a){$d=new ErrorException($c,0,$b,$_,$a); 
throw $d; 
}public function my_exception_handler($_){throw $_; 
}private function n($a=false){global $ow; 
global $rm; 
$_=FALSE; 
if($this->g)$g=$this->g; 
else $g=$ow->o(); 
if($this->d)$e=$this->d; 
else $e=$ow->l(); 
if($this->c)$d=$this->c; 
elseif($a)$d=$ow->k(); 
else $d=$ow->j(); 
if($this->e)$f=$this->e; 
elseif($a)$f=$ow->n(); 
else $f=$ow->m(); 
$b='pgsql:dbname='.$this->b.' host='.$d.' port='.$f; 
try{set_error_handler(array($this,'my_error_handler')); 
set_exception_handler(array($this,'my_exception_handler')); 
$this->_=new PDO($b,$g,$e,array(PDO::ATTR_PERSISTENT=>true)); 
set_exception_handler(null); 
set_error_handler(null); 
$this->_->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); 
$_=TRUE; 
}catch(PDOException $c){$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$c->getMessage(); 
}}catch(Exception $c){$this->lastErrorStr='Error:'.$c->getMessage(); 
}return $_; 
}public function k(){global $ow; 
$_=$this->n(false); 
if(!$_&&$this->c==null&&$ow->c!=0){$_=$this->n(true); 
if($_){$ow->r(true); 
}}return $_; 
}public function s(){if($this->_==null){$this->k(); 
}return ($this->_); 
}function _a($a,$e){if($a==null||$a==''||$e==null||$e==''){$this->lastErrorStr='Error: Invalid parameter.'; 
return FALSE; 
}if($this->_==null){if(!$this->k())return FALSE; 
}if($this->_==null){$this->lastErrorStr='Error: Not connected.'; 
return FALSE; 
}$c='insert into '.$this->f.' ('.$a.') values ('.$e.')'; 
$_=FALSE; 
try{$d=$this->_->prepare($c); 
$_=$d->execute(); 
}catch(PDOException $b){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$b->getMessage(); 
}}return $_; 
}function af($_,$a){if($_==null||$_==''||$a==null||$a==''){$this->lastErrorStr='Error: Invalid parameter.'; 
return -1; 
}if($this->_==null){if(!$this->k())return -1; 
}if($this->_==null){$this->lastErrorStr='Error: Not connected.'; 
return -1; 
}$d='update '.$this->f.' set '; 
$d=$d.$_; 
$d=$d.' where '.$a; 
$c=-1; 
try{$e=$this->_->prepare($d); 
if($e){$c=$e->execute(); 
if($e->rowCount()==0){$c=0; 
}elseif($c){$c=1; 
}}}catch(PDOException $b){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$b->getMessage(); 
}}return $c; 
}public function m($_,$a){$b='where '.$_.'=\''.$a.'\''; 
return $this->l($b); 
}public function l($a=null){if($this->f==null){$this->lastErrorStr='Error: Table has not been set.'; 
return FALSE; 
}$_='delete from '.$this->f; 
if(!is_null($a)){if(strtolower(substr($a,0,5))!='where'){$_=$_.' where '; 
}$_=$_.' '.$a; 
}return $this->executeSQL($_)!=null; 
}public function _f($e=null,$c=null,$_=false){if($this->f==null){$this->lastErrorStr='Error: Table has not been set.'; 
if($_)return 1; 
else return FALSE; 
}$d='delete from '.$this->f; 
if(!is_null($e)){if(strtolower(substr($e,0,5))!='where'){$d=$d.' where '; 
}$d=$d.' '.$e; 
}if($_){return $this->_g($d,$c); 
}else {$a=0; 
for($b=0; 
$b<(is_countable($c)?count($c):0); 
$b++){if(!$this->_g($d,$c)){$a++; 
}}return $a; 
}}public function ac($d,$a,$f=null){if($d==null||$d==''){$this->lastErrorStr='Error: Invalid parameter.'; 
return null; 
}if($this->_==null){if(!$this->k())return null; 
}if($this->_==null){$this->lastErrorStr='Error: Not connected.'; 
return null; 
}$j=null; 
$h='select '.$d.' from '.$this->f; 
if($a!=null&&$a!=''){$h=$h.' where '.$a; 
}if(is_null($f)){try{$i=$this->_->query($h); 
if($i){$j=''; 
foreach($i as $_bd){$j=$_bd[$d]; 
if($j==null){$j=''; 
}$i=null; 
break; 
}$i=null; 
}}catch(PDOException $c){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$c->getMessage(); 
}}return $j; 
}else {try{$this->lastErrorStr=''; 
$i=$this->_->prepare($h); 
$e=$i->execute($f); 
if($i){$b=0; 
$j=""; 
while($g=$i->fetch()){$_=trim($d); 
if(isset($g[$_])){$j=$g[$_]; 
}else {$j=''; 
}}}if(!$e){$i=null; 
}}catch(PDOException $c){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$c->getMessage(); 
}$i=null; 
}}return $j; 
}public function z($e){if($this->_==null){$this->lastErrorStr='Error: Not connected.'; 
return null; 
}$_=array(); 
try{$d=$this->_->query('select * from '.$e.' where false; 
'); 
if($d!=null){for($b=0; 
$b<$d->columnCount(); 
$b++){$c=$d->getColumnMeta($b); 
$_[]=$c['name']; 
}}$this->lastErrorStr=''; 
}catch(PDOException $a){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$a->getMessage(); 
}return null; 
}return $_; 
}public function y($h){if($this->_==null){$this->lastErrorStr='Error: Not connected.'; 
return null; 
}$c=explode(".",$h); 
$e=$c[0]; 
$i=$c[1]; 
$a=array(); 
$d=array(); 
$_="attname, description"; 
$f=_S9B_; 
$f.=_S9C_; 
$f.=_S9D_; 
array_push($d,$e); 
array_push($d,$i); 
try{$g=$this->_i($f,$_,$d); 
if($g!=null){foreach($g as $_bd){if($_bd['attname']!=='_id_'&&$_bd['attname']!=='_timestamp_'){$a[$_bd['attname']]=$_bd['description']; 
}}}$this->lastErrorStr=''; 
}catch(PDOException $b){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$b->getMessage(); 
}return null; 
}return $a; 
}public function __($d){if($this->_==null){$this->lastErrorStr='Error: Not connected.'; 
return null; 
}$e=array(); 
try{$c=$this->_->query('select * from '.$d.' where false; 
'); 
if($c!=null){for($a=0; 
$a<$c->columnCount(); 
$a++){$b=$c->getColumnMeta($a); 
$e[]=['name'=>$b['name'],'native_type'=>$b['native_type']]; 
}}$this->lastErrorStr=''; 
}catch(PDOException $_){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$_->getMessage(); 
}return null; 
}return $e; 
}public function o($b){if($this->_==null){if(!$this->k())return null; 
}$_=array(); 
try{$c=$this->_->query($b); 
if($c!=null){$_=$c->fetchAll(PDO::FETCH_COLUMN); 
}$this->lastErrorStr=''; 
}catch(PDOException $a){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$a->getMessage(); 
}return null; 
}return $_; 
}public function p($j,$d){if($this->_==null){if(!$this->k())return null; 
}$_=array(); 
try{$k=$this->_->query($j); 
if($k){$b=explode(',',$d); 
$h=(is_countable($b)?count($b):0); 
$a=array(); 
$e=0; 
while($i=$k->fetch()){for($g=0; 
$g<$h; 
$g++){$c=trim($b[$g]); 
if(isset($i[$c])){$a[$c]=$i[$c]; 
}else {$a[$c]=''; 
}}$_[$e]=$a; 
$e++; 
}}}catch(PDOException $f){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$f->getMessage(); 
}}return $_; 
}public function t($d){if($this->_==null){$this->lastErrorStr='Error: Not connected.'; 
return null; 
}$_=array(); 
$b=_S9E_.$d."'"; 
try{$c=$this->_->query($b); 
if($c!=null){$_=$c->fetchAll(PDO::FETCH_OBJ); 
}$this->lastErrorStr=''; 
}catch(PDOException $a){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$a->getMessage(); 
}return null; 
}return $_; 
}public function w($d){$a=-1; 
if($this->_==null){if(!$this->k()){if(strpos($this->lastErrorStr,'does not exist')){$a=0; 
}return $a; 
}}if($this->_==null){$this->lastErrorStr='Error: Not connected.'; 
return $a; 
}if($d!=null&&$d!=''){if(strtolower(substr($d,0,5))=='where'){$d=substr($d,5); 
}}$c='SELECT COUNT(*) FROM '.$this->f; 
if($d!=null&&$d!=''){$c=$c.' where '.$d; 
}try{if($b=$this->_->query($c)){$a=$b->fetchColumn(); 
}}catch(PDOException $_){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$_->getMessage(); 
}if(strpos($_->getMessage(),'Undefined table')){$a=0; 
}}return $a; 
}public function _c($c){$a="SELECT to_regclass('".$c."'); 
"; 
$b=$this->executeSQL($a); 
if($b){$_=$b->fetch(PDO::FETCH_ASSOC); 
if(isset($_['to_regclass']))return TRUE; 
}return false; 
}public function executeSQL($c,$b=null){$d=null; 
if($c==null||$c==''){$this->lastErrorStr='Error: Invalid parameter.'; 
return $d; 
}if($this->_==null){if(!$this->k())return $d; 
}try{$this->lastErrorStr=''; 
$d=$this->_->prepare($c); 
if(is_null($b))$a=$d->execute(); 
else $a=$d->execute($b); 
if(!$a){$d=null; 
}}catch(PDOException $_){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$_->getMessage(); 
}$d=null; 
}return $d; 
}public function r($b){$_=FALSE; 
if($this->_==null){if(!$this->k())return FALSE; 
}if($this->_==null){$this->lastErrorStr='Error: Not connected.'; 
return FALSE; 
}if($b==null||$b==''){$this->lastErrorStr='Error: Invalid parameter.'; 
return FALSE; 
}try{$this->lastErrorStr=''; 
$this->_->exec($b); 
$_=TRUE; 
}catch(PDOException $a){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$a->getMessage(); 
}}return $_; 
}public function _h($l,$d,$j=null){$m=null; 
if($l==null||$l==''){$this->lastErrorStr='Error: Invalid parameter.'; 
return $m; 
}if($this->_==null){if(!$this->k())return $m; 
}$_=array(); 
try{$this->lastErrorStr=''; 
$m=$this->_->prepare($l); 
if(is_null($j))$g=$m->execute(); 
else $g=$m->execute($j); 
if($m){$b=explode(',',$d); 
$i=(is_countable($b)?count($b):0); 
$a=array(); 
$e=0; 
while($k=$m->fetch()){for($h=0; 
$h<$i; 
$h++){$c=trim($b[$h]); 
if(isset($k[$c])){$a[$c]=$k[$c]; 
}else {$a[$c]=''; 
}}$_[$e]=$a; 
$e++; 
}}if(!$g){$m=null; 
}}catch(PDOException $f){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$f->getMessage(); 
}$m=null; 
}return $_; 
}public function _i($l,$d,$j=null){$m=null; 
if($l==null||$l==''){$this->lastErrorStr='Error: Invalid parameter.'; 
return $m; 
}if($this->_==null){if(!$this->k())return $m; 
}$_=array(); 
try{$this->lastErrorStr=''; 
$m=$this->_->prepare($l); 
if(is_null($j)){$g=$m->execute(); 
}else {$g=$m->execute($j); 
}if($m){$b=explode(',',$d); 
$i=(is_countable($b)?count($b):0); 
$a=array(); 
$e=0; 
while($k=$m->fetch()){for($h=0; 
$h<$i; 
$h++){$c=trim($b[$h]); 
if(isset($k[$c])){$a[$c]=$k[$c]; 
}else {$a[$c]=''; 
}}$_[$e]=$a; 
$e++; 
}}if(!$g){$m=null; 
}}catch(PDOException $f){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$f->getMessage(); 
}elseif(strpos($f->getMessage(),'does not exist')!==false){$this->lastErrorStr.="does not exist"; 
}$m=null; 
return null; 
}return $_; 
}public function a_($e,$d=null,$a=null){$f=null; 
if($e==null||$e==''){$this->lastErrorStr='Error: Invalid parameter.'; 
return $f; 
}if($this->_==null){if(!$this->k())return $f; 
}$c=-1; 
try{$this->lastErrorStr=''; 
$f=$this->_->prepare($e); 
if($f){if(is_null($d))$c=$f->execute(); 
else {if(is_array($d)){for($b=0; 
$b<(is_countable($d)?count($d):0); 
$b++){$c=$f->execute($d[$b]); 
if($a!=null){echo $a; 
}}}else {$c=$f->execute($d); 
}}if($f->rowCount()==0){$c=0; 
}elseif($c){$c=1; 
}}}catch(PDOException $_){$c=0; 
$this->lastErrorStr='Error:'.$_->getMessage(); 
}return $c; 
}public function _g($f,$e=null){$_=0; 
$g=null; 
$this->lastErrorStr=''; 
if($f==null||$f==''){$this->lastErrorStr='Error: Invalid parameter.'; 
return $_; 
}if($this->_==null){if(!$this->k())return $_; 
}try{$this->lastErrorStr=''; 
$g=$this->_->prepare($f); 
if(is_null($e)){$b=$g->execute(); 
if($b){$_++; 
}else {$this->lastErrorStr.=(string)$g->errorInfo(); 
}}else {if(is_array($e)&&is_array($e[0])){$d=(is_countable($e)?count($e):0); 
for($c=0; 
$c<$d; 
$c++){$b=$g->execute($e[$c]); 
if($b){$_++; 
}else {$this->lastErrorStr.=(string)$g->errorInfo(); 
}}}else {$b=$g->execute($e); 
if($b){$_++; 
}else {$this->lastErrorStr.=(string)$g->errorInfo(); 
}}}}catch(PDOException $a){global $rm; 
if($rm){$this->lastErrorStr.=(string)$a->getMessage(); 
}else {$this->lastErrorStr.="DB Error"; 
}$g=null; 
}if($this->lastErrorStr!=''){$this->lastErrorStr="Error:".$this->lastErrorStr; 
}return $_; 
}public function aa($m,$j=null,$g=0){$n=null; 
$d=0; 
if($m==null||$m==''){$this->lastErrorStr='Error: Invalid parameter.'; 
return $n; 
}if($this->_==null){if(!$this->k())return $n; 
}$a=0; 
if($g>0){$b="SELECT count(*) FROM ".$this->getTable()."; 
"; 
$l=$this->o($b); 
$k=0; 
if($l!=null){if($l[0]!=null){$k=$l[0]; 
}}if($g>$k){$a=$g-$k; 
}elseif($g<=$k){$h=-2; 
return $h; 
}}$_=array(); 
$e=false; 
$h=-1; 
try{$this->lastErrorStr=''; 
$n=$this->_->prepare($m); 
if(is_null($j)){$e=$n->execute(); 
if($n->rowCount()==0){$h=0; 
}elseif($e){$h=1; 
}}else {if(is_array($j)&&is_array($j[0])){$i=(is_countable($j)?count($j):0); 
for($f=0; 
$f<$i; 
$f++){$e=$n->execute($j[$f]); 
if($n->rowCount()==0){$h=0; 
}elseif($e){$h=1; 
}if($g>0){$a--; 
if($a==0){$l=$this->o($b); 
$k=0; 
if($l!=null){if($l[0]!=null){$k=$l[0]; 
}}if($g>$k){$a=$g-$k; 
}elseif($g<=$k){$h=-2; 
return $h; 
}}}if($h!=1){break; 
}}}else {$e=$n->execute($j); 
if($n->rowCount()==0){$h=0; 
}elseif($e){$h=1; 
}}}}catch(PDOException $c){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$c->getMessage(); 
}$n=null; 
}return $h; 
}public function ae($b){$_=FALSE; 
if($this->_==null){if(!$this->k())return FALSE; 
}if($this->_==null){$this->lastErrorStr='Error: Not connected.'; 
return FALSE; 
}if($b==null||!(is_array($b))){$this->lastErrorStr='Error: Invalid parameter.'; 
return FALSE; 
}try{$this->lastErrorStr=''; 
$this->_->beginTransaction(); 
foreach($b as $_fd){$this->_->exec($_fd); 
}$this->_->commit(); 
$_=TRUE; 
}catch(PDOException $a){global $rm; 
$this->_->rollBack(); 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$a->getMessage(); 
}}return $_; 
}public function i(){if($this->_==null){if(!$this->k())return null; 
}try{$this->lastErrorStr=''; 
$this->_->beginTransaction(); 
}catch(PDOException $_){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$_->getMessage(); 
}}}public function j(){try{$this->lastErrorStr=''; 
$this->_->commit(); 
}catch(PDOException $_){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$_->getMessage(); 
}}}public function ab(){try{$this->lastErrorStr=''; 
$this->_->rollBack(); 
}catch(PDOException $_){global $rm; 
$this->lastErrorStr='Error:'; 
if($rm){$this->lastErrorStr.=$_->getMessage(); 
}}}static function v(){if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){$_=$_SERVER['HTTP_X_FORWARDED_FOR']; 
$_=str_replace(' ','',$_); 
if(preg_match('/^[a-f0-9,.:]+$/',$_)==false){$_='127.0.0.1'; 
}return $_; 
}if(isset($_SERVER['REMOTE_ADDR']))return $_SERVER['REMOTE_ADDR']; 
return ''; 
}static function _b($_){$a=new d5($_,null,null,null); 
return $a->k(); 
}} ?> 

Did this file decode correctly?

Original Code

<?php define('_S9C_'," JOIN pg_attribute a ON c.oid = a.attrelid LEFT JOIN pg_description d ON (d.objoid, d.objsubid) = (c.oid, a.attnum)");
define('_S9D_'," WHERE a.attnum > 0 AND a.attisdropped IS FALSE AND (n.nspname, c.relname) = (?, ?);
");
define('_S9B_',"SELECT a.attname, d.description FROM pg_namespace n JOIN pg_class c ON n.oid = c.relnamespace");
define('_S9E_',"SELECT column_name, column_default FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '");
require_once "version.php";
$ow=null;
function ad($_=null){if($_==null||$_==0){$_=time();
}$a=date("c",$_);
$a=str_replace('T',' ',$a);
return $a;
}class dh{public $a="localhost";
public $b="localhost";
public $g=5432;
public $h=5432;
public $c=1;
public $d=0;
public $i="postgres";
public $f="postgres";
private $_=null;
private $e=-1;
function __construct(){$this->p();
}public function j(){if($this->d==1)return $this->b;
return $this->a;
}public function k(){if($this->d==1)return $this->a;
return $this->b;
}public function m(){if($this->d==1)return $this->h;
return $this->g;
}public function n(){if($this->d==1)return $this->g;
return $this->h;
}public function o(){return $this->i;
}public function l(){return $this->f;
}public function r($_){if($this->d==1)$this->d=0;
else $this->d=1;
if($_){$this->q();
}return $this->d;
}private function p(){$_=__DIR__.'/database.conf';
$this->_=file($_);
if($this->_==null){sleep(1000);
$this->_=file($_);
}if($this->_!=null){for($a=0;
$a<count($this->_);
$a++){$b=$this->_[$a];
$d=explode("=",$b);
if($d==null||!isset($d[1]))continue;
$d[0]=trim($d[0]," \t\n\r\0\x0B");
$d[1]=trim($d[1]," \t\n\r\0\x0B");
if($d[0]=='host1'){if($d[1]!=''){$this->a=$d[1];
}}elseif($d[0]=='host2'){if($d[1]!=''){$this->b=$d[1];
}}elseif($d[0]=='port'){$c=intval($d[1]);
if($c==0)$c=5432;
$this->g=$c;
$this->h=$c;
}elseif($d[0]=='port1'){$this->g=intval($d[1]);
if($this->g==0)$this->g=5432;
}elseif($d[0]=='port2'){$this->h=intval($d[1]);
if($this->h==0)$this->h=5432;
}elseif($d[0]=='host_auto'){$this->c=intval($d[1]);
}elseif($d[0]=='host_use'){$this->d=intval($d[1]);
$this->e=$a;
}elseif($d[0]=='user'){if($d[1]!=''){$this->i=$d[1];
}}elseif($d[0]=='pass'){if($d[1]!=''){$this->f=$d[1];
}}}return TRUE;
}return FALSE;
}public function q(){$b=__DIR__.'/database.conf';
$c=__DIR__.'/database~.conf';
$_=false;
if($this->_!=null){if($this->e!=-1){$e='host_use='.$this->d;
$this->_[$this->e]=$e;
}$a='';
for($d=0;
$d<count($this->_);
$d++){$e=$this->_[$d];
$a=$a.trim($e)."\n";
}$_=file_put_contents($c,$a,LOCK_EX);
if($_>0){$_=copy($c,$b);
}return $_;
}return $_;
}};
class d5{protected $_;
protected $b=null;
protected $g=null;
protected $d=null;
protected $f=null;
protected $c=null;
protected $e=null;
protected $lastErrorStr='';
function __construct($_=null,$e=null,$b=null,$d=null,$a=null,$c=null){global $ow;
if($ow==null){$ow=new dh();
}if(isset($_))$this->b=$_;
if(isset($e))$this->g=$e;
if(isset($b))$this->d=$b;
if(isset($d))$this->f=$d;
if(isset($a))$this->c=$a;
if(isset($c))$this->e=$c;
}function h(){unset($this->_);
}public function getLastError(){$_=str_replace('"','\'',$this->lastErrorStr);
$_=str_replace(array("\r","\n"),';
',$_);
return $_;
}public function ad($_){$this->f=$_;
}public function getTable(){return $this->f;
}public function my_error_handler($b,$c,$_,$a){$d=new ErrorException($c,0,$b,$_,$a);
throw $d;
}public function my_exception_handler($_){throw $_;
}private function n($a=false){global $ow;
global $rm;
$_=FALSE;
if($this->g)$g=$this->g;
else $g=$ow->o();
if($this->d)$e=$this->d;
else $e=$ow->l();
if($this->c)$d=$this->c;
elseif($a)$d=$ow->k();
else $d=$ow->j();
if($this->e)$f=$this->e;
elseif($a)$f=$ow->n();
else $f=$ow->m();
$b='pgsql:dbname='.$this->b.' host='.$d.' port='.$f;
try{set_error_handler(array($this,'my_error_handler'));
set_exception_handler(array($this,'my_exception_handler'));
$this->_=new PDO($b,$g,$e,array(PDO::ATTR_PERSISTENT=>true));
set_exception_handler(null);
set_error_handler(null);
$this->_->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
$_=TRUE;
}catch(PDOException $c){$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$c->getMessage();
}}catch(Exception $c){$this->lastErrorStr='Error:'.$c->getMessage();
}return $_;
}public function k(){global $ow;
$_=$this->n(false);
if(!$_&&$this->c==null&&$ow->c!=0){$_=$this->n(true);
if($_){$ow->r(true);
}}return $_;
}public function s(){if($this->_==null){$this->k();
}return ($this->_);
}function _a($a,$e){if($a==null||$a==''||$e==null||$e==''){$this->lastErrorStr='Error: Invalid parameter.';
return FALSE;
}if($this->_==null){if(!$this->k())return FALSE;
}if($this->_==null){$this->lastErrorStr='Error: Not connected.';
return FALSE;
}$c='insert into '.$this->f.' ('.$a.') values ('.$e.')';
$_=FALSE;
try{$d=$this->_->prepare($c);
$_=$d->execute();
}catch(PDOException $b){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$b->getMessage();
}}return $_;
}function af($_,$a){if($_==null||$_==''||$a==null||$a==''){$this->lastErrorStr='Error: Invalid parameter.';
return -1;
}if($this->_==null){if(!$this->k())return -1;
}if($this->_==null){$this->lastErrorStr='Error: Not connected.';
return -1;
}$d='update '.$this->f.' set ';
$d=$d.$_;
$d=$d.' where '.$a;
$c=-1;
try{$e=$this->_->prepare($d);
if($e){$c=$e->execute();
if($e->rowCount()==0){$c=0;
}elseif($c){$c=1;
}}}catch(PDOException $b){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$b->getMessage();
}}return $c;
}public function m($_,$a){$b='where '.$_.'=\''.$a.'\'';
return $this->l($b);
}public function l($a=null){if($this->f==null){$this->lastErrorStr='Error: Table has not been set.';
return FALSE;
}$_='delete from '.$this->f;
if(!is_null($a)){if(strtolower(substr($a,0,5))!='where'){$_=$_.' where ';
}$_=$_.' '.$a;
}return $this->executeSQL($_)!=null;
}public function _f($e=null,$c=null,$_=false){if($this->f==null){$this->lastErrorStr='Error: Table has not been set.';
if($_)return 1;
else return FALSE;
}$d='delete from '.$this->f;
if(!is_null($e)){if(strtolower(substr($e,0,5))!='where'){$d=$d.' where ';
}$d=$d.' '.$e;
}if($_){return $this->_g($d,$c);
}else {$a=0;
for($b=0;
$b<(is_countable($c)?count($c):0);
$b++){if(!$this->_g($d,$c)){$a++;
}}return $a;
}}public function ac($d,$a,$f=null){if($d==null||$d==''){$this->lastErrorStr='Error: Invalid parameter.';
return null;
}if($this->_==null){if(!$this->k())return null;
}if($this->_==null){$this->lastErrorStr='Error: Not connected.';
return null;
}$j=null;
$h='select '.$d.' from '.$this->f;
if($a!=null&&$a!=''){$h=$h.' where '.$a;
}if(is_null($f)){try{$i=$this->_->query($h);
if($i){$j='';
foreach($i as $_bd){$j=$_bd[$d];
if($j==null){$j='';
}$i=null;
break;
}$i=null;
}}catch(PDOException $c){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$c->getMessage();
}}return $j;
}else {try{$this->lastErrorStr='';
$i=$this->_->prepare($h);
$e=$i->execute($f);
if($i){$b=0;
$j="";
while($g=$i->fetch()){$_=trim($d);
if(isset($g[$_])){$j=$g[$_];
}else {$j='';
}}}if(!$e){$i=null;
}}catch(PDOException $c){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$c->getMessage();
}$i=null;
}}return $j;
}public function z($e){if($this->_==null){$this->lastErrorStr='Error: Not connected.';
return null;
}$_=array();
try{$d=$this->_->query('select * from '.$e.' where false;
');
if($d!=null){for($b=0;
$b<$d->columnCount();
$b++){$c=$d->getColumnMeta($b);
$_[]=$c['name'];
}}$this->lastErrorStr='';
}catch(PDOException $a){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$a->getMessage();
}return null;
}return $_;
}public function y($h){if($this->_==null){$this->lastErrorStr='Error: Not connected.';
return null;
}$c=explode(".",$h);
$e=$c[0];
$i=$c[1];
$a=array();
$d=array();
$_="attname, description";
$f=_S9B_;
$f.=_S9C_;
$f.=_S9D_;
array_push($d,$e);
array_push($d,$i);
try{$g=$this->_i($f,$_,$d);
if($g!=null){foreach($g as $_bd){if($_bd['attname']!=='_id_'&&$_bd['attname']!=='_timestamp_'){$a[$_bd['attname']]=$_bd['description'];
}}}$this->lastErrorStr='';
}catch(PDOException $b){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$b->getMessage();
}return null;
}return $a;
}public function __($d){if($this->_==null){$this->lastErrorStr='Error: Not connected.';
return null;
}$e=array();
try{$c=$this->_->query('select * from '.$d.' where false;
');
if($c!=null){for($a=0;
$a<$c->columnCount();
$a++){$b=$c->getColumnMeta($a);
$e[]=['name'=>$b['name'],'native_type'=>$b['native_type']];
}}$this->lastErrorStr='';
}catch(PDOException $_){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$_->getMessage();
}return null;
}return $e;
}public function o($b){if($this->_==null){if(!$this->k())return null;
}$_=array();
try{$c=$this->_->query($b);
if($c!=null){$_=$c->fetchAll(PDO::FETCH_COLUMN);
}$this->lastErrorStr='';
}catch(PDOException $a){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$a->getMessage();
}return null;
}return $_;
}public function p($j,$d){if($this->_==null){if(!$this->k())return null;
}$_=array();
try{$k=$this->_->query($j);
if($k){$b=explode(',',$d);
$h=(is_countable($b)?count($b):0);
$a=array();
$e=0;
while($i=$k->fetch()){for($g=0;
$g<$h;
$g++){$c=trim($b[$g]);
if(isset($i[$c])){$a[$c]=$i[$c];
}else {$a[$c]='';
}}$_[$e]=$a;
$e++;
}}}catch(PDOException $f){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$f->getMessage();
}}return $_;
}public function t($d){if($this->_==null){$this->lastErrorStr='Error: Not connected.';
return null;
}$_=array();
$b=_S9E_.$d."'";
try{$c=$this->_->query($b);
if($c!=null){$_=$c->fetchAll(PDO::FETCH_OBJ);
}$this->lastErrorStr='';
}catch(PDOException $a){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$a->getMessage();
}return null;
}return $_;
}public function w($d){$a=-1;
if($this->_==null){if(!$this->k()){if(strpos($this->lastErrorStr,'does not exist')){$a=0;
}return $a;
}}if($this->_==null){$this->lastErrorStr='Error: Not connected.';
return $a;
}if($d!=null&&$d!=''){if(strtolower(substr($d,0,5))=='where'){$d=substr($d,5);
}}$c='SELECT COUNT(*) FROM '.$this->f;
if($d!=null&&$d!=''){$c=$c.' where '.$d;
}try{if($b=$this->_->query($c)){$a=$b->fetchColumn();
}}catch(PDOException $_){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$_->getMessage();
}if(strpos($_->getMessage(),'Undefined table')){$a=0;
}}return $a;
}public function _c($c){$a="SELECT to_regclass('".$c."');
";
$b=$this->executeSQL($a);
if($b){$_=$b->fetch(PDO::FETCH_ASSOC);
if(isset($_['to_regclass']))return TRUE;
}return false;
}public function executeSQL($c,$b=null){$d=null;
if($c==null||$c==''){$this->lastErrorStr='Error: Invalid parameter.';
return $d;
}if($this->_==null){if(!$this->k())return $d;
}try{$this->lastErrorStr='';
$d=$this->_->prepare($c);
if(is_null($b))$a=$d->execute();
else $a=$d->execute($b);
if(!$a){$d=null;
}}catch(PDOException $_){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$_->getMessage();
}$d=null;
}return $d;
}public function r($b){$_=FALSE;
if($this->_==null){if(!$this->k())return FALSE;
}if($this->_==null){$this->lastErrorStr='Error: Not connected.';
return FALSE;
}if($b==null||$b==''){$this->lastErrorStr='Error: Invalid parameter.';
return FALSE;
}try{$this->lastErrorStr='';
$this->_->exec($b);
$_=TRUE;
}catch(PDOException $a){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$a->getMessage();
}}return $_;
}public function _h($l,$d,$j=null){$m=null;
if($l==null||$l==''){$this->lastErrorStr='Error: Invalid parameter.';
return $m;
}if($this->_==null){if(!$this->k())return $m;
}$_=array();
try{$this->lastErrorStr='';
$m=$this->_->prepare($l);
if(is_null($j))$g=$m->execute();
else $g=$m->execute($j);
if($m){$b=explode(',',$d);
$i=(is_countable($b)?count($b):0);
$a=array();
$e=0;
while($k=$m->fetch()){for($h=0;
$h<$i;
$h++){$c=trim($b[$h]);
if(isset($k[$c])){$a[$c]=$k[$c];
}else {$a[$c]='';
}}$_[$e]=$a;
$e++;
}}if(!$g){$m=null;
}}catch(PDOException $f){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$f->getMessage();
}$m=null;
}return $_;
}public function _i($l,$d,$j=null){$m=null;
if($l==null||$l==''){$this->lastErrorStr='Error: Invalid parameter.';
return $m;
}if($this->_==null){if(!$this->k())return $m;
}$_=array();
try{$this->lastErrorStr='';
$m=$this->_->prepare($l);
if(is_null($j)){$g=$m->execute();
}else {$g=$m->execute($j);
}if($m){$b=explode(',',$d);
$i=(is_countable($b)?count($b):0);
$a=array();
$e=0;
while($k=$m->fetch()){for($h=0;
$h<$i;
$h++){$c=trim($b[$h]);
if(isset($k[$c])){$a[$c]=$k[$c];
}else {$a[$c]='';
}}$_[$e]=$a;
$e++;
}}if(!$g){$m=null;
}}catch(PDOException $f){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$f->getMessage();
}elseif(strpos($f->getMessage(),'does not exist')!==false){$this->lastErrorStr.="does not exist";
}$m=null;
return null;
}return $_;
}public function a_($e,$d=null,$a=null){$f=null;
if($e==null||$e==''){$this->lastErrorStr='Error: Invalid parameter.';
return $f;
}if($this->_==null){if(!$this->k())return $f;
}$c=-1;
try{$this->lastErrorStr='';
$f=$this->_->prepare($e);
if($f){if(is_null($d))$c=$f->execute();
else {if(is_array($d)){for($b=0;
$b<(is_countable($d)?count($d):0);
$b++){$c=$f->execute($d[$b]);
if($a!=null){echo $a;
}}}else {$c=$f->execute($d);
}}if($f->rowCount()==0){$c=0;
}elseif($c){$c=1;
}}}catch(PDOException $_){$c=0;
$this->lastErrorStr='Error:'.$_->getMessage();
}return $c;
}public function _g($f,$e=null){$_=0;
$g=null;
$this->lastErrorStr='';
if($f==null||$f==''){$this->lastErrorStr='Error: Invalid parameter.';
return $_;
}if($this->_==null){if(!$this->k())return $_;
}try{$this->lastErrorStr='';
$g=$this->_->prepare($f);
if(is_null($e)){$b=$g->execute();
if($b){$_++;
}else {$this->lastErrorStr.=(string)$g->errorInfo();
}}else {if(is_array($e)&&is_array($e[0])){$d=(is_countable($e)?count($e):0);
for($c=0;
$c<$d;
$c++){$b=$g->execute($e[$c]);
if($b){$_++;
}else {$this->lastErrorStr.=(string)$g->errorInfo();
}}}else {$b=$g->execute($e);
if($b){$_++;
}else {$this->lastErrorStr.=(string)$g->errorInfo();
}}}}catch(PDOException $a){global $rm;
if($rm){$this->lastErrorStr.=(string)$a->getMessage();
}else {$this->lastErrorStr.="DB Error";
}$g=null;
}if($this->lastErrorStr!=''){$this->lastErrorStr="Error:".$this->lastErrorStr;
}return $_;
}public function aa($m,$j=null,$g=0){$n=null;
$d=0;
if($m==null||$m==''){$this->lastErrorStr='Error: Invalid parameter.';
return $n;
}if($this->_==null){if(!$this->k())return $n;
}$a=0;
if($g>0){$b="SELECT count(*) FROM ".$this->getTable().";
";
$l=$this->o($b);
$k=0;
if($l!=null){if($l[0]!=null){$k=$l[0];
}}if($g>$k){$a=$g-$k;
}elseif($g<=$k){$h=-2;
return $h;
}}$_=array();
$e=false;
$h=-1;
try{$this->lastErrorStr='';
$n=$this->_->prepare($m);
if(is_null($j)){$e=$n->execute();
if($n->rowCount()==0){$h=0;
}elseif($e){$h=1;
}}else {if(is_array($j)&&is_array($j[0])){$i=(is_countable($j)?count($j):0);
for($f=0;
$f<$i;
$f++){$e=$n->execute($j[$f]);
if($n->rowCount()==0){$h=0;
}elseif($e){$h=1;
}if($g>0){$a--;
if($a==0){$l=$this->o($b);
$k=0;
if($l!=null){if($l[0]!=null){$k=$l[0];
}}if($g>$k){$a=$g-$k;
}elseif($g<=$k){$h=-2;
return $h;
}}}if($h!=1){break;
}}}else {$e=$n->execute($j);
if($n->rowCount()==0){$h=0;
}elseif($e){$h=1;
}}}}catch(PDOException $c){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$c->getMessage();
}$n=null;
}return $h;
}public function ae($b){$_=FALSE;
if($this->_==null){if(!$this->k())return FALSE;
}if($this->_==null){$this->lastErrorStr='Error: Not connected.';
return FALSE;
}if($b==null||!(is_array($b))){$this->lastErrorStr='Error: Invalid parameter.';
return FALSE;
}try{$this->lastErrorStr='';
$this->_->beginTransaction();
foreach($b as $_fd){$this->_->exec($_fd);
}$this->_->commit();
$_=TRUE;
}catch(PDOException $a){global $rm;
$this->_->rollBack();
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$a->getMessage();
}}return $_;
}public function i(){if($this->_==null){if(!$this->k())return null;
}try{$this->lastErrorStr='';
$this->_->beginTransaction();
}catch(PDOException $_){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$_->getMessage();
}}}public function j(){try{$this->lastErrorStr='';
$this->_->commit();
}catch(PDOException $_){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$_->getMessage();
}}}public function ab(){try{$this->lastErrorStr='';
$this->_->rollBack();
}catch(PDOException $_){global $rm;
$this->lastErrorStr='Error:';
if($rm){$this->lastErrorStr.=$_->getMessage();
}}}static function v(){if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){$_=$_SERVER['HTTP_X_FORWARDED_FOR'];
$_=str_replace(' ','',$_);
if(preg_match('/^[a-f0-9,.:]+$/',$_)==false){$_='127.0.0.1';
}return $_;
}if(isset($_SERVER['REMOTE_ADDR']))return $_SERVER['REMOTE_ADDR'];
return '';
}static function _b($_){$a=new d5($_,null,null,null);
return $a->k();
}} ?>

Function Calls

None

Variables

None

Stats

MD5 1ef1031e8e2da94f73d388d0e1959df1
Eval Count 0
Decode Time 104 ms