Exemplo n.º 1
0
 /**
  * @param array $settings
  */
 public function __construct($settings)
 {
     parent::__construct($settings);
     $config = ArrayUtils::get($settings, 'config', []) ?: [];
     $this->setParameters($config);
     $this->setTransport($config);
     $this->setMailer();
 }
Exemplo n.º 2
0
 /**
  * Create a new SqlDbSvc
  *
  * @param array $settings
  *
  * @throws \InvalidArgumentException
  * @throws \Exception
  */
 public function __construct($settings = [])
 {
     parent::__construct($settings);
     $config = ArrayUtils::clean(ArrayUtils::get($settings, 'config'));
     $this->cacheEnabled = ArrayUtils::getBool($config, 'cache_enabled');
     $this->cacheTTL = intval(ArrayUtils::get($config, 'cache_ttl', \Config::get('df.default_cache_ttl')));
     $this->cachePrefix = 'service_' . $this->id . ':';
 }
Exemplo n.º 3
0
 /**
  * @param array $settings
  */
 public function __construct($settings = [])
 {
     $verbAliases = [Verbs::PUT => Verbs::POST, Verbs::MERGE => Verbs::PATCH];
     ArrayUtils::set($settings, "verbAliases", $verbAliases);
     parent::__construct($settings);
     $config = ArrayUtils::get($settings, 'config');
     $this->defaultRole = ArrayUtils::get($config, 'default_role');
     $this->setDriver($config);
 }
Exemplo n.º 4
0
 /**
  * @param array $settings
  */
 public function __construct($settings = [])
 {
     $verbAliases = [Verbs::PUT => Verbs::POST, Verbs::MERGE => Verbs::PATCH];
     ArrayUtils::set($settings, "verbAliases", $verbAliases);
     parent::__construct($settings);
     $config = ArrayUtils::get($settings, 'config');
     $this->publicPaths = ArrayUtils::get($config, 'public_path', []);
     $this->setDriver($config);
 }
Exemplo n.º 5
0
 /**
  * Create a new Script Service
  *
  * @param array $settings
  *
  * @throws \InvalidArgumentException
  * @throws \Exception
  */
 public function __construct($settings = [])
 {
     parent::__construct($settings);
     $config = ArrayUtils::clean(ArrayUtils::get($settings, 'config'));
     Session::replaceLookups($config, true);
     if (null === ($this->content = ArrayUtils::get($config, 'content', null, true))) {
         throw new \InvalidArgumentException('Script content can not be empty.');
     }
     if (null === ($this->engineConfig = ArrayUtils::get($config, 'engine', null, true))) {
         throw new \InvalidArgumentException('Script engine configuration can not be empty.');
     }
     $this->scriptConfig = ArrayUtils::clean(ArrayUtils::get($config, 'config', [], true));
 }
Exemplo n.º 6
0
 /**
  * Create a new RemoteWebService
  *
  * @param array $settings settings array
  *
  * @throws \InvalidArgumentException
  */
 public function __construct($settings)
 {
     parent::__construct($settings);
     $this->autoDispatch = false;
     $this->query = '';
     $this->cacheQuery = '';
     $config = ArrayUtils::get($settings, 'config', []);
     $this->baseUrl = ArrayUtils::get($config, 'base_url');
     // Validate url setup
     if (empty($this->baseUrl)) {
         throw new \InvalidArgumentException('Remote Web Service base url can not be empty.');
     }
     $this->parameters = ArrayUtils::clean(ArrayUtils::get($config, 'parameters', []));
     $this->headers = ArrayUtils::clean(ArrayUtils::get($config, 'headers', []));
     $this->cacheEnabled = ArrayUtils::getBool($config, 'cache_enabled');
     $this->cacheTTL = intval(ArrayUtils::get($config, 'cache_ttl', Config::get('df.default_cache_ttl')));
     $this->cachePrefix = 'service_' . $this->id . ':';
 }
Exemplo n.º 7
0
 /**
  * Create a new AwsSnsSvc
  *
  * @param array $settings
  *
  * @throws \InvalidArgumentException
  * @throws \Exception
  */
 public function __construct($settings)
 {
     parent::__construct($settings);
     $config = ArrayUtils::clean(ArrayUtils::get($settings, 'config', []));
     //  Replace any private lookups
     Session::replaceLookups($config, true);
     // statically assign the our supported version
     $config['version'] = '2010-03-31';
     if (isset($config['key'])) {
         $config['credentials']['key'] = $config['key'];
     }
     if (isset($config['secret'])) {
         $config['credentials']['secret'] = $config['secret'];
     }
     try {
         $this->conn = new SnsClient($config);
     } catch (\Exception $ex) {
         throw new InternalServerErrorException("AWS SNS Service Exception:\n{$ex->getMessage()}", $ex->getCode());
     }
     $this->region = ArrayUtils::get($config, 'region');
 }
Exemplo n.º 8
0
 /**
  * @param array $settings
  */
 public function __construct($settings = [])
 {
     parent::__construct($settings);
     $this->model = new EventSubscriber();
 }