src/ConfigurationFactory.php
public function factory($filename, $format = 'json', $params = null, $paramsFile = null)
    {

        // try to load the JSON data
        if ($data = file_get_contents($filename)) {
            // initialize the JMS serializer, load and return the configuration
            return $this->factoryFromString($data, $format, $params, $paramsFile);
        }

        // throw an exception if the data can not be loaded from the passed file
        throw new \Exception(sprintf('Can\'t load configuration file %s', $filename));
    }
public function factory($filename, $format = 'json', $params = null, $paramsFile = null)
    {

        // try to load the JSON data
        if ($data = file_get_contents($filename)) {
            // initialize the JMS serializer, load and return the configuration
            return $this->factoryFromString($data, $format, $params, $paramsFile);
        }

        // throw an exception if the data can not be loaded from the passed file
        throw new \Exception(sprintf('Can\'t load configuration file %s', $filename));
    }
Factory implementation to create a new initialized configuration instance.

@param string $filename   The configuration filename
@param string $format     The format of the configuration file, either one of json, yaml or xml
@param string $params     A serialized string with additional params that'll be passed to the configuration
@param string $paramsFile A filename that contains serialized data with additional params that'll be passed to the configuration

@return \TechDivision\Import\Configuration\Jms\Configuration The configuration instance
@throws \Exception Is thrown, if the specified configuration file doesn't exist