This file contains 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
Array | |
( | |
[name] => /1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/businessCategory=Private Organization/serialNumber=2158113/C=US/postalCode=94043/ST=California/L=Mountain View/street=350 Ellis Street/O=Symantec Corporation/OU=Infrastructure Operations/CN=knowledge.verisign.com | |
[subject] => Array | |
( | |
[UNDEF] => Array | |
( | |
[0] => US | |
[1] => Delaware | |
) |
This file contains 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
<?php | |
require_once "vendor/autoload.php"; | |
use Symfony\Component\Config; | |
use Symfony\Component\Config\Definition\ConfigurationInterface; | |
use Symfony\Component\Yaml\Yaml; | |
class MyConfig implements ConfigurationInterface | |
{ |
This file contains 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
search paths: [['.', './modules', '/usr/share/saffire/modules']] | |
/wwwroot/main.sf (namespace: '::') | |
---------------------------------------------- | |
import io; | |
import framework; | |
import notexisting; | |
io.print("hello world"); |
This file contains 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 git:(namespacing) ✗ ./build/release/saffire hello.sf | |
Hello world! | |
Hi Bar! | |
_ _ | |
| | (_) | |
_____ _____ ___ _ __ | |_ _ ___ _ __ | |
/ _ \ \/ / __/ _ \ `_ \| __| |/ _ \| `_ \ | |
| __/> < (_| __/ |_) | |_| | (_) | | | | | |
\___/_/\_\___\___| .__/ \__|_|\___/|_| |_| | |
| | |
This file contains 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
namespace Application; | |
class Controller { | |
protected $app; | |
function __construct($app) { | |
$this->app = $app; | |
} |
This file contains 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
interface DataInterface { | |
public method getData(); | |
} | |
class NullableData implements DataInterface { | |
} | |
class chartA implements DataInterface { | |
} | |
class chartB implements DataInterface { |
This file contains 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
import io; | |
import file; | |
f = file.open("test.txt", "r"); | |
io.print("FILE 1: ", f.path(), " => ", f.fileNo(), "\n"); | |
f2 = file.open("test.txt", "r"); | |
io.print("FILE 2: ", f2.path(), " => ", f2.fileNo(), "\n"); | |
io.dump(f.stat()); |
This file contains 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_MODULE_METHOD(file, write) { | |
t_file_object *file_obj = (t_file_object *)self; | |
t_string_object *str_obj; | |
if (! object_parse_arguments(SAFFIRE_METHOD_ARGS, "s", &str_obj)) { | |
return NULL; | |
} | |
long bytes_written = fwrite(str_obj->data.value->val, 1, str_obj->data.value->len, file_obj->data.fp); |
This file contains 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
#include "saffire.h" | |
#include <stdio.h> | |
Saffire::Object greet_method(Saffire::Arguments &args) { | |
Saffire::String s; | |
args.parse("s", &s); | |
return Saffire::String( std::string("hello ") + s.value() ); | |
} |
This file contains 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
JSON 1: {"foo":"bar","foo2":"bar2","foo3":"bar3"} | |
JSON 2: {"foo":"bar","foo2":"bar2","foo3":"bar3"} | |
JSON 3: { "foo": "bar", "foo2": "bar2", "foo3": "bar3" } | |
JSON 4: {"foo":"bar","foo2":"bar2","foo3":"bar3"} | |
JSON 4: { | |
"foo":"bar", | |
"foo2":"bar2", | |
"foo3":"bar3" | |
} | |
JSON 5: { |