forked from AuthorizeNet/sdk-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genclass.sh
76 lines (68 loc) · 3.4 KB
/
genclass.sh
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
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# sudo apt-get install php5-curl
# composer install
#create directories that do not exist
apidir=lib/net/authorize/api/contract/v1
#net.authorize.api.contract.v1.
if [ -d "$apidir" ]; then
rm -r "$apidir"
fi
mkdir -p "$apidir"
echo Make sure the ns-dest uses destination as: $apidir
logfile=./xsdgen.log
echo `date` > $logfile
echo Generating PHP Classes >> $logfile
vendor/goetas/xsd2php/bin/xsd2php convert:php \
--ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/contract/v1' \
--ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
--ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
./AnetApiSchema.xsd >> $logfile 2>> $logfile
echo Generation of PHP Classes complete >> $logfile
jmsdir=lib/net/authorize/api/yml/v1
if [ -d "$jmsdir" ]; then
rm -r "$jmsdir"
fi
mkdir -p "$jmsdir"
echo Generating Serializers for Classes >> $logfile
vendor/goetas/xsd2php/bin/xsd2php convert:jms-yaml \
--ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/yml/v1' \
--ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
--ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
./AnetApiSchema.xsd >> $logfile
echo Generator output is in file: $logfile
#GOOD
# vendor/goetas/xsd2php/bin/xsd2php.php convert:php \
# --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/contract/v1' \
# --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
# --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
# /home/ramittal/AnetApiSchema.xsd >> $logfile
#Old good
# vendor/goetas/xsd2php/bin/xsd2php.php convert:php \
# --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/contract/v1' \
# --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
# --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
# /home/ramittal/AnetApiSchema.xsd
#
# jmsdir=lib/net/authorize/api/jms/v1
# mkdir -p $jmsdir
# rm -r $jmsdir\*
# Do not want JMS serializer
# echo Generating Serializers for Classes >> $logfile
# vendor/goetas/xsd2php/bin/xsd2php.php convert:jms-yaml \
# --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/jms/v1' \
# --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \
# --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \
# /home/ramittal/AnetApiSchema.xsd >> $logfile
#DOOG
#--alias-map='Vendor/Project/CustomDateClass; http://www.opentravel.org/OTA/2003/05#CustomOTADateTimeFormat'
# symfony/console suggests installing symfony/event-dispatcher ()
# symfony/console suggests installing psr/log (For using the console logger)
# phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1)
# phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
# symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
# ----------------
# zendframework/zend-stdlib suggests installing zendframework/zend-serializer (Zend\Serializer component)
# zendframework/zend-stdlib suggests installing zendframework/zend-servicemanager (To support hydrator plugin manager usage)
# zendframework/zend-code suggests installing doctrine/common (Doctrine\Common >=2.1 for annotation features)
# symfony/console suggests installing symfony/event-dispatcher ()
# symfony/console suggests installing psr/log (For using the console logger)