File: phpdc.phpr

package info (click to toggle)
xcache 2.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,724 kB
  • sloc: ansic: 8,175; php: 4,557; awk: 285; sh: 135; makefile: 75
file content (33 lines) | stat: -rwxr-xr-x 650 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /usr/bin/php -dopen_basedir=
<?php

$srcdir = dirname(__FILE__);
require_once("$srcdir/Decompiler.class.php");
if (file_exists("$srcdir/phpdc.debug.php")) {
	include("$srcdir/phpdc.debug.php");
}

if (!isset($argv)) {
	$argv = $_SERVER['argv'];
	$argc = $_SERVER['argc'];
}

$dc = new Decompiler();
if (isset($argv[2])) {
	eval('$dc->dc = ' . file_get_contents($argv[2]) . ';');
}
else if (isset($argv[1])) {
	$dc->decompileFile($argv[1]);
}
else {
	$phpcode = '';
	if (!defined('stdin')) {
		define('stdin', fopen('php://stdin', 'rb'));
	}
	while (!feof(stdin)) {
		$phpcode .= fgets(stdin);
	}
	$dc->decompileString($phpcode);
}
$dc->output();