mirror of
https://github.com/awslabs/aws-crt-php.git
synced 2026-08-18 10:07:12 +00:00
AWS Credentials support, StaticCredentials Provider (#17)
* added credentials API, disabled FFI backend for now * Added CredentialsTest * Added support for specifying CMAKE_BUILD_TYPE on the command line * Added support for AwsCredentials and StaticCredentialsProvider
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace AWS\CRT;
|
||||
|
||||
final class Options {
|
||||
private $options = [];
|
||||
|
||||
public function __construct($opts = []) {
|
||||
$this->options = $opts;
|
||||
}
|
||||
|
||||
public function __get($name) {
|
||||
return (isset($this->options[$name])) ? $this->options[$name] : null;
|
||||
}
|
||||
|
||||
public function asArray() {
|
||||
return $this->options;
|
||||
}
|
||||
|
||||
public function toArray() {
|
||||
return array_merge_recursive([], $this->options);
|
||||
}
|
||||
|
||||
public function getInt($name) {
|
||||
$val = $this->$name;
|
||||
return (is_null($val)) ? 0 : (int)$val;
|
||||
}
|
||||
|
||||
public function getString($name) {
|
||||
return !empty($this->options[$name]) ? strval($this->options[$name]) : "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user