A class name can be in one of the following formats:
- Unqualified class name (UCN)
| // 7. Create sig | |
| // This is why we can't have nice things | |
| if (! defined('OPENSSL_ALGO_SHA256')) define('OPENSSL_ALGO_SHA256', 7); | |
| // // sign & encrypt the sig | |
| // var md = forge.md.sha256.create(); | |
| // md.update(body.bytes()); | |
| // var sig = id.private.sign(md); | |
| openssl_sign($body, $sig, $my_priv_key, OPENSSL_ALGO_SHA256); |
| // 6. Encrypt inner packet | |
| $blob = $inner_packet->encode(); | |
| $cipher = new \Crypt_AES(CRYPT_AES_MODE_CTR); | |
| $cipher->setIv($iv); | |
| $cipher->setKey($hash); | |
| $body = $cipher->encrypt($blob); |
| /** | |
| * Taken from Nikita Popov's answer on stack overflow: http://stackoverflow.com/questions/16489509/decrypting-aes-ctr-little-endian-with-php | |
| */ | |
| static public function ctr_crypt($str, $cipher = MCRYPT_RIJNDAEL_256, $key, $iv) { | |
| $numOfBlocks = ceil(strlen($str) / 16); | |
| $ctrStr = ''; | |
| for ($i = 0; $i < $numOfBlocks; ++$i) { | |
| $ctrStr .= $iv; |
A basic datastructure is defined as:
<datastructure>[<elementlist>]
| import saffire; | |
| import http::request; | |
| import saffire::sapi; | |
| class http { | |
| protected property sapi = null; | |
| public method detectSapi() { | |
| switch (saffire.sapi()) { | |
| case "fastcgi" : |
| /usr/share/saffire/modules | |
| /usr/share/saffire/modules/sfl | |
| /usr/share/saffire/modules/sfl/io.sf | |
| /usr/share/saffire/modules/sfl/saffire.sf | |
| /usr/share/saffire/modules/Framework.sf | |
| /usr/share/saffire/modules/Framework | |
| /usr/share/saffire/modules/Framework/View.sf | |
| /usr/share/saffire/modules/Framework/Http.sf |
| diff --git a/src/components/compiler/saffire.y b/src/components/compiler/saffire.y | |
| index 1d9ff12..06702b8 100644 | |
| --- a/src/components/compiler/saffire.y | |
| +++ b/src/components/compiler/saffire.y | |
| @@ -95,7 +95,7 @@ | |
| %token T_CATCH "catch" T_BREAK "break" T_GOTO "goto" T_BREAKELSE "breakelse" | |
| %token T_CONTINUE "continue" T_THROW "throw" T_RETURN "return" T_FINALLY "finally" | |
| %token T_TRY "try" T_DEFAULT "default" T_METHOD "method" | |
| -%token T_SELF "self" T_PARENT "parent" T_NS_SEP T_TO | |
| +%token T_SELF "self" T_PARENT "parent" T_NS_SEP "::" T_TO |
| namespace eval moin { | |
| bind pubm -|- * moin::moin | |
| } | |
| proc moin::moin { nick host handle chan text } { | |
| if {[regexp -nocase -- {(^moin|^mornin)} $text]} { | |
| putserv "PRIVMSG $chan :$nick moin" | |
| } | |
| if {[regexp -nocase -- {(^:\)|^:P)} $text]} { |
| namespace eval moin { | |
| bind pubm -|- * moin::moin | |
| } | |
| proc moin::moin { nick host handle chan text } { | |
| if {[regexp -nocase -- {(^moin|^mornin)} $text]} { | |
| putserv "PRIVMSG $chan :$nick moin" | |
| } | |
| } |