LdapTools\Configuration::load PHP Method

load() public method

Load the LDAP configuration from a YAML file. See the 'resources/config' folder for an example.
public load ( string $file )
$file string The path to the file.
    public function load($file)
    {
        if (!is_readable($file)) {
            throw new ConfigurationException(sprintf("Cannot read configuration file: %s", $file));
        }
        try {
            $config = Yaml::parse(file_get_contents($file));
        } catch (ParseException $e) {
            throw new ConfigurationException('Error in configuration file: %s', $e->getMessage());
        }
        return $this->loadFromArray($config);
    }