view release on metacpan or search on metacpan
lib/Apache/AxKit/Provider/XMLDOMProvider.pm view on Meta::CPAN
$self->{id} = $url;
$self->{mtime_element} = $mtime_element;
}
# sub: get_fh
# we don't want to handle files, so we just throw an exception here.
sub get_fh {
throw Apache::AxKit::Exception::IO( -text => "Can't get filehandle for XMLDOMProvider (not yet implemented)!" );
}
# sub: get_strref
# since we refused to work with file handles, we HAVE to define this.
# returns a string containing the remote XML-DOM
lib/Apache/AxKit/Provider/XMLDOMProvider.pm view on Meta::CPAN
my $response = $self->{response};
my $string = $response->content();
# debug
#my $h = $response->server;
#throw Apache::AxKit::Exception::Error(-text => "Last Modified Header: \"$h\"");
# some XML validation
my $parser = XML::LibXML->new();
$parser->validation(0);
$parser->load_ext_dtd(0);
lib/Apache/AxKit/Provider/XMLDOMProvider.pm view on Meta::CPAN
my $dom;
eval {
$dom = $parser->parse_string($string);
};
if ($@) {
throw Apache::AxKit::Exception::Error( -text => "Input must be well-formed XML: $@" );
}
# if everything went fine, return xml-string-reference
return \$string;
}
lib/Apache/AxKit/Provider/XMLDOMProvider.pm view on Meta::CPAN
return $self->{id};
}
# sub: exists
# returns 1 if remote XML-DOM is accessible
# throws AxKit IO exception otherwise
sub exists {
my $self = shift;
my $response = $self->{response};
my $url = $self->{xmlfile};
if ( $response->is_success() ) {
return 1;
}
else {
throw Apache::AxKit::Exception::IO( -text => $response->status_line() . ": Cannot access upstream resource: \"$url\"" );
}
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
t/00-load.t view on Meta::CPAN
skip "Skipping dual bootstrap", 2 if ( $skip_mp1 or $skip_mp2 );
$dual_bootstrap =
eval { $pkg->new( { mod_perl => 0, mod_perl2 => 1.99022 } ); };
# this should not throw an exception since individual bootstraps worked
ok( !$@, 'no exception thrown for dual bootstrap: ' . $@ );
isa_ok( $dual_bootstrap, $pkg );
}
}
view all matches for this distribution
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
view release on metacpan or search on metacpan
bin/webstat_mail.pl view on Meta::CPAN
$stat{usercount} = 0;
my %visitors = ();
while (my ($counts, $remoteip) = $sth->fetchrow) {
# only count those who've looked at more than one page
# (throw away spiders (and other who doesn't support cookies))
if ($counts > 1) {
# count it, he support cookies
$stat{usercount}++;
} else {
# remember the looser by hand
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Emulator/Apache.pm view on Meta::CPAN
local $_;
print STDOUT while defined ($_ = <$fd>);
}
# Should this perhaps throw an exception?
# sub internal_redirect {}
# sub internal_redirect_handler {}
# Do something with ErrorDocument?
# sub custom_response {}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/ExtDirect/Router.pm view on Meta::CPAN
sub handler {
my ($r) = @_;
local $RPC::ExtDirect::Router::DEBUG = $DEBUG;
# If anything but POST method is used, throw an error
return Apache2::Const::DECLINED
if $r->method ne 'POST';
my $cgi = CGI->new($r);
view all matches for this distribution
view release on metacpan or search on metacpan
Client/lib/HTTunnel/Client.java view on Meta::CPAN
private String fhid = null ;
private String proto = null ;
private String peer_info = null ;
public Client(String _url) throws MalformedURLException {
url = new URL(_url) ;
}
public int connect(String proto, String host, int port) throws ClientException {
return connect(proto, host, port, 0) ;
}
public int connect(String _proto, String host, int port, int timeout) throws ClientException {
proto = _proto ;
if ((proto == null)||(proto.equals(""))){
proto = "tcp" ;
}
if ((host == null)||(host.equals(""))){
Client/lib/HTTunnel/Client.java view on Meta::CPAN
return 1 ;
}
public String read(int len) throws ClientException {
return read(len, 0) ;
}
public String read(int len, int timeout) throws ClientException {
if (timeout <= 0){
timeout = 15 ;
}
if (fhid == null){
throw new ClientException("HTTunnel.Client object is not connected") ;
}
while (true){
String addr = null ;
String port = null ;
Client/lib/HTTunnel/Client.java view on Meta::CPAN
}
catch (ClientTimeoutException hcte){
continue ;
}
catch (ClientException hce){
throw hce ;
}
return data ;
}
}
Client/lib/HTTunnel/Client.java view on Meta::CPAN
public String get_peer_info(){
return peer_info ;
}
public int print(String data) throws ClientException {
if (fhid == null){
throw new ClientException("HTTunnel.Client object is not connected") ;
}
execute(
"write",
new String [] { fhid, proto },
Client/lib/HTTunnel/Client.java view on Meta::CPAN
return 1 ;
}
public int close() throws ClientException {
if (fhid != null){
execute(
"close",
new String [] { fhid }
) ;
Client/lib/HTTunnel/Client.java view on Meta::CPAN
return 0 ;
}
private String execute(String cmd, String args[]) throws ClientException {
return execute(cmd, args, null) ;
}
private String execute(String cmd, String args[], String data) throws ClientException {
StringBuffer furlsb = new StringBuffer(url.toString() + "/" + cmd) ;
for (int i = 0 ; i < args.length ; i++){
furlsb.append("/" + args[i]) ;
}
Client/lib/HTTunnel/Client.java view on Meta::CPAN
}
response_callback(huc) ;
is = huc.getInputStream() ;
if (huc.getResponseCode() != HttpURLConnection.HTTP_OK){
throw new ClientException("HTTP error : " + huc.getResponseCode() +
" (" + huc.getResponseMessage() + ")") ;
}
byte buf[] = new byte[16834] ;
int len = 0 ;
while ((len = is.read(buf)) != -1){
rdata.append(new String(buf, 0, len)) ;
}
}
catch (IOException ioe){
throw new ClientException(ioe.getClass().getName() + ": " + ioe.getMessage()) ;
}
finally {
if (is != null){
try {
is.close() ;
Client/lib/HTTunnel/Client.java view on Meta::CPAN
}
String content = rdata.toString() ;
String code = content.substring(0, 3) ;
if (code.equals("err")){
throw new ClientException("Apache::HTTunnel error:" + content.substring(3)) ;
}
else if (code.equals("okn")){
return null ;
}
else if (code.equals("okd")){
return content.substring(3) ;
}
else if (code.equals("okt")){
throw new ClientTimeoutException() ;
}
else{
throw new ClientException("Invalid Apache::HTTunnel response code '" + code + "'") ;
}
}
protected void request_callback(HttpURLConnection huc){
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Handlers.pm view on Meta::CPAN
};
=head2 Errors
If code causes an error (such that an eval would set $@), then the request
will throw a SERVER_ERROR and write $@ to either STDERR (if not in mod_perl
and there is no C<die> handler, such as the L<Error|Error> module) or to
the Apache error log with a log level of debug.
=head2 C<Use>ing modules
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/HeavyCGI/Exception.pm view on Meta::CPAN
=head1 DESCRIPTION
The execution of the Apache::HeavyCGI::prepare method is protected by
an eval. Within that block the above mentioned exceptions can be
thrown. For a discussion of the semantics of these errors, see
L<Apache::HeavyCGI>.
You need not C<require> the Apache::HeavyCGI::Error module, it is
already required by Apache::HeavyCGI.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/JemplateFilter.pm view on Meta::CPAN
__PACKAGE__,
$r->uri,
$@;
$msg =~ s/\'/\\'/g; # '
$msg =~ s/[\x0A\x0D]/ /g;
$js = "throw('$msg')";
$log->error($msg);
}
$r->set_content_length( length $js );
$r->content_type('application/x-javascript');
$r->send_http_header($r->content_type);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/LoadAvgLimit.pm view on Meta::CPAN
use Sys::Load;
builder {
enable 'HTTPExceptions';
enable_if { (Sys::Load::getload())[0] > 3.00 }
sub { sub { HTTP::Exception::503->throw } };
$app;
};
You can run mod_perl1 application as psgi with L<Plack::Handler::Apache1>.
view all matches for this distribution
view release on metacpan or search on metacpan
If you turn C<RaiseError> on then you'd normally turn C<PrintError> off.
If C<PrintError> is also on, then the C<PrintError> is done first (naturally).
Typically C<RaiseError> is used in conjunction with C<eval { ... }>
to catch the exception that's been thrown and followed by an
C<if ($@) { ... }> block to handle the caught exception.
For example:
eval {
...
return what set_err() returns, as shown in the example above.
If the handle has C<RaiseError>, C<PrintError>, or C<HandleError>
etc. set then the set_err() method will honour them. This means
that if C<RaiseError> is set then set_err() won't return in the
normal way but will 'throw an exception' that can be caught with
an C<eval> block.
You can stash private data into DBI handles
via C<$h-E<gt>{private_..._*}>. See the entry under L</ATTRIBUTES
COMMON TO ALL HANDLES> for info and important caveats.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Mailtrack.pm view on Meta::CPAN
my $data;
our %config;
#
# If we didn't get set up correctly, warn about this and throw a really ugly error.
#
foreach(qw/db_dsn db_user db_pass db_table/)
{
error($r, 'Apache::Mailtrack> Please configure me correctly (check my manpage).')
unless $config{$_} = $r->dir_config($_);
view all matches for this distribution
view release on metacpan or search on metacpan
docsrc/reference.xml view on Meta::CPAN
</para>
<para>
pkit_on_error catch only fatal errors (die) NOT warnings.
</para>
<para>
If your code likes to throw an error let it die.
</para>
</refsect1>
</refentry>
<refentry id="model.api.pkit_session_setup">
view all matches for this distribution
view release on metacpan or search on metacpan
PerlVINC.pm view on Meta::CPAN
local @INC = @INC;
unshift @INC, @{ $cfg->{'VINC'} };
for (keys %{ $cfg->{'Files'} })
{
delete $INC{$_};
#let mod_perl catch any error thrown here
require $_;
}
return OK;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Perldoc.pm view on Meta::CPAN
} else {
$perldoc ||= "perldoc";
$pod2html ||= "pod2html";
}
# Get the path name and throw away errors on stderr
my $filename = qx( $perldoc -l $pod 2> /dev/null );
if ($?) {
print
"No such perldoc. Either you don't have that module installed, or the author neglected to provide documentation.";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Roaming.pm view on Meta::CPAN
(Instance Method) This method is checking whether the user has authorized
himself. The current implementation is checking only whether user name
is given via $r->connection()->user(), in other words you can use simple
basic authentication or something similar.
The method should throw an exception in case of problems.
=cut
sub Authenticate {
my $self = shift;
lib/Apache/Roaming.pm view on Meta::CPAN
(Instance method) Once the user is authenticated, this method should
determine whether the user is permitted to access the requested URI.
The current implementation verifies whether the user is accessing
a file in the directory $basedir/$user. If not, a Perl exception is
thrown with $ar_req->{'status'} set to FORBIDDEN.
=cut
sub CheckDir {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/SdnFw/js/controls.js view on Meta::CPAN
// enables autocompletion on multiple tokens. This is most
// useful when one of the tokens is \n (a newline), as it
// allows smart autocompletion after linebreaks.
if(typeof Effect == 'undefined')
throw("controls.js requires including script.aculo.us' effects.js library");
var Autocompleter = { };
Autocompleter.Base = Class.create({
baseInitialize: function(element, update, options) {
element = $(element);
lib/Apache/SdnFw/js/controls.js view on Meta::CPAN
parameters: 'editorId=' + encodeURIComponent(this.element.id),
onComplete: Prototype.emptyFunction,
onSuccess: function(transport) {
var js = transport.responseText.strip();
if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check
throw('Server returned an invalid collection representation.');
this._collection = eval(js);
this.checkForExternalText();
}.bind(this),
onFailure: this.onFailure
});
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Session/Wrapper.pm view on Meta::CPAN
if ( $err =~ /Object does not exist/ && defined $session_id )
{
return if $self->{allow_invalid_id};
Apache::Session::Wrapper::Exception::NonExistentSessionID->throw
( error => "Invalid session id: $session_id",
session_id => $session_id );
}
else
{
my $error =
$err ? $err : "Tying to Apache::Session::$self->{session_class_piece} failed but did not throw an exception";
die $error;
}
}
sub _bake_cookie
lib/Apache/Session/Wrapper.pm view on Meta::CPAN
=item * new
This method creates a new C<Apache::Session::Wrapper> object.
If the parameters you provide are not correct (wrong type, missing
parameters, etc.), this method throws an
C<Apache::Session::Wrapper::Exception::Params> exception. You can
treat this exception as a string if you want.
=item * session
lib/Apache/Session/Wrapper.pm view on Meta::CPAN
If this is true, an attempt to create a session with a session id that
does not exist in the session storage will be ignored, and a new
session will be created instead. If it is false, a
C<Apache::Session::Wrapper::Exception::NonExistentSessionID> exception
will be thrown instead.
This defaults to true.
=item * session_id => string
view all matches for this distribution
view release on metacpan or search on metacpan
SimpleTemplate.pm view on Meta::CPAN
=head2 template processing
Any errors in evaluating a code block should get logged to the error_log.
The compilation process tries to keep the line numbers consistent with
the template, but <%! %> declarations/definitions that are not at the
top of the template may throw line numbers off.
Any additional variables you wish to use must be declared (with 'my').
If you declare them in <%! %> or <% %> blocks, they will be accessible
in later blocks.
view all matches for this distribution
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
view release on metacpan or search on metacpan
t/External/Apache-Sling-Authn.t view on Meta::CPAN
$sling->{'Pass'} = 'badpasswordwillnotwork';
# Check creation with verbosity turned up:
$sling->{'Verbose'} = 3;
my $authn = Apache::Sling::Authn->new( \$sling );
isa_ok $authn, 'Apache::Sling::Authn', 'authentication';
throws_ok{ $authn->login_user() } qr%Basic Auth log in for user "$super_user" at URL "$sling_host" was unsuccessful%, 'Check authn object creation croaks with bad password and high verbosity';
# reset verbosity level:
$sling->{'Verbose'} = $verbose;
$authn = Apache::Sling::Authn->new( \$sling );
isa_ok $authn, 'Apache::Sling::Authn', 'authentication';
throws_ok{ $authn->login_user() } qr%Basic Auth log in for user "$super_user" at URL "$sling_host" was unsuccessful%, 'Check authn object creation croaks with bad password and default verbosity';
# Set the password to something that should work!
$sling->{'Pass'} = $super_pass;
# Check creating authn object fails with unsupported auth type:
$sling->{'Auth'} = 'badauthtypewillnotwork';
$authn = Apache::Sling::Authn->new( \$sling );
isa_ok $authn, 'Apache::Sling::Authn', 'authentication';
throws_ok{ $authn->login_user() } qr/Unsupported auth type: "badauthtypewillnotwork"/, 'Check authn object creation croaks with unsupported auth type';
# Set the auth type to something that should work!
$sling->{'Auth'} = undef;
# authn object:
t/External/Apache-Sling-Authn.t view on Meta::CPAN
ok( $user->add( $test_user2, $test_pass, \@test_properties ),
"Authn Test: User \"$test_user2\" added successfully." );
ok( $user->check_exists( $test_user2 ),
"Authn Test: User \"$test_user2\" exists." );
throws_ok{ $authn->switch_user( $test_user1, $test_pass, "badauthtypewillnotwork", 1 ) } qr/Unsupported auth type: "badauthtypewillnotwork"/, 'Check switch_user croaks with unsupported auth type';
throws_ok{ $authn->switch_user( "baduser", "badpassword", "basic", 1 ) } qr/Basic Auth log in for user "baduser" at URL "$sling_host" was unsuccessful/, 'Check switch_user croaks with bad credentials';
throws_ok{ $authn->switch_user( $super_user, "badpassword", "basic", 1 ) } qr/Basic Auth log in for user "$super_user" at URL "$sling_host" was unsuccessful/, 'Check switch_user croaks with bad password';
ok( $authn->switch_user( $test_user1, $test_pass, "basic", 1 ),
"Authn Test: Successfully switched to user: \"$test_user1\" with basic auth" );
ok( $authn->switch_user( $test_user1, $test_pass, "basic", 1 ),
"Authn Test: Successfully stayed as user: \"$test_user1\"" );
ok( $authn->switch_user( $test_user2, $test_pass, "basic", 1 ),
view all matches for this distribution
view release on metacpan or search on metacpan
# PerlSetVar apache_stage_regex " ^ (/STAGE/[^/]*) (.*) $ "
# This regex has to split a staged URI into two parts. It is
# evaluated with the /ox switch in effect, so this will NOT be a
# per-directory variable. The first part will be thrown away and
# just the second part will be served if the original URI cannot
# be accessed. In case of 301 and 302 redirects the first part
# will be prepended again. The default regex is defined as above
# which means that URIS will be split into "/STAGE/anyuser" and
# the rest.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Template.pm view on Meta::CPAN
[% INCLUDE /etc/passwd %]
will be honoured. The default setting is 'Off' and any attempt to
load a template by absolute filename will result in a 'file' exception
being throw with a message indicating that the ABSOLUTE option is not
set. See L<Template> for further discussion on exception handling.
=item TT2Relative
Equivalent to the RELATIVE configuration item. This is similar to the
lib/Apache/Template.pm view on Meta::CPAN
Enabling the option permits templates to be specifed as per this example:
[% INCLUDE ../../../etc/passwd %]
As with TT2Absolute, this option is set 'Off', causing a 'file' exception
to be thrown if used in this way.
=item TT2Delimiter
Equivalent to the DELIMTER configuration item, this can be set to define
an alternate delimiter for separating multiple TT2IncludePath options.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/TestConfig.pm view on Meta::CPAN
# untaint as we are going to use it a lot later on in -T sensitive
# operations (.e.g @INC)
$top_dir = $1 if $top_dir =~ /(.*)/;
# make sure that t/conf/apache_test_config.pm is found
# (unfortunately sometimes we get thrown into / by Apache so we
# can't just rely on $top_dir
lib->import($top_dir);
my $thaw = {};
#thaw current config
view all matches for this distribution
view release on metacpan or search on metacpan
Throttle/Log.pm view on Meta::CPAN
=item LogTypes
Only log requests with a MIME-type that matches this regular expression.
This is useful for only logging "^image/" if you plan to serve images and
the speeds for other large, compressable files are throwing off your
averages. It's probably much more efficient to keep all your images under
one directory and just put a <Location> container around the handler
definition though.
=item MinSize
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
if (object === undefined) return 'undefined';
if (object === null) return 'null';
return object.inspect ? object.inspect() : object.toString();
} catch (e) {
if (e instanceof RangeError) return '...';
throw e;
}
},
keys: function(object) {
var keys = [];
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
try {
this._each(function(value) {
try {
iterator(value, index++);
} catch (e) {
if (e != $continue) throw e;
}
});
} catch (e) {
if (e != $break) throw e;
}
return this;
},
eachSlice: function(number, iterator) {
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
all: function(iterator) {
var result = true;
this.each(function(value, index) {
result = result && !!(iterator || Prototype.K)(value, index);
if (!result) throw $break;
});
return result;
},
any: function(iterator) {
var result = false;
this.each(function(value, index) {
if (result = !!(iterator || Prototype.K)(value, index))
throw $break;
});
return result;
},
collect: function(iterator) {
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
detect: function(iterator) {
var result;
this.each(function(value, index) {
if (iterator(value, index)) {
result = value;
throw $break;
}
});
return result;
},
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
include: function(object) {
var found = false;
this.each(function(value) {
if (value == object) {
found = true;
throw $break;
}
});
return found;
},
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
} catch (e) {
var tagName = this.element.tagName.toUpperCase();
if (['TBODY', 'TR'].include(tagName)) {
this.insertContent(this.contentFromAnonymousTable());
} else {
throw e;
}
}
} else {
this.range = this.element.ownerDocument.createRange();
if (this.initializeRange) this.initializeRange();
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
this.parseExpression();
this.compileMatcher();
},
parseExpression: function() {
function abort(message) { throw 'Parse error in selector: ' + message; }
if (this.expression == '') abort('empty expression');
var params = this.params, expr = this.expression, match, modifier, clause, rest;
while (match = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)) {
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
splitValueBy('-') + '.first().toUpperCase() == ' + attribute.value.toUpperCase().inspect()
); break;
case '!=': conditions.push(value + ' != ' + attribute.value.inspect()); break;
case '':
case undefined: conditions.push('element.hasAttribute(' + attribute.name.inspect() + ')'); break;
default: throw 'Unknown operator ' + attribute.operator + ' in selector';
}
});
}
return conditions.join(' && ');
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
name: 'ElementDoesNotExistError',
message: 'The specified DOM element does not exist, but is required for this effect to operate'
},
tagifyText: function(element) {
if(typeof Builder == 'undefined')
throw("Effect.tagifyText requires including script.aculo.us' builder.js library");
var tagifyStyle = 'position:relative';
if(/MSIE/.test(navigator.userAgent) && !window.opera) tagifyStyle += ';zoom:1';
element = $(element);
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
Effect.Opacity = Class.create();
Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), {
initialize: function(element) {
this.element = $(element);
if(!this.element) throw(Effect._elementDoesNotExistError);
// make this work on IE on elements without 'layout'
if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout))
this.element.setStyle({zoom: 1});
var options = Object.extend({
from: this.element.getOpacity() || 0.0,
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
Effect.Move = Class.create();
Object.extend(Object.extend(Effect.Move.prototype, Effect.Base.prototype), {
initialize: function(element) {
this.element = $(element);
if(!this.element) throw(Effect._elementDoesNotExistError);
var options = Object.extend({
x: 0,
y: 0,
mode: 'relative'
}, arguments[1] || {});
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
Effect.Scale = Class.create();
Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), {
initialize: function(element, percent) {
this.element = $(element);
if(!this.element) throw(Effect._elementDoesNotExistError);
var options = Object.extend({
scaleX: true,
scaleY: true,
scaleContent: true,
scaleFromCenter: false,
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
Effect.Highlight = Class.create();
Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), {
initialize: function(element) {
this.element = $(element);
if(!this.element) throw(Effect._elementDoesNotExistError);
var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {});
this.start(options);
},
setup: function() {
// Prevent executing on elements not in the layout flow
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
Effect.Morph = Class.create();
Object.extend(Object.extend(Effect.Morph.prototype, Effect.Base.prototype), {
initialize: function(element) {
this.element = $(element);
if(!this.element) throw(Effect._elementDoesNotExistError);
var options = Object.extend({
style: {}
}, arguments[1] || {});
if (typeof options.style == 'string') {
if(options.style.indexOf(':') == -1) {
lib/Apache/UploadMeter/Resources/JavaScript.pm view on Meta::CPAN
if (styleSheet.cssRules) cssRules = styleSheet.cssRules;
else if (styleSheet.rules) cssRules = styleSheet.rules;
$A(cssRules).reverse().each(function(rule) {
if (selector == rule.selectorText) {
cssText = rule.style.cssText;
throw $break;
}
});
if (cssText) throw $break;
});
this.style = cssText.parseStyle();
options.afterFinishInternal = function(effect){
effect.element.addClassName(effect.options.style);
effect.transforms.each(function(transform) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Voodoo.pm view on Meta::CPAN
my $self = shift;
if (ref($Apache::Voodoo::Engine::debug)) {
$Apache::Voodoo::Engine::debug->exception(@_);
}
Apache::Voodoo::Exception::RunTime::Thrown->throw(join("\n",@_));
}
sub trace {
my $self = shift;
lib/Apache/Voodoo.pm view on Meta::CPAN
$_[1]->{_stop_chain_} = 1;
}
sub redirect {
shift;
Apache::Voodoo::Exception::Application::Redirect->throw(target => shift);
}
sub display_error {
shift;
my ($c,$e,$t);
lib/Apache/Voodoo.pm view on Meta::CPAN
$e = shift;
$t = shift || '/index';
}
if (ref($t)) {
Apache::Voodoo::Exception::Application::DisplayError->throw(
code => $c,
error => $e,
detail => $t
);
}
else {
Apache::Voodoo::Exception::Application::DisplayError->throw(
code => $c,
error => $e,
target => $t
);
}
lib/Apache/Voodoo.pm view on Meta::CPAN
shift;
my $m = shift || "Access Denied";
my $t = shift || "/access_denied";
if (ref($t)) {
Apache::Voodoo::Exception::Application::AccessDenied->throw(
error => $m,
detail => $t
);
}
else {
Apache::Voodoo::Exception::Application::AccessDenied->throw(
error => $m,
target => $t
);
}
}
sub raw_mode {
my ($self,$c,$d,$h) = @_;
Apache::Voodoo::Exception::Application::RawData->throw(
"content_type" => $c,
"data" => $d,
"headers" => $h
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Wombat/Connector.pm view on Meta::CPAN
sub start {
my $self = shift;
if ($self->{started}) {
my $msg = "start: connector already started";
Wombat::LifecycleException->throw($msg);
}
$self->{started} = 1;
$self->log(sprintf("%s started", $self->getName()), undef, 'INFO');
lib/Apache/Wombat/Connector.pm view on Meta::CPAN
sub stop {
my $self = shift;
unless ($self->{started}) {
my $msg = "stop: connector not started";
Wombat::LifecycleException->throw($msg);
}
undef $self->{started};
$self->debug(sprintf("%s stopped", $self->getName()));
view all matches for this distribution
view release on metacpan or search on metacpan
Wyrd/Site/GDButton.pm view on Meta::CPAN
$image->filledRectangle(0, 0, $self->{'width'} * 5, $self->{'height'} * 5, $bg);
}
my $fg = $image->colorAllocate($self->_get_color($self->{'color'}));
#First get the size of the text image. Since font shapes falling below
#the drawing line will throw off the placment, this value will be taken
#into account by _get_startpoint, which attempts to place the text at a
#more "natural" location. This setting is overridden with the "absolute"
#flag.
my @abstract = GD::Image->stringFT($antialias * $fg, $self->{'font'}, $self->{'size'} * 5, 0, 0, 0, $self->{'text'});
my ($x, $y) = $self->_get_startpoint(@abstract);
view all matches for this distribution