Skip to content

Commit

Permalink
Develop
Browse files Browse the repository at this point in the history
  • Loading branch information
spiderbytes committed Jul 23, 2017
1 parent b2096e2 commit 0761b04
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ system/templates/cgi-ohne-Access-Control-Allow-Origin.pb.cfg
system/templates/cgi-ohne-Access-Control-Allow-Origin.pb
system/templates/cgi.pb.cfg
Examples/ExampleMixed.sb.cfg
Examples/tempcgi.pb
70 changes: 57 additions & 13 deletions Examples/ExampleMixed.sb
Original file line number Diff line number Diff line change
@@ -1,22 +1,66 @@
XIncludeFile "../includes/SpiderBite.sbi"
XIncludeFile "../includes/SpiderBite.sbi"

#SpiderBite_Profile = "default"

EnablePbCgi

Procedure.s myPbCgiProcedure()
ProcedureReturn "Hello from myPbCgiProcedure"
EndProcedure

DisablePbCgi
! var returnValue;
! [].unshift.call(arguments, arguments.callee.name.substring(2));
! var async;
! var successFunction;
! var errorFunction;
! if (typeof f_mypbcgiprocedurecallback == 'function') {
! async = true;
! successFunction = function(result) { f_mypbcgiprocedurecallback(true, result); };
! errorFunction = function(a,b,c) { f_mypbcgiprocedurecallback(false, b + '/' + c); };
! } else {
! async = false;
! successFunction = function(result) { returnValue = result; };
! errorFunction = function(a,b,c) { returnValue = 'error: ' + b + '/' + c; };
! }
! $.ajax({
! url: 'http://spiderbytes.tuebben.de/demos/testcgi/testcgi.exe',
! type: 'POST',
! data: arguments,
! dataType: 'text',
! processData: true,
! async: async,
! cache: false,
! success: successFunction,
! error: errorFunction
! });
! return returnValue;
EndProcedure


EnablePHP

Procedure.s myPhpProcedure()
! return "Hello from myPhpProcedure";
EndProcedure

DisablePHP
! var returnValue;
! [].unshift.call(arguments, arguments.callee.name.substring(2));
! var async;
! var successFunction;
! var errorFunction;
! if (typeof f_myphpprocedurecallback == 'function') {
! async = true;
! successFunction = function(result) { f_myphpprocedurecallback(true, result); };
! errorFunction = function(a,b,c) { f_myphpprocedurecallback(false, b + '/' + c); };
! } else {
! async = false;
! successFunction = function(result) { returnValue = result; };
! errorFunction = function(a,b,c) { returnValue = 'error: ' + b + '/' + c; };
! }
! $.ajax({
! url: 'http://localhost/test.php',
! type: 'POST',
! data: arguments,
! dataType: 'text',
! processData: true,
! async: async,
! cache: false,
! success: successFunction,
! error: errorFunction
! });
! return returnValue;
EndProcedure


Debug myPbCgiProcedure()
Debug myPhpProcedure()
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ Debug myPbCgiProcedure()

{ToDo}

## ToDo

* Funktioniert noch nicht, wenn man eine WebApp erstellen möchte.

* Momentan sind nur einfache Übergabeparameter erlaubt.

# Lizenz

MIT-Lizenz
Expand Down

0 comments on commit 0761b04

Please sign in to comment.