forked from joelwan/php-object-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index3.php
66 lines (63 loc) · 2.01 KB
/
index3.php
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* @author Joel Wan & Mark Slemko. Designs by Jonathan Easton
* @link http://www.phpobjectgenerator.com
* @copyright Offered under the BSD license
* @abstract Php Object Generator automatically generates clean and tested Object Oriented code for your PHP4/PHP5 application.
*/
session_start();
include "./include/configuration.php";
include "./include/class.zipfile.php";
if ($GLOBALS['configuration']['soapEngine'] == "nusoap")
{
include "./services/nusoap.php";
}
if (isset($_SESSION['objectString']))
{
$_GET = null;
if ($GLOBALS['configuration']['soapEngine'] == "nusoap")
{
$client = new soapclient($GLOBALS['configuration']['soap'], true);
$attributeList = unserialize($_SESSION['attributeList']);
$typeList = unserialize($_SESSION['typeList']);
$params = array(
'objectName' => $_SESSION['objectName'],
'attributeList' => $attributeList,
'typeList' => $typeList,
'language' => $_SESSION['language'],
'wrapper' => $_SESSION['wrapper'],
'pdoDriver' => $_SESSION['pdoDriver'],
'db_encoding' => "0"
);
$package = unserialize($client->call('GeneratePackage', $params));
}
else if ($GLOBALS['configuration']['soapEngine'] == "phpsoap")
{
$client = new SoapClient('services/pog.wsdl', array('cache_wsdl' => 0));
$attributeList = unserialize($_SESSION['attributeList']);
$typeList = unserialize($_SESSION['typeList']);
$objectName = $_SESSION['objectName'];
$language = $_SESSION['language'];
$wrapper = $_SESSION['wrapper'];
$pdoDriver = $_SESSION['pdoDriver'];
$classList = unserialize($_SESSION['classList']);
$dbEncoding = "0";
try
{
$package = unserialize($client->GeneratePackage($objectName, $attributeList, $typeList, $language, $wrapper, $pdoDriver, $dbEncoding, $classList));
}
catch (SoapFault $e)
{
echo "Error: {$e->faultstring}";
}
}
$zipfile = new createZip();
$zipfile -> addPOGPackage($package);
$zipfile -> forceDownload("pog.".time().".zip");
$_POST = null;
}
else
{
header("Location:/");
}
?>