source: trunk/bin/phpdc.phpr @ 982

Last change on this file since 982 was 982, checked in by moo, 2 years ago

move files to subdirs

  • Property svn:eol-style set to native
File size: 657 bytes
Line 
1#! /usr/bin/php -dopen_basedir=
2<?php
3
4$srcdir = dirname(__FILE__);
5require_once("$srcdir/../lib/Decompiler.class.php");
6if (file_exists("$srcdir/phpdc.debug.php")) {
7    include("$srcdir/phpdc.debug.php");
8}
9
10if (!isset($argv)) {
11    $argv = $_SERVER['argv'];
12    $argc = $_SERVER['argc'];
13}
14
15$dc = new Decompiler();
16if (isset($argv[2])) {
17    eval('$dc->dc = ' . file_get_contents($argv[2]) . ';');
18}
19else if (isset($argv[1])) {
20    $dc->decompileFile($argv[1]);
21}
22else {
23    $phpcode = '';
24    if (!defined('stdin')) {
25        define('stdin', fopen('php://stdin', 'rb'));
26    }
27    while (!feof(stdin)) {
28        $phpcode .= fgets(stdin);
29    }
30    $dc->decompileString($phpcode);
31}
32$dc->output();
33
Note: See TracBrowser for help on using the repository browser.