AMF-Perl

 view release on metacpan or  search on metacpan

doc/code.html  view on Meta::CPAN

   
<textarea cols=50 rows=40>
use AMF::Perl;

package Foo;

sub new
{
    my ($proto)=@_;
    my $self={};
    bless $self, $proto;
    return $self;
}

sub bar
{
	my ($self, $arg1, $arg2) = @_;
	my $value;

	#Compute a return value
	#...

doc/code.html  view on Meta::CPAN

    <tr>
<td valign=top>
   
<textarea cols=50 rows=40>
package DataEcho;

sub new
{
    my ($proto)=@_;
    my $self={};
    bless $self, $proto;
    return $self;
}

sub echoNormal
{
    my ($self, $data) = @_;
    return $data;
}
sub echoDate
{

doc/cpu.pl  view on Meta::CPAN

=cut

use AMF::Perl;

package cpuUsage;

sub new
{
    my ($proto)=@_;
    my $self={};
    bless $self, $proto;
    return $self;
}

sub getCpuUsage
{
    my $output = `uptime`;
    my @tokens = split /\s+/, $output;
    #Remove commas.
    @tokens = map {s/,//g; $_} @tokens;
    

doc/examples/basic/basicservices/DataEcho.pm  view on Meta::CPAN

=cut

use AMF::Perl qw/amf_throw/;



sub new
{
    my ($proto)=@_;
    my $self={};
    bless $self, $proto;
    return $self;
}


sub methodTable
{
    return {
        "echoNormal" => {
            "description" => "Echoes the passed argument back to Flash (no need to set the return type)",
            "access" => "remote", # available values are private, public, remote

doc/examples/cpu/cpu.pl  view on Meta::CPAN

=cut

use AMF::Perl;

package cpuUsage;

sub new
{
    my ($proto)=@_;
    my $self={};
    bless $self, $proto;
    return $self;
}

sub getCpuUsage
{
    my ($self, $arg1, $arg2) = @_;
    my $output = `uptime`;
    my @tokens = split /\s+/, $output;
    #Remove commas.
    @tokens = map {s/,//g; $_} @tokens;

doc/examples/dataGrid/dataGrid.pl  view on Meta::CPAN

=cut

use AMF::Perl;

package DataGridModel;

sub new
{
    my ($proto)=@_;
    my $self={};
    bless $self, $proto;
    return $self;
}

sub getData
{
    my ($self, $arg1, $arg2) = @_;
    my @array;
    my %hash = ("From" => 'Simon', "Subject" =>'AMF::Perl presentation', "URL" => "http://www.simonf.com");
    push @array, \%hash;
    my %hash1 = ("From" => 'Adrian', "Subject" =>'GUI in Flash', "URL" => "http://www.dnalc.org");

doc/examples/petmarket/petmarket/api/dbConn.pm  view on Meta::CPAN

my $dbuser = "user";
my $dbpass = "password";

use DBI;
use AMF::Perl::Sql::MysqlRecordSet;

sub new
{
    my ($proto) = @_;
    my $self = {};
    bless $self, $proto;

    my $dbh = DBI->connect("DBI:mysql:host=$dbhost:db=$dbname","$dbuser","$dbpass",{ PrintError=>1, RaiseError=>1 }) or die "Unable to connect: " . $DBI::errstr . "\n";

    $self->dbh($dbh);

    my $recordset = AMF::Perl::Sql::MysqlRecordSet->new($dbh);
    $self->recordset($recordset);

    return $self;
}

doc/examples/petmarket/petmarket/api/stringresourcesservice.pm  view on Meta::CPAN


use warnings;
use strict;

my %bundle;

sub new
{
    my ($proto) = @_;
    my $self = {};
    bless $self, $proto;
    return $self;
}


sub methodTable
{
    return {
        "getAppStrings" => {
            "description" => "Returns app strings",
            "access" => "remote", 

doc/examples/sql/parkservices/ParkService.pm  view on Meta::CPAN

my $dbname = "database";
my $dbuser = "user";
my $dbpass = "password";

use DBI;

sub new
{
    my ($proto) = @_;
    my $self = {};
    bless $self, $proto;

    my $dbh = DBI->connect("DBI:mysql:host=$dbhost:db=$dbname","$dbuser","$dbpass",{ PrintError=>1, RaiseError=>1 })
        or die "Unable to connect: " . $DBI::errstr . "\n";

	my $recordset = AMF::Perl::Sql::MysqlRecordSet->new($dbh);
	$self->recordset($recordset);

    return $self;
}

lib/AMF/Perl.pm  view on Meta::CPAN

use AMF::Perl::IO::Serializer;
use AMF::Perl::IO::OutputStream;
use AMF::Perl::Util::Object;

# constructor
sub new
{
    my ($proto) = @_;
	my $class = ref($proto) || $proto;
    my $self = {};
    bless $self, $class;
    $self->{exec} = new AMF::Perl::App::Executive();
	$self->{"response"} = "/onResult";
    $self->{debug}=0;
    return $self;
}

sub debug
{
    my $self = shift;
    if (@_) {$self->{debug} = shift;}

lib/AMF/Perl/App/Executive.pm  view on Meta::CPAN

# The original classpath
#my $_origClassPath;
# switch to take different actions based on the header
#my $_headerFilter;
        
# constructor
sub new
{
    my ($proto)=@_;
    my $self={};
    bless $self, $proto;
    return $self;
    # nothing really to do here yet?
}


# setter for the _headerFilter
sub setHeaderFilter 
{
    my ($self, $header) = @_;
    $self->{_headerFilter} = $header;

lib/AMF/Perl/IO/Deserializer.pm  view on Meta::CPAN

}


#******************** PUBLIC METHODS ****************************/

# constructor that also dserializes the raw data
sub new
{
    my ($proto, $is, $encoding)=@_;
    my $self = {};
    bless $self, $proto;
    # the object to store the deserialized data
    $self->{amfdata} = new AMF::Perl::Util::Object();
    # save the input stream in this object
    $self->{inputStream} = $is;
	# save the encoding in this object
	$self->{encoding} = $encoding;
    # read the binary header
    $self->readHeader();
    # read the binary body
    $self->readBody();

lib/AMF/Perl/IO/InputStream.pm  view on Meta::CPAN


=cut

use strict;

#InputStream constructor
sub new
{
    my ($proto,  $rd )=@_;
    my $self={};
    bless $self, $proto;
    $self->{current_byte}=0;
    # store the stream in this object
    my @array =  split //, $rd;
    $self->{raw_data} = \@array;
    # grab the total length of this stream
    $self->{content_length} = @{$self->{raw_data}};
    if (unpack("h*", pack("s", 1)) =~ /01/)
    {
        $self->{byteorder} = 'big-endian';
    }

lib/AMF/Perl/IO/OutputStream.pm  view on Meta::CPAN


use strict;


#OutputStream constructor
sub new
{
    my ($proto)=@_;
    # the buffer
    my $self = {};
    bless $self, $proto;
    $self->{outBuffer} = "";
    if (unpack("h*", pack("s", 1)) =~ /01/)
    {
        $self->{byteorder} = 'big-endian';
    }
    else
    {
        $self->{byteorder} = 'little-endian';
    }
    return $self;

lib/AMF/Perl/IO/Serializer.pm  view on Meta::CPAN

use DBI;

# holder for the data
my $data;

sub new
{	
    my ($proto, $stream, $encoding) = @_;
    # save
    my $self={};
    bless $self, $proto;
    $self->{out} = $stream;
	$self->{encoding} = $encoding;
    return $self;
}

sub serialize
{
    my ($self, $d) = @_;
    $self->{amfout} = $d;
    # write the version ???

lib/AMF/Perl/Sql/MysqlRecordSet.pm  view on Meta::CPAN


=cut

use strict;
use AMF::Perl::Util::Object;

sub new
{
	my ($proto, $dbh) = @_;
	my $self = {};
	bless $self, $proto;
	$self->dbh($dbh);
	return $self;
}

sub dbh
{
    my ($self, $val) = @_;
    $self->{dbh} = $val if $val;
    return $self->{dbh};
}

lib/AMF/Perl/Util/Object.pm  view on Meta::CPAN


=cut

use strict;

# constructor
sub new
{
    my ($proto)=@_;
    my $self = {};
    bless $self, $proto;
    # init the headers and bodys arrays
    $self->{_headers} = [];
    $self->{_bodies} = [];
    return $self;
}

# adds a header to our object
# requires three arguments key, required, and value
sub addHeader
{

lib/AMF/Perl/Util/RemotingService.pm  view on Meta::CPAN

=item Created after AMF-PHP, though their dynamic inheritance is changed to wrapping.

=cut

use strict;

sub new 
{
	my ($proto, $name, $object) = @_;
	my $self = {};
	bless $self, $proto;
	$self->serviceName($name);
	$self->content($object);
	return $self;
}

sub content
{
    my $self = shift;
    if (@_) {$self->{content} = shift;}
    return $self->{content};



( run in 0.536 second using v1.01-cache-2.11-cpan-de7293f3b23 )