|
| 1 | +#!/bin/bash |
| 2 | +#sed -i "/ARBGetSubscriptionRequest/,/^}/s%^}%\t//JsonSerialize code appended\n |
| 3 | +#}\n |
| 4 | +#test\n |
| 5 | +#entry%" "ARBGetSubscriptionRequest.php" |
| 6 | + |
| 7 | +#sed -E "/ARBGetSubscriptionRequest/,/^}/s%^}%s\t//777 code appended[\n] s /\ |
| 8 | +#/}%" "ARBGetSubscriptionRequest.php" |
| 9 | + |
| 10 | + |
| 11 | +#perl -p -w -e "/ARBGetSubscriptionRequest/,/^}/s%^}%s\t//777 code appended[\n] s /\ |
| 12 | +#/}%" "ARBGetSubscriptionRequest.php" |
| 13 | +# |
| 14 | +#file='ARBGetSubscriptionRequest.php' |
| 15 | +#echo $file; |
| 16 | +#perl -p -w -e "s|(.+)}|$1KKM|xms;" $file |
| 17 | +# |
| 18 | +#perl - $ <<'__HERE__' |
| 19 | +#my $text = `cat ARBGetSubscriptionRequest.php`; |
| 20 | +#$text =~ s|(.+)}|$1$sub|xms; |
| 21 | +#my $sub = `cat appendSetCode.txt`; |
| 22 | +#print 'Result : '.$sub."\n"; |
| 23 | +#__HERE__ |
| 24 | +#$line =~ s/\}(\s*)$/:$1/; |
| 25 | +#perl test.pl requestList.txt |
| 26 | +# |
| 27 | +##!/bin/bash |
| 28 | + |
| 29 | +echo "Starting appending seralization code `date`" |
| 30 | + |
| 31 | +#ls *.php | grep -i -e "request\.php"> requestList.txt |
| 32 | +#ls *.php | grep -i -e "response\.php" > responseList.txt |
| 33 | +# ls *.php | grep -i -e "type\.php" | grep -i -v "ANetApi" > typeList.txt |
| 34 | +#ls *.php | grep -i -e "type\.php" > typeList.txt |
| 35 | +#find . -print | grep -i -e "type\.php" > typeList.txt |
| 36 | +#find -print | grep -i -e "type\.php" | cut -c 3- > typeList.txt |
| 37 | + |
| 38 | +# List filenames with request, response and type and remove the file path upto v1 i.e. 38 characters |
| 39 | +find ../lib/net/authorize/api/contract/v1 -print | grep -i -e "request\.php" | cut -c 38- > requestList.txt |
| 40 | +find ../lib/net/authorize/api/contract/v1 -print | grep -i -e "response\.php" | cut -c 38- > responseList.txt |
| 41 | +find ../lib/net/authorize/api/contract/v1 -print | grep -i -e "type\.php" | cut -c 38- > typeList.txt |
| 42 | + |
| 43 | +#mkdir -p ../lib/net/authorize/api/contract/v1/backup |
| 44 | + |
| 45 | +#appendJsonSeralizeCode=`cat appendJsonSeralizeCode.txt` |
| 46 | +#appendSetCode=`cat appendSetCode.txt` |
| 47 | + |
| 48 | +echo "Taking backup of Types" |
| 49 | +perl backup.pl typeList.txt |
| 50 | +echo "Appending JsonSerialize code to Types" |
| 51 | +perl appendJsonSeralizeCode.pl typeList.txt |
| 52 | +echo "Appending Set code to Types" |
| 53 | +perl appendSetCode.pl typeList.txt |
| 54 | + |
| 55 | + |
| 56 | +echo "Taking backup of Requests" |
| 57 | +perl backup.pl requestList.txt |
| 58 | +echo "Appending JsonSerialize code to Requests" |
| 59 | +perl appendJsonSeralizeCode.pl requestList.txt |
| 60 | +#echo "Appending Set code to Requests" |
| 61 | +#perl appendSetCode.pl requestList.txt |
| 62 | + |
| 63 | +echo "Taking backup of Responses" |
| 64 | +perl backup.pl responseList.txt |
| 65 | +#echo "Appending JsonSerialize code to Responses" |
| 66 | +#perl appendJsonSeralizeCode.pl responseList.txt |
| 67 | +echo "Appending Set code to Responses" |
| 68 | +perl appendSetCode.pl responseList.txt |
| 69 | + |
| 70 | +echo "Done Phase 1" |
| 71 | + |
| 72 | +#list="typeList.txt" |
| 73 | +#while read -r filename |
| 74 | +#do |
| 75 | +# filename=$(echo "$filename" | sed -e "s/^\.\///g") |
| 76 | +# echo "Appending implements JsonSerializable to - $filename" |
| 77 | +# sed -i '/^class/ s/$/ implements \\JsonSerializable/' "$filename" |
| 78 | +# |
| 79 | +#done < "$list" |
| 80 | + |
| 81 | + |
0 commit comments