public static function createFromEdgeRcFile($section = 'default', $path = null)
    {
        if ($section === null) {
            $section = 'default';
        }

        $ini = self::parseEdgeRcFile($path);

        if (!isset($ini[$section])) {
            throw new ConfigException("Section \"$section\" does not exist!");
        }

        $auth = new static();
        $auth->setAuth(
            $ini[$section]['client_token'],
            $ini[$section]['client_secret'],
            $ini[$section]['access_token']
        );

        if (isset($ini[$section]['host'])) {
            $auth->setHost($ini[$section]['host']);
        }

        if (isset($ini[$section]['max-size'])) {
            $auth->setMaxBodySize($ini[$section]['max-size']);
        }

        return $auth;
    }
public static function createFromEdgeRcFile($section = 'default', $path = null)
    {
        if ($section === null) {
            $section = 'default';
        }

        $ini = self::parseEdgeRcFile($path);

        if (!isset($ini[$section])) {
            throw new ConfigException("Section \"$section\" does not exist!");
        }

        $auth = new static();
        $auth->setAuth(
            $ini[$section]['client_token'],
            $ini[$section]['client_secret'],
            $ini[$section]['access_token']
        );

        if (isset($ini[$section]['host'])) {
            $auth->setHost($ini[$section]['host']);
        }

        if (isset($ini[$section]['max-size'])) {
            $auth->setMaxBodySize($ini[$section]['max-size']);
        }

        return $auth;
    }
public static function createFromEdgeRcFile ( $ section = 'default' , $ path = null ) { if ( $ section === null ) { $ section = 'default' ; } $ ini = self :: parseEdgeRcFile ( $ path ) ; if ( ! isset ( $ ini [ $ section ] ) ) { throw new ConfigException ( "Section \"$section\" does not exist!" ) ; } $ auth = new static ( ) ; $ auth -> setAuth ( $ ini [ $ section ] [ 'client_token' ] , $ ini [ $ section ] [ 'client_secret' ] , $ ini [ $ section ] [ 'access_token' ] ) ; if ( isset ( $ ini [ $ section ] [ 'host' ] ) ) { $ auth -> setHost ( $ ini [ $ section ] [ 'host' ] ) ; } if ( isset ( $ ini [ $ section ] [ 'max-size' ] ) ) { $ auth -> setMaxBodySize ( $ ini [ $ section ] [ 'max-size' ] ) ; } return $ auth ; }
Create instance using an .edgerc configuration file

@param string $section
@param string|null $path

@return Authentication
@throws \Akamai\Open\EdgeGrid\Authentication\Exception\ConfigException
Create instance using an . edgerc configuration file