public static function encodeFromFile($file, array $parameters = array())
    {
        $json = new JSON();

        $encoder = function($file) use ($parameters, $json) {
            extract($parameters);
            include $file;

            return $json;
        };

        return json_encode($encoder->__invoke($file));
    }