Result:
found more than 549 distributions - search limited to the first 2001 files matching your query ( run in 0.926 )


AnyEvent-SCGI

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

	# If the modification time is only slightly in the future,
	# sleep briefly to remove the problem.
	my $a = $s - time;
	if ( $a > 0 and $a < 5 ) { sleep 5 }

	# Too far in the future, throw an error.
	my $t = time;
	if ( $s > $t ) { die <<"END_DIE" }

Your installer $0 has a modification time in the future ($s > $t).

 view all matches for this distribution


AnyEvent-SMTP

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

		# If the modification time is only slightly in the future,
		# sleep briefly to remove the problem.
		my $a = $s - time;
		if ( $a > 0 and $a < 5 ) { sleep 5 }

		# Too far in the future, throw an error.
		my $t = time;
		if ( $s > $t ) { die <<"END_DIE" }

Your installer $0 has a modification time in the future ($s > $t).

 view all matches for this distribution


AnyEvent-Subprocess

 view release on metacpan or  search on metacpan

lib/AnyEvent/Subprocess/DefaultDelegates.pm  view on Meta::CPAN

Calls a list of coderefs whenever a line is read from a handle.

=head2 PrintError

Delegate that calls a callback in the child to print the exception (if
any) the child throws.

Use WithResult if you want to actually get the exception in the parent.

=head1 Timeout

 view all matches for this distribution


AnyEvent-Superfeedr

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

		# If the modification time is only slightly in the future,
		# sleep briefly to remove the problem.
		my $a = $s - time;
		if ( $a > 0 and $a < 5 ) { sleep 5 }

		# Too far in the future, throw an error.
		my $t = time;
		if ( $s > $t ) { die <<"END_DIE" }

Your installer $0 has a modification time in the future ($s > $t).

 view all matches for this distribution


AnyEvent-Task

 view release on metacpan or  search on metacpan

lib/AnyEvent/Task.pm  view on Meta::CPAN


To acquire a worker process you call the C<checkout> method on the client object. The C<checkout> method doesn't need any arguments, but several optional ones such as C<timeout> are described below. As long as the checkout object is around, this chec...

The checkout object is an object that proxies its method calls to a worker process or a function that does the same. The arguments to this method/function are the arguments you wish to send to the worker process followed by a callback to run when the...

In the event of an exception thrown by the worker process, a timeout, or some other unexpected condition, an error is raised in the dynamic context of the callback (see the L<ERROR HANDLING> section).




=head1 DESIGN

Both client and server are of course built with L<AnyEvent>. However, workers can't use AnyEvent (yet). I've never found a need to do event processing in the worker since if the library you wish to use is already AnyEvent-compatible you can simply us...

Each client maintains a "pool" of connections to worker processes. Every time a checkout is requested, the request is placed into a first-come, first-serve queue. Once a worker process becomes available, it is associated with that checkout until that...

C<timeout> can be passed as a keyword argument to C<checkout>. Once a request is queued up on that checkout, a timer of C<timout> seconds (default is 30, undef means infinity) is started. If the request completes during this timeframe, the timer is c...

Note that since timeouts are associated with a checkout, checkouts can be created before the server is started. As long as the server is running within C<timeout> seconds, no error will be thrown and no requests will be lost. The client will continua...

Because of checkout queuing, the maximum number of worker processes a client will attempt to obtain can be limited with the C<max_workers> argument when creating a client object. If there are more live checkouts than C<max_workers>, the remaining che...

The C<min_workers> argument determines how many "hot-standby" workers should be pre-forked when creating the client. The default is 2 though note that this may change to 0 in the future.

lib/AnyEvent/Task.pm  view on Meta::CPAN




=head1 ERROR HANDLING

In a synchronous program, if you expected some operation to throw an exception you might wrap it in C<eval> like this:

    my $crypted;

    eval {
      $crypted = hash('secret');

lib/AnyEvent/Task.pm  view on Meta::CPAN

      say "hash failed: $@";
    } else {
      say "hashed password is $crypted";
    }

But in an asynchronous program, typically C<hash> would initiate some kind of asynchronous operation and then return immediately, allowing the program to go about other tasks while waiting for the result. Since the error might come back at any time i...

AnyEvent::Task accomplishes this mapping with L<Callback::Frame>.

Callback::Frame lets you preserve error handlers (and C<local> variables) across asynchronous callbacks. Callback::Frame is not tied to AnyEvent::Task, AnyEvent or any other async framework and can be used with almost all callback-based libraries.

However, when using AnyEvent::Task, libraries that you use in the client must be L<AnyEvent> compatible. This restriction obviously does not apply to your server code, that being the main purpose of this module: accessing blocking resources from an a...

As an example usage of Callback::Frame, here is how we would handle errors thrown from a worker process running the C<hash> method in an asychronous client program:

    use Callback::Frame;

    frame(code => sub {

lib/AnyEvent/Task.pm  view on Meta::CPAN

      say "Error is: $@";
      say "Full back-trace: $back_trace";

    })->(); ## <-- frame is created and then immediately executed

Of course if C<hash> is something like a bcrypt hash function it is unlikely to raise an exception so maybe that's a bad example. On the other hand, maybe it's a really good example: In addition to errors that occur while running your callbacks, L<An...



=head2 Rationale for Callback::Frame

lib/AnyEvent/Task.pm  view on Meta::CPAN




=head2 Reforking of workers after errors

If a worker throws an error, the client receives the error but the worker process stays running. As long as the client has a reference to the checkout (and as long as the exception wasn't "fatal" -- see below), it can still be used to communicate wit...

However, once the checkout object is destroyed, by default the worker will be shutdown instead of returning to the client's worker pool as in the normal case where no errors were thrown. This is a "safe-by-default" behaviour that may help in the even...

There are cases where workers will never be returned to the worker pool: workers that have thrown fatal errors such as loss of worker connection or hung worker timeout errors. These errors are stored in the checkout and for as long as the checkout ex...

Another reason that a worker might not be returned to the worker pool is if it has been checked out C<max_checkouts> times. If C<max_checkouts> is specified as an argument to the Client constructor, then workers will be destroyed and reforked after b...



lib/AnyEvent/Task.pm  view on Meta::CPAN


AnyEvent::Task clients send discrete messages and receive ordered replies from workers, much like HTTP. The AnyEvent::Task protocol can be extended in a backwards-compatible manner like HTTP. AnyEvent::Task communication can be pipelined and possibly...

The current AnyEvent::Task server obeys a very specific implementation policy: It is like a CGI server in that each process it forks is guaranteed to be handling only one connection at once so it can perform blocking operations without worrying about...

But since a single process can handle many requests in a row without exiting, they are more like persistent FastCGI processes. The difference however is that while a client holds a checkout it is guaranteed an exclusive lock on that process (useful f...

The fundamental difference between the AnyEvent::Task protocol and HTTP is that in AnyEvent::Task the client is the dominant protocol orchestrator whereas in HTTP it is the server.

In AnyEvent::Task, the client manages the worker pool and the client decides if/when worker processes should terminate. In the normal case, a client will just return the worker to its worker pool. A worker is supposed to accept commands for as long a...

The client decides the timeout for each checkout and different clients can have different timeouts while connecting to the same server.

Client processes can be started and checkouts can be obtained before the server is even started. The client will continue trying to connect to the server to obtain worker processes until either the server starts or the checkout's timeout period lapse...

The client even decides how many minimum workers should be in the pool upon start-up and how many maximum workers to acquire before checkout creation requests are queued. The server is really just a dumb fork-on-demand server and most of the sophisti...



 view all matches for this distribution


AnyEvent-Twitter

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

		# If the modification time is only slightly in the future,
		# sleep briefly to remove the problem.
		my $a = $s - time;
		if ( $a > 0 and $a < 5 ) { sleep 5 }

		# Too far in the future, throw an error.
		my $t = time;
		if ( $s > $t ) { die <<"END_DIE" }

Your installer $0 has a modification time in the future ($s > $t).

 view all matches for this distribution


AnyEvent-WebSocket-Client

 view release on metacpan or  search on metacpan

lib/AnyEvent/WebSocket/Client.pm  view on Meta::CPAN

The protocol version.  See L<Protocol::WebSocket> for the list of supported
WebSocket protocol versions.

=head2 subprotocol

List of subprotocols to request from the server.  This class will throw an
exception if none of the protocols are supported by the server.

=head2 http_headers

Extra headers to include in the initial request.  May be either specified

 view all matches for this distribution


AnyEvent-WebSocket-Server

 view release on metacpan or  search on metacpan

lib/AnyEvent/WebSocket/Server.pm  view on Meta::CPAN

is the minimal valid code for C<handshake>.

In addition to C<$response>, you can return C<@other_results> if you want.
Those C<@other_results> can be obtained later from the condition variable of C<establish()> method.

If you throw an exception from C<$handshake> code, we think you reject the C<$request>.
In this case, the condition variable of C<establish()> method croaks.


=item C<validator> => CODE (optional)

lib/AnyEvent/WebSocket/Server.pm  view on Meta::CPAN


    @other_results = $validator->($request)

where C<$request> is a L<Protocol::WebSocket::Request> object.

If you reject the C<$request>, throw an exception.

If you accept the C<$request>, don't throw any exception.
The return values of the C<$validator> are sent to the condition variable of C<establish()> method.

=item C<ssl_key_file> => FILE_PATH (optional)

A string of the filepath to the SSL/TLS private key file in PEM format.

 view all matches for this distribution


AnyEvent-Whois-Raw

 view release on metacpan or  search on metacpan

lib/AnyEvent/Whois/Raw.pm  view on Meta::CPAN

So, now get_all_whois will not block because result already ready. Net::Whois::Raw::whois() or
Net::Whois::Raw::get_whois() will return without exceptions and so, callback will be called.
To store current state we are using localized stash.
recursive_whois() has one problem, it catches exceptions and our die("Call me later") will not interrupt
it. We using require hook to workaround it. We replace eval with our
defined smart_eval, which will rethrow exception if it was our exception.

=pod

=head1 NAME

 view all matches for this distribution


AnyEvent-Worker

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

		# If the modification time is only slightly in the future,
		# sleep briefly to remove the problem.
		my $a = $s - time;
		if ( $a > 0 and $a < 5 ) { sleep 5 }

		# Too far in the future, throw an error.
		my $t = time;
		if ( $s > $t ) { die <<"END_DIE" }

Your installer $0 has a modification time in the future ($s > $t).

 view all matches for this distribution


AnyEvent-XMPP

 view release on metacpan or  search on metacpan

lib/AnyEvent/XMPP/Error/Exception.pm  view on Meta::CPAN

use strict;
our @ISA = qw/AnyEvent::XMPP::Error/;

=head1 NAME

AnyEvent::XMPP::Error::Exception - Some exception was thrown somewhere

Subclass of L<AnyEvent::XMPP::Error>

=head2 METHODS

=over 4

=item B<exception>

This returns the exception object that was thrown in C<$@>.

=cut

sub exception { $_[0]->{exception} }

=item B<context>

This returns a string which describes the context in which this exception
was thrown

=cut

sub context   { $_[0]->{context} }

 view all matches for this distribution


AnyEvent-XSPromises

 view release on metacpan or  search on metacpan

XSPromises.xs  view on Meta::CPAN

        }

        on_resolve = (items > 1) ? ST(1) : &PL_sv_undef;
        on_reject  = (items > 2) ? ST(2) : &PL_sv_undef;

        /* Many promises are just thrown away after the final callback, no need to allocate a next promise for those */
        if (GIMME_V != G_VOID) {
            AnyEvent__XSPromises__Promise* next_promise;
            Newxz(next_promise, 1, AnyEvent__XSPromises__Promise);

            next = xspr_promise_new(aTHX);

XSPromises.xs  view on Meta::CPAN

        AnyEvent::XSPromises::Promise* self
        SV* on_reject
    PPCODE:
        xspr_promise_t* next = NULL;

        /* Many promises are just thrown away after the final callback, no need to allocate a next promise for those */
        if (GIMME_V != G_VOID) {
            AnyEvent__XSPromises__Promise* next_promise;
            Newxz(next_promise, 1, AnyEvent__XSPromises__Promise);

            next = xspr_promise_new(aTHX);

XSPromises.xs  view on Meta::CPAN

        AnyEvent::XSPromises::Promise* self
        SV* on_finally
    PPCODE:
        xspr_promise_t* next = NULL;

        /* Many promises are just thrown away after the final callback, no need to allocate a next promise for those */
        if (GIMME_V != G_VOID) {
            AnyEvent__XSPromises__Promise* next_promise;
            Newxz(next_promise, 1, AnyEvent__XSPromises__Promise);

            next = xspr_promise_new(aTHX);

 view all matches for this distribution


AnyEvent-ZabbixSender

 view release on metacpan or  search on metacpan

ZabbixSender.pm  view on Meta::CPAN

Creates a (virtual) connection to a zabbix server. Since each submission
requires a new TCP connection, creating the connection object does not
actually contact the server.

The connection object will linger in the destructor until all data has
been submitted or thrown away.

You can specify various configuration parameters. The term C<@items>
refers to an array with C<[key, value, clock]> array-refs.

=over 4

ZabbixSender.pm  view on Meta::CPAN

connection is being established or retried will be batched together in any
case.

=item queue_time => $seconds (default: C<3600>)

The amount of time a data item will be queued until it is thrown away when
the server cannot be reached.

=item linger_time => $seconds (default: same as C<queue_time>)

The amount of time the module will linger in its destructor until all

ZabbixSender.pm  view on Meta::CPAN

other than a zabbix server is running on a port. The given key-value pairs
are the lost items.

=item on_loss => $cb->($zbx, \@items) (default: log and continue)

Will be called when some data items are thrown away (this happens if the
server isn't reachable for at least C<queue_time> seconds),

=item on_response => $cb->($zbx, \@items, \%response) (default: not called)

Will be called with the (generally rather useless) response form the

 view all matches for this distribution


AnyEvent-mDNS

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

		# If the modification time is only slightly in the future,
		# sleep briefly to remove the problem.
		my $a = $s - time;
		if ( $a > 0 and $a < 5 ) { sleep 5 }

		# Too far in the future, throw an error.
		my $t = time;
		if ( $s > $t ) { die <<"END_DIE" }

Your installer $0 has a modification time in the future ($s > $t).

 view all matches for this distribution


AnyMQ-AMQP

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

		# If the modification time is only slightly in the future,
		# sleep briefly to remove the problem.
		my $a = $s - time;
		if ( $a > 0 and $a < 5 ) { sleep 5 }

		# Too far in the future, throw an error.
		my $t = time;
		if ( $s > $t ) { die <<"END_DIE" }

Your installer $0 has a modification time in the future ($s > $t).

 view all matches for this distribution


AnyMQ-Pg

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

		# If the modification time is only slightly in the future,
		# sleep briefly to remove the problem.
		my $a = $s - time;
		if ( $a > 0 and $a < 5 ) { sleep 5 }

		# Too far in the future, throw an error.
		my $t = time;
		if ( $s > $t ) { die <<"END_DIE" }

Your installer $0 has a modification time in the future ($s > $t).

 view all matches for this distribution


AnyMQ

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

		# If the modification time is only slightly in the future,
		# sleep briefly to remove the problem.
		my $a = $s - time;
		if ( $a > 0 and $a < 5 ) { sleep 5 }

		# Too far in the future, throw an error.
		my $t = time;
		if ( $s > $t ) { die <<"END_DIE" }

Your installer $0 has a modification time in the future ($s > $t).

 view all matches for this distribution


AnySan

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

		# If the modification time is only slightly in the future,
		# sleep briefly to remove the problem.
		my $a = $s - time;
		if ( $a > 0 and $a < 5 ) { sleep 5 }

		# Too far in the future, throw an error.
		my $t = time;
		if ( $s > $t ) { die <<"END_DIE" }

Your installer $0 has a modification time in the future ($s > $t).

 view all matches for this distribution


Apache-ASP

 view release on metacpan or  search on metacpan

ASP.pm  view on Meta::CPAN

#	print STDERR "END $$data\n\n";
    }

    # we only do this check the first time we call ParseHelper() from
    # Parse() with $check_static_file set.  Calls from ParseXMLSubs()
    # will leave this off.  This is where we start to throw data 
    # back that lets the system render a static file as is instead
    # of executing it as a per subroutine.
    return if ($check_static_file && $$data !~ /\<\%.*?\%\>/s);

    my(@out, $perl_block, $last_perl_block);

ASP.pm  view on Meta::CPAN


    my $rv; # for readability
    my $error = $@;

    if($@) {
	$self->CompileError($eval); # don't throw error, so we can throw die later
	$subid && $self->UndefRoutine($subid);
	$rv = undef;
    } else {
	if($subid) {
	    if(&config($self, 'RegisterIncludes')) {

ASP.pm  view on Meta::CPAN

  global.asa when $^W is set will trigger subroutine redefinition
  warnings.  Reloading global.asa should occur without any problems
  under normal usage of the system, thus this work around.

  This fix is important to UseStrict functionality because warnings
  automatically become thrown as die() errors with UseStrict enabled,
  so we have to disable normal soft warnings here.

 -$Response->Include() runtime errors now throw a die() that
  can be trapped.  This was old functionality that has been restored.
  Other compile time errors should still trigger a hard error
  like script compilation, global.asa, or $Response->Include()
  without an eval()

ASP.pm  view on Meta::CPAN

 +Better handling of "use strict" errors in ASP scripts.
  The error is detected, and the developer is pointed to the 
  Apache error log for the exact error.  

  The script with "use strict" errors will be recompiled again.  Its seems 
  though that "use strict" will only throw its error once, so that a script 
  can be recompiled with the same errors, and work w/o any use strict
  error messaging.  

=item $VERSION = 0.12; $DATE="07/01/1999";

ASP.pm  view on Meta::CPAN

  normal includes.

 +Perl script generated from asp scripts should match line
  for line, seen in errors, except when using inline (default) 
  includes, pod comments, or <% #comment %> perl comments, which 
  will throw off the line counts by adding text, removing
  text, or having an extra newline added, respectively.

 -Script_OnEnd may now send output to the browser.  Before
  $main::Response->End() was being called at the end of the
  main script preventing further output.

 view all matches for this distribution


Apache-AuthCookie

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

   - reorganized tree to support multiple mod_perl versions.
   - rewrote tests to use Apache::Test framework from CPAN.
   - fix POD errors in authorize() documentation.
   - initial support for mod_perl version 2
   - mp2: check for Apache::RequestRec arg so that unported subclasses
     throw exceptions.

Version: 3.04
   - add _convert_to_get() to login_form(), and make POST -> GET conversion
     skip credentials and destination data so only extra data is copied. This 
     ensures that "destination" wont contain the login data.

 view all matches for this distribution


Apache-AxKit-Language-XSP-ObjectTaglib

 view release on metacpan or  search on metacpan

lib/Apache/AxKit/Language/XSP/ObjectTaglib.pm  view on Meta::CPAN


The C<description> and C<summary> tags call the C<description> and C<summary>
methods on each course object with the loop, this time making sure that the
result is valid XML instead of plain text. (This is because we store the
description in the database as XML, and don't want it escaped before AxKit
throws it onto the page.)

      }, {
        tag      => 'presentations',
        target   => 'course',
        type     => 'loop',

 view all matches for this distribution


Apache-AxKit-Plugin-Param-Expr

 view release on metacpan or  search on metacpan

lib/Apache/AxKit/Plugin/Param/Expr.pm  view on Meta::CPAN

    $r->pnotes('INPUT',{}) unless $r->pnotes('INPUT');
    my $apr = Apache::Request->instance($r);
    while (@param > 1) {
        my $val = eval($param[-1]);
        AxKit::Debug(5,"param '$param[-2]': ($param[-1]) = $val");
        throw Apache::AxKit::Exception::Error(-text => "AxParamExpr '$param[-2]': $@") if $@;
        $val = '' if !defined $val;
        $r->pnotes('INPUT')->{$param[-2]} = $val;
        $apr->param($param[-2],$val);
        pop @param;
        pop @param;

lib/Apache/AxKit/Plugin/Param/Expr.pm  view on Meta::CPAN

    my $key = '';
    @param = $r->dir_config->get('AxCacheParamExpr');
    while (@param > 1) {
        my $val = eval($param[-1]);
        AxKit::Debug(5,"param '$param[-2]': ($param[-1]) = $val");
        throw Apache::AxKit::Exception::Error(-text => "AxCacheParamExpr '$param[-2]': $@") if $@;
        $val = '' if !defined $val;
        $r->pnotes('INPUT')->{$param[-2]} = $val;
        $apr->param($param[-2],$val);
        $key .= '|'.$val;
        pop @param;

lib/Apache/AxKit/Plugin/Param/Expr.pm  view on Meta::CPAN

    }
    @param = $r->dir_config->get('AxCacheExpr');
    while (@param) {
        my $val = $r->pnotes('INPUT')->{$param[0]};
        AxKit::Debug(5,"param '$param[0]': () = $val");
        throw Apache::AxKit::Exception::Error(-text => "AxCacheExpr '$param[0]': $@") if $@;
        $val = '' if !defined $val;
        $key .= '|'.$val;
        shift @param;
    }
    $r->notes('axkit_cache_extra', $r->notes('axkit_cache_extra') . $key);

 view all matches for this distribution


Apache-AxKit-Plugin-Session

 view release on metacpan or  search on metacpan

lib/AxKit/XSP/Auth.pm  view on Meta::CPAN

	}
	$$global{'auth_online_users'} ||= {};
	$$global{'auth_online_users'}{$$session{'auth_access_user'}} = $$session{'_session_id'};
	$$global{'auth_logins'}++;
}
throw Apache::AxKit::Exception::Retval(return_code => $rc) unless $attr_destination eq 'none';
EOC
}

sub logout : XSP_attribOrChild(destination)
{

lib/AxKit/XSP/Auth.pm  view on Meta::CPAN

if (defined $attr_destination) {
	$rc = $auth_type->logout($r,$attr_destination);
} else {
	$rc = $auth_type->logout($r,$r->uri);
}
throw Apache::AxKit::Exception::Retval(return_code => $rc);
EOC
}

sub check_permission : XSP_attribOrChild(target,reason) XSP_childStruct($text(lang))
{
	return 'if (do {'.has_permission(@_).'}) { '.deny_permission(@_).' }';
}

sub deny_permission : XSP_attribOrChild(reason) XSP_childStruct($text(lang))
{
	return '$$session{"auth_reason"} = $attr_reason || "permission_denied"; $$session{"auth_reason_desc"} = $_{"text"}; throw Apache::AxKit::Exception::Retval(return_code => Apache::Constants::FORBIDDEN); ';
}

sub has_permission : XSP_attribOrChild(target) XSP_expr
{
	return 'Apache::AxKit::Plugin::Session::has_permission($r,$attr_target)?1:0';

 view all matches for this distribution


Apache-AxKit-Provider-CGI

 view release on metacpan or  search on metacpan

CGI.pm  view on Meta::CPAN

use XML::Simple;

# copied mostly from Filter provider...
sub get_fh {
    my $self = shift;
    throw Apache::AxKit::Exception::IO(-text => "Can't get fh for CGI filehandle");
}

sub get_strref {
    my $self = shift;
    require $self->{file};

 view all matches for this distribution


Apache-AxKit-Provider-DOM

 view release on metacpan or  search on metacpan

DOM.pm  view on Meta::CPAN

sub mtime        { return time; }
sub has_changed  { return 1; }
sub key          { return 'dom_provider'; }

sub get_fh {
    throw Apache::AxKit::Exception::IO( -text => "Can't get fh for Scalar" );
}

#------------------------------------------------------------------------#
# get_strref                                                             #
#------------------------------------------------------------------------#
# The DOM provider returns the string value of the document tree if a
# document is present, otherwise it throws an error
#
sub get_strref {
    my $self = shift;
    if ( defined $self->{dom_tree} ) {
        my $str = $self->{dom_tree}->toString;
        $self->{apache}->pnotes('dom_tree' => $self->{dom_tree} );
        return \$str;
    }
    else {
        throw Apache::AxKit::Exception::IO( -text => "Can't get the XML DOM" );
    }
}


1;

 view all matches for this distribution


Apache-AxKit-Provider-File-Formatter

 view release on metacpan or  search on metacpan

lib/Apache/AxKit/Provider/File/Formatter.pm  view on Meta::CPAN

  my $contents = <$fh>;
  
  my $whichformatter = $r->dir_config('FormatterModule');
  AxKit::Debug(5, "Formatter Provider configured to use " . $whichformatter);
  unless ($whichformatter =~ m/^Formatter::\w+::\w+$/) {
    throw Apache::AxKit::Exception::Error( -text => "$whichformatter doesn't look like a formatter to me");
  }
  eval "use $whichformatter";
  throw Apache::AxKit::Exception::Error( -text => $whichformatter . " not found, you may need to install it from CPAN") if $@;
  my $formatter = "$whichformatter"->format($contents);
  my $parser = XML::LibXML->new();
  return $parser->parse_html_string($formatter->document);
}

lib/Apache/AxKit/Provider/File/Formatter.pm  view on Meta::CPAN


sub get_strref { return \ shift->get_dom->toString; }


sub get_fh {
   throw Apache::AxKit::Exception::IO( -text => "Can't get fh for Formatter" );
}


=head1 SEE ALSO

 view all matches for this distribution


Apache-AxKit-Provider-File-Syntax

 view release on metacpan or  search on metacpan

Syntax.pm  view on Meta::CPAN

# see if we can use File::MimeInfo::Magic
eval "use File::MimeInfo::Magic qw( mimetype )";
$noMimeInfo = 1 if $@;

#
# We can't output a filehandle, so throw the necessary exception
sub get_fh {
    throw Apache::AxKit::Exception::IO( -text => "Can't get fh for Syntax" );
}

#
# perform the necessary mime-type processing magic
sub get_strref {

 view all matches for this distribution


Apache-AxKit-Provider-OpenOffice

 view release on metacpan or  search on metacpan

OpenOffice.pm  view on Meta::CPAN


sub get_fh {
    my $self = shift;
    my $zip = Archive::Zip->new();
    if ($zip->read($self->{file}) != AZ_OK) {
        throw Apache::AxKit::Exception::IO (-text => "Couldn't read OpenOffice file '$self->{file}'");
    }
    my $r = $self->apache_request;
    my $member;
    
    my $path_info = $r->path_info;

OpenOffice.pm  view on Meta::CPAN

sub get_strref {
    my $self = shift;

    my $zip = Archive::Zip->new();
    if ($zip->read($self->{file}) != AZ_OK) {
        throw Apache::AxKit::Exception::IO (-text => "Couldn't read OpenOffice file '$self->{file}'");
    }
    my $r = $self->apache_request;
    my $member;
    
    my $path_info = $r->path_info;

OpenOffice.pm  view on Meta::CPAN

    else {
        $member = $zip->memberNamed('content.xml') || $zip->memberNamed('Content.xml');
    }
    my ($data, $status) = $member->contents();
    if ($status != AZ_OK) {
        throw Apache::AxKit::Exception::Error(
                -text => "Contents.xml could not be retrieved from $self->{file}"
                );
    }

    if ( $path_info =~ /\.(png|gif|jpg)$/ ) {
        my $image_type = $1;
        $r->content_type( 'image/' . $image_type );
        $r->send_http_header();
        $r->print( $data );
        throw Apache::AxKit::Exception::Declined(
                -text => "[OpenOffice] Image detected, skipping further processing."
                );
    }

    return \$data;

 view all matches for this distribution


Apache-AxKit-Provider-PodSAX

 view release on metacpan or  search on metacpan

PodSAX.pm  view on Meta::CPAN

use Pod::SAX;

sub get_strref {
    my $self = shift;
    if ($self->_is_dir()) {
        throw Apache::AxKit::Exception::IO(
          -text => "$self->{file} is a directory - please overload File provider and use AxContentProvider option");
    }

    my $outie;
    my $w = XML::SAX::Writer->new( Output => \$outie );

PodSAX.pm  view on Meta::CPAN

    eval {
      $generator->parse_uri( $self->{file} );
        };

    if (my $error = $@) {
        throw Apache::AxKit::Exception::IO(
          -text => "PodSAX Generator Error: $error");
    }
    #warn "OUTIE $outie \n";
    return \$outie
}

PodSAX.pm  view on Meta::CPAN

    AxKit::Debug(5, "'$file' not recognised as POD");
    return 0;
}

sub get_fh {
    throw Apache::AxKit::Exception::IO(
          -text => "Can't get filehandles from POD"
    );
}

1;

 view all matches for this distribution


Apache-AxKit-Provider-RDBMS

 view release on metacpan or  search on metacpan

lib/Apache/AxKit/Provider/RDBMS/ContentProvider.pm  view on Meta::CPAN


sub init {
}

sub getContent {
    throw Apache::AxKit::Exception::Error( -text => "subclasses must implement this method" );
}

1;

 view all matches for this distribution


( run in 0.926 second using v1.01-cache-2.11-cpan-496ff517765 )