|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# sudo apt-get install php5-curl |
| 4 | +# composer install |
| 5 | + |
| 6 | +#create directories that do not exist |
| 7 | +apidir=lib/net/authorize/api/contract/v1 |
| 8 | +#net.authorize.api.contract.v1. |
| 9 | +if [ -d "$apidir" ]; then |
| 10 | + rm -r "$apidir" |
| 11 | +fi |
| 12 | +mkdir -p "$apidir" |
| 13 | +echo Make sure the ns-dest uses destination as: $apidir |
| 14 | +logfile=./xsdgen.log |
| 15 | +echo `date` > $logfile |
| 16 | +echo Generating PHP Classes >> $logfile |
| 17 | +vendor/goetas/xsd2php/bin/xsd2php.php convert:php \ |
| 18 | + --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/contract/v1' \ |
| 19 | + --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \ |
| 20 | + --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \ |
| 21 | + ./AnetApiSchema.xsd >> $logfile 2>> $logfile |
| 22 | +echo Generation of PHP Classes complete >> $logfile |
| 23 | + |
| 24 | +jmsdir=lib/net/authorize/api/yml/v1 |
| 25 | +if [ -d "$jmsdir" ]; then |
| 26 | + rm -r "$jmsdir" |
| 27 | +fi |
| 28 | +mkdir -p "$jmsdir" |
| 29 | +echo Generating Serializers for Classes >> $logfile |
| 30 | +vendor/goetas/xsd2php/bin/xsd2php.php convert:jms-yaml \ |
| 31 | + --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/yml/v1' \ |
| 32 | + --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \ |
| 33 | + --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \ |
| 34 | + ./AnetApiSchema.xsd >> $logfile |
| 35 | +echo Generator output is in file: $logfile |
| 36 | + |
| 37 | +#GOOD |
| 38 | +# vendor/goetas/xsd2php/bin/xsd2php.php convert:php \ |
| 39 | + # --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/contract/v1' \ |
| 40 | + # --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \ |
| 41 | + # --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \ |
| 42 | + # /home/ramittal/AnetApiSchema.xsd >> $logfile |
| 43 | +#Old good |
| 44 | +# vendor/goetas/xsd2php/bin/xsd2php.php convert:php \ |
| 45 | + # --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/contract/v1' \ |
| 46 | + # --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \ |
| 47 | + # --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \ |
| 48 | + # /home/ramittal/AnetApiSchema.xsd |
| 49 | +# |
| 50 | +# jmsdir=lib/net/authorize/api/jms/v1 |
| 51 | +# mkdir -p $jmsdir |
| 52 | +# rm -r $jmsdir\* |
| 53 | +# Do not want JMS serializer |
| 54 | +# echo Generating Serializers for Classes >> $logfile |
| 55 | +# vendor/goetas/xsd2php/bin/xsd2php.php convert:jms-yaml \ |
| 56 | + # --ns-dest='net.authorize.api.contract.v1.;lib/net/authorize/api/jms/v1' \ |
| 57 | + # --ns-map='http://www.w3.org/2001/XMLSchema;W3/XMLSchema/2001/' \ |
| 58 | + # --ns-map='AnetApi/xml/v1/schema/AnetApiSchema.xsd;net.authorize.api.contract.v1' \ |
| 59 | + # /home/ramittal/AnetApiSchema.xsd >> $logfile |
| 60 | +#DOOG |
| 61 | + |
| 62 | + |
| 63 | +#--alias-map='Vendor/Project/CustomDateClass; http://www.opentravel.org/OTA/2003/05#CustomOTADateTimeFormat' |
| 64 | + |
| 65 | +# symfony/console suggests installing symfony/event-dispatcher () |
| 66 | +# symfony/console suggests installing psr/log (For using the console logger) |
| 67 | +# phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1) |
| 68 | +# phpunit/phpunit suggests installing phpunit/php-invoker (~1.1) |
| 69 | +# symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them) |
| 70 | + |
| 71 | +# ---------------- |
| 72 | +# zendframework/zend-stdlib suggests installing zendframework/zend-serializer (Zend\Serializer component) |
| 73 | +# zendframework/zend-stdlib suggests installing zendframework/zend-servicemanager (To support hydrator plugin manager usage) |
| 74 | +# zendframework/zend-code suggests installing doctrine/common (Doctrine\Common >=2.1 for annotation features) |
| 75 | +# symfony/console suggests installing symfony/event-dispatcher () |
| 76 | +# symfony/console suggests installing psr/log (For using the console logger) |
0 commit comments