Embedly\Embedly::__construct PHP Method

__construct() public method

public __construct ( array $args = [] )
$args array
    public function __construct(array $args = array())
    {
        $args = array_merge(array('user_agent' => sprintf("Mozilla/5.0 (compatible; embedly-php/%s)", self::VERSION), 'key' => null, 'hostname' => null, 'api_version' => null), $args);
        if ($args['user_agent']) {
            $this->user_agent = $args['user_agent'];
        }
        if ($args['key']) {
            $this->key = $args['key'];
        }
        if ($args['hostname']) {
            $this->hostname = $args['hostname'];
        }
        if ($args['api_version']) {
            $this->api_version = array_merge($this->api_version, $args['api_version']);
        }
    }

Usage Example

Beispiel #1
0
 public function __construct()
 {
     parent::__construct(Config::get('embedly-l4::api_config'));
 }