Group
Extension

Matches 4

Web-App ( A/AP/APLA/Web-App-1.21.tar.gz, APLA, 2012; MetaCPAN )
Web-App/lib/Web/App/Presenter/JSON.pm ( view source; MetaCPAN )
package Web::App::Presenter::JSON;
# $Id: JSON.pm,v 1.5 2009/03/29 10:08:42 apla Exp $

use Class::Easy;

use JSON;

use Web::App::Presenter;
use base qw(Web::App::Presenter);

1;

sub headers {
	my $
ontent-Type' => 'text/plain; charset=utf-8');
	# $headers->header ('Content-Type' => 'application/json');
	$headers->header ('Cache-Control' => 'no-store');
	# $headers->header ('Expires' => localtime
y $json = JSON->new;
	$json->allow_blessed (1);
	$json->convert_blessed (1);
	$json->pretty (1);
	$json->space_before (0);
	$json->space_after (0);
	
	my $json_text;
	
	my $t = timer ('dumping json');
Web-App ( A/AP/APLA/Web-App-1.21.tar.gz, APLA, 2012; MetaCPAN )
Web-App/lib/Web/App/Response.pm ( view source; MetaCPAN )

	# 1. set correct presentation
	# 2. remove redirect header
	
	$app->set_presentation ({type => 'json'});
	
	return;
}

sub new {
	my $class = shift;
	
	my $self = dclone ($template);
	
	if ($Class::
Web-App ( A/AP/APLA/Web-App-1.21.tar.gz, APLA, 2012; MetaCPAN )
Web-App/lib/Web/App/Helper.pm ( view source; MetaCPAN )
$pack->root;
	
	my $global_config_patch_json = delete $files->{global_config_patch_json};
	my $local_config_patch_json  = delete $files->{local_config_patch_json};
	
	debug "storing config files";
	
	
hin helper we have json structures
	my $serializer = Project::Easy::Config->serializer ('json');
	
	# global config
	my $patch = $serializer->parse_string ($global_config_patch_json);
	$pack->conf_pat
n
	$local_config_patch_json = Project::Easy::Config::string_from_template (
		$local_config_patch_json,
		$vars
	);
	$patch = $serializer->parse_string ($local_config_patch_json);
	$pack->fixup_path->
Web-App ( A/AP/APLA/Web-App-1.21.tar.gz, APLA, 2012; MetaCPAN )
Web-App/lib/Web/App/Request.pm ( view source; MetaCPAN )
content output";
	
	# fix for "Wide characters to print"
	binmode STDOUT, ":utf8";
	utf8::decode ($content);
	$| = 1;
	
	print $content;
}

sub TO_JSON {
	my $self = shift;
	
	return {%$self}; 
}

1;

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.