- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
class db
{
public function __call($m,$args)
{
$export = array_map(function($v) { return var_export($v,1);},$args);
$str = $m."(".implode(',',$export).");";
$str = escapeshellarg($str);
$str = "/home/robot/db.class.php {$str};";
$answer = `$str`;
eval('$res = '.$answer.';');
@array_walk_recursive($res,function(&$v) { $v = iconv('cp1251','utf-8',$v); });
return $res;
}
}
//сам db.class.php
$db = new db($host,$db,$user,$pass);
eval('$res = $db->'.$argv[1]);
var_export($res);