-
-
Save jaytaph/4389357 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class saffire { | |
// Returns saffire version (should be tuple major.minor.build) | |
public method version(); | |
// Returns the git revision which was used for building this saffire version | |
public method git_revision(); | |
// Returns the current run_mode: "fastcgi", "repl", "cli" | |
public method run_mode(); | |
// Null or fastcgi class | |
public property fastcgi; | |
// Null or cli class | |
public property cli; | |
// Null or repl class | |
public property repl; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
saffire::cli { | |
// Hashtable with arguments (arguments[0] being the calling program) | |
public property arguments; | |
// stdin stream | |
public property stdin; | |
// stdout stream | |
public property stdout; | |
// stderr stream | |
public property stderr; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class saffire::fastcgi { | |
// Returns ROLE of the current fastCGI request ("responder", "authorized", "filter") | |
public method role(); | |
// Finishes the request (prematurely) | |
public method finish(); | |
// returns a fastCGI parameter (the environment send by the fastcgi server) | |
public method getParam(string key); | |
// FastCGI has some read/write stream functionality. Maybe implement this here as well? | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
saffire::repl.sf { | |
// Gets/sets the prompt for the REPL (saffire::repl.prompt(">>>");) | |
/* | |
* \d counter | |
* \e escape sequence (to do nifty ANSI coloring etc) | |
* \c current working dir | |
* \b current block | |
* \\ Actual slash | |
*/ | |
public method prompt(); | |
// If not-null, will call this method to display prompt. Any escape sequences are still parsed. | |
/* | |
* saffire::repl.set_prompt_callback(foo.bar); | |
* | |
* class foo { | |
* public method bar() { | |
* return "[" + date.now().format("H:i:s") + "] #\d>"; | |
* } | |
* | |
* prompts: | |
* [12:34:56] #1> | |
*/ | |
public method set_prompt_callback(); | |
// Sets a pager command that is executed when outputting data (ie: /usr/bin/less). Defaults to null. | |
public method pager(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment