File tree Expand file tree Collapse file tree 2 files changed +7
-19
lines changed Expand file tree Collapse file tree 2 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ public function sendError($code, $message){
80
80
* @return void
81
81
*/
82
82
public function run (){
83
+ $ result = FALSE ;
83
84
$ command = $ this ->getCommand ();
84
85
if ($ command && in_array ($ command , $ this ->apiCommands ) && method_exists ($ this , $ command )){
85
86
$ key = $ this ->getRequest ('apiKey ' , FALSE );
@@ -88,8 +89,8 @@ public function run(){
88
89
}
89
90
$ this ->defaults = $ this ->db ->getAPIKeyDefaults ($ key , $ this ->getCommand ());
90
91
$ result = call_user_func (array ($ this , $ this ->getCommand ()));
91
- $ this ->sendResult ($ result );
92
92
}
93
+ return $ result ;
93
94
}
94
95
95
96
/**
Original file line number Diff line number Diff line change 29
29
}
30
30
31
31
$ ctr = new ethplorerController ($ es );
32
- $ ctr ->run ();
32
+ $ result = $ ctr ->run ();
33
33
34
- $ result = array ();
35
- $ command = $ ctr ->getCommand ();
36
-
37
- switch ($ command ){
38
- case 'last ' :
39
- $ options = array (
40
- 'limit ' => isset ($ _GET ["limit " ]) ? (int )$ _GET ["limit " ] : 10 ,
41
- 'timestamp ' => isset ($ _GET ["timestamp " ]) ? (int )$ _GET ["timestamp " ] : 0 ,
42
- );
43
- if (isset ($ _GET ['token_address ' ]) && $ es ->isValidAddress (strtolower ($ _GET ['token_address ' ]))){
44
- $ options ['address ' ] = strtolower ($ _GET ['token_address ' ]);
45
- }
46
- $ result = $ es ->getLastTransfers ($ options );
47
- break ;
48
- default :
49
- $ ctr ->sendError (17 , 'Invalid request, check API manual there: https://github.com/EverexIO/Ethplorer/wiki/Ethplorer-API ' );
34
+ if (!$ result ){
35
+ $ ctr ->sendError (17 , 'Invalid request, check API manual there: https://github.com/EverexIO/Ethplorer/wiki/Ethplorer-API ' );
50
36
}
51
- $ ctr ->sendResult ($ result );
37
+
38
+ $ ctr ->sendResult ($ result );
You can’t perform that action at this time.
0 commit comments