Apache-Wyrd

 view release on metacpan or  search on metacpan

Wyrd/Bot.pm  view on Meta::CPAN


Apache::Wyrd::Bot - Spawn a process and monitor it

=head1 SYNOPSIS

  <BASENAME::Bot basefile="/var/www/watchme" perl="/usr/bin/perl" />

=head1 DESCRIPTION

The Bot Wyrd provides a class of objects which operate in
the background and independent of the apache process, while
being monitored in a browser window.  This is useful for
showing updates to a time-consuming process, such as
building an index or converting a file between different
formats.

Because it uses HTML http-equivalent metadata to trigger the
browser reload, it should always be the outermost Wyrd on an
HTML page.

Bot uses the default UNIX shell and the machine filesystem

Wyrd/Site.pod  view on Meta::CPAN

word-searching for dynamic content on a page is solved by refreshing the
meta-information cache of a page when the dynamic content on it changes. 
Often, Widget objects are used to contain Pulls in this way so that
word-search data on a page is kept accurate.

=head2 IndexBots

The question of how to efficiently create onetime "builds" of the Index
cache is answered by the [MySQL]IndexBot class.  This is a combination Wyrd
and Bot (See Apache::Wyrd::Bot), which when served up causes an
Apache::Wyrd::Bot process to be launched in the background, systematically
requesting every page in the site to be served up, causing the index on each
page to be refreshed.  The bredth of these requests can be limited by file
modification date since a cached date to reduce the time for this build to
take.

=head2 Other Objects in the Apache::Wyrd::Site Hierarchy

This hierarchy is meant to be somewhat more volitile than the rest of the
Apache::Wyrd classes.  As useful objects following these conventions come
into common usage, they will be added to the area, but may not be adequately

Wyrd/Site/GDButton.pm  view on Meta::CPAN

right file extension of .gif or .png, case insensitive).  The template file is
copied to memory and then written to the file area indicated by the src
attribute.

=item width, height

(required w/o template) in pixels.

=item bgcolor, color

(required w/o template) background and foreground color, in six-digit hex form
(#RRGGBB).

=item size

Font size, in pixels.

=item font

Path to the font file.  Either absolute, relative, or root-dir-relative.  It
must be a TrueType font file, and your version of GD must support TrueType

Wyrd/Site/GDButton.pm  view on Meta::CPAN


sub _generate_output {
	my ($self) = @_;
	#trueColor is necessary in order to avoid crappy text rendering
	GD::Image->trueColor(1);
	my $changed = ($self->widgetindex->update_entry($self) or not(-f $self->{'outfile'}));
	if ($changed) {
		my $antialias = 1;
		$antialias = -1 if ($self->_flags->noantialias);

		#prep the background and allocate the foreground
		my ($image, $base_image) = ();
		my $template = $self->{'template'};
		if ($template) {
			my $type = $self->{'template'} =~ /\.(png|gif)/i;
			unless ($type) {
				$self->_raise_exception('template base image must be PNG or GIF.');
			}
			if (lc($type) eq 'gif') {
				$base_image = GD::Image->newFromGif($template);
			} else {



( run in 0.792 second using v1.01-cache-2.11-cpan-d8267643d1d )