[Catalyst-commits] r10501 - in Catalyst-Runtime/5.80/trunk/lib: .
Catalyst Catalyst/Component Catalyst/DispatchType
Catalyst/Engine Catalyst/Engine/HTTP
Catalyst/Engine/HTTP/Restarter Catalyst/Request
dandv at dev.catalyst.perl.org
dandv at dev.catalyst.perl.org
Thu Jun 11 07:27:56 GMT 2009
Author: dandv
Date: 2009-06-11 07:27:56 +0000 (Thu, 11 Jun 2009)
New Revision: 10501
Modified:
Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/ClassData.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component/ApplicationAttribute.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Chained.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Path.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/FastCGI.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request/Upload.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Response.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Stats.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Utils.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/View.pm
Log:
Cosmetic: removed trailing whitespace
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/ClassData.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/ClassData.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/ClassData.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -13,7 +13,7 @@
my $slot = '$'.$attribute;
my $accessor = sub {
my $pkg = ref $_[0] || $_[0];
- my $meta = Moose::Util::find_meta($pkg)
+ my $meta = Moose::Util::find_meta($pkg)
|| Moose::Meta::Class->initialize( $pkg );
if (@_ > 1) {
$meta->namespace->{$attribute} = \$_[1];
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component/ApplicationAttribute.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component/ApplicationAttribute.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component/ApplicationAttribute.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -31,9 +31,9 @@
use Moose;
extends 'Catalyst::Component';
with 'Catalyst::Component::ApplicationAttribute';
-
+
# Your code here
-
+
1;
=head1 DESCRIPTION
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Chained.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Chained.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Chained.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -238,7 +238,7 @@
# No best action currently
# OR This one matches with fewer parts left than the current best action,
# And therefore is a better match
- # OR No parts and this expects 0
+ # OR No parts and this expects 0
# The current best action might also be Args(0),
# but we couldn't chose between then anyway so we'll take the last seen
@@ -376,7 +376,7 @@
=head2 $c->expand_action($action)
-Return a list of actions that represents a chained action. See
+Return a list of actions that represents a chained action. See
L<Catalyst::Dispatcher> for more info. You probably want to
use the expand_action it provides rather than this directly.
@@ -559,7 +559,7 @@
'-----------------------+------------------------------'
...
-Here's a more detailed specification of the attributes belonging to
+Here's a more detailed specification of the attributes belonging to
C<:Chained>:
=head2 Attributes
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Path.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Path.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Path.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -49,7 +49,7 @@
sub list {
my ( $self, $c ) = @_;
my $column_width = Catalyst::Utils::term_width() - 35 - 9;
- my $paths = Text::SimpleTable->new(
+ my $paths = Text::SimpleTable->new(
[ 35, 'Path' ], [ $column_width, 'Private' ]
);
foreach my $path ( sort keys %{ $self->_paths } ) {
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -44,7 +44,7 @@
=head2 $self->register( $c, $action )
abstract method, to be implemented by dispatchtypes. Takes a
-context object and a L<Catalyst::Action> object.
+context object and a L<Catalyst::Action> object.
Should return true if it registers something, or false otherwise.
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -61,7 +61,7 @@
=head1 METHODS
-=head2 new
+=head2 new
Construct a new dispatcher.
@@ -411,7 +411,7 @@
return $self->_action_hash->{"${namespace}/${name}"};
}
-=head2 $self->get_action_by_path( $path );
+=head2 $self->get_action_by_path( $path );
Returns the named action by its full private path.
@@ -661,7 +661,7 @@
Get the DispatchType object of the relevant type, i.e. passing C<$type> of
C<Chained> would return a L<Catalyst::DispatchType::Chained> object (assuming
-of course it's being used.)
+of course it's being used.)
=cut
@@ -692,12 +692,12 @@
# See also t/lib/TestApp/Plugin/AddDispatchTypes.pm
# Alias _method_name to method_name, add a before modifier to warn..
-foreach my $public_method_name (qw/
- tree
- dispatch_types
- registered_dispatch_types
- method_action_class
- action_hash
+foreach my $public_method_name (qw/
+ tree
+ dispatch_types
+ registered_dispatch_types
+ method_action_class
+ action_hash
container_hash
/) {
my $private_method_name = '_' . $public_method_name;
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -139,21 +139,21 @@
# set the request URI
my $path = $base_path . ( $ENV{PATH_INFO} || '' );
$path =~ s{^/+}{};
-
+
# Using URI directly is way too slow, so we construct the URLs manually
my $uri_class = "URI::$scheme";
-
+
# HTTP_HOST will include the port even if it's 80/443
$host =~ s/:(?:80|443)$//;
-
+
if ( $port !~ /^(?:80|443)$/ && $host !~ /:/ ) {
$host .= ":$port";
}
-
+
# Escape the path
$path =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go;
$path =~ s/\?/%3F/g; # STUPID STUPID SPECIAL CASE
-
+
my $query = $ENV{QUERY_STRING} ? '?' . $ENV{QUERY_STRING} : '';
my $uri = $scheme . '://' . $host . '/' . $path . $query;
@@ -162,7 +162,7 @@
# set the base URI
# base must end in a slash
$base_path .= '/' unless $base_path =~ m{/$};
-
+
my $base_uri = $scheme . '://' . $host . $base_path;
$c->request->base( bless \$base_uri, $uri_class );
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/FastCGI.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/FastCGI.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/FastCGI.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -20,7 +20,7 @@
This class overloads some methods from C<Catalyst::Engine::CGI>.
=head2 $self->run($c, $listen, { option => value, ... })
-
+
Starts the FastCGI server. If C<$listen> is set, then it specifies a
location to listen for FastCGI requests;
@@ -64,7 +64,7 @@
Specify a FCGI::ProcManager sub-class
-=item detach
+=item detach
Detach from console
@@ -161,11 +161,11 @@
$self->prepare_write($c);
$self->_prepared_write(1);
}
-
+
# XXX: We can't use Engine's write() method because syswrite
# appears to return bogus values instead of the number of bytes
# written: http://www.fastcgi.com/om_archive/mail-archive/0128.html
-
+
# Prepend the headers if they have not yet been sent
if ( $self->_has_header_buf ) {
$buffer = $self->_clear_header_buf . $buffer;
@@ -220,7 +220,7 @@
my $self = shift;
my $env = shift;
- # we are gonna add variables from current system environment %ENV to %env
+ # we are gonna add variables from current system environment %ENV to %env
# that contains at this moment just variables taken from FastCGI request
foreach my $k (keys(%ENV)) {
$env->{$k} = $ENV{$k} unless defined($env->{$k});
@@ -259,7 +259,7 @@
=head2 Standalone FastCGI Server
-In server mode the application runs as a standalone server and accepts
+In server mode the application runs as a standalone server and accepts
connections from a web server. The application can be on the same machine as
the web server, on a remote machine, or even on multiple remote machines.
Advantages of this method include running the Catalyst application as a
@@ -270,14 +270,14 @@
module and then use the included fastcgi.pl script.
$ script/myapp_fastcgi.pl -l /tmp/myapp.socket -n 5
-
+
Command line options for fastcgi.pl include:
-d -daemon Daemonize the server.
-p -pidfile Write a pidfile with the pid of the process manager.
-l -listen Listen on a socket path, hostname:port, or :port.
-n -nproc The number of processes started to handle requests.
-
+
See below for the specific web server configurations for using the external
server.
@@ -286,21 +286,21 @@
Apache requires the mod_fastcgi module. The same module supports both
Apache 1 and 2.
-There are three ways to run your application under FastCGI on Apache: server,
+There are three ways to run your application under FastCGI on Apache: server,
static, and dynamic.
=head3 Standalone server mode
FastCgiExternalServer /tmp/myapp.fcgi -socket /tmp/myapp.socket
Alias /myapp/ /tmp/myapp/myapp.fcgi/
-
+
# Or, run at the root
Alias / /tmp/myapp.fcgi/
-
+
# Optionally, rewrite the path when accessed without a trailing slash
RewriteRule ^/myapp$ myapp/ [R]
-
+
The FastCgiExternalServer directive tells Apache that when serving
/tmp/myapp to use the FastCGI application listenting on the socket
/tmp/mapp.socket. Note that /tmp/myapp.fcgi B<MUST NOT> exist --
@@ -308,7 +308,7 @@
C<mod_fcgid>, you can use any name you like, but some require that the
virtual filename end in C<.fcgi>.
-It's likely that Apache is not configured to serve files in /tmp, so the
+It's likely that Apache is not configured to serve files in /tmp, so the
Alias directive maps the url path /myapp/ to the (virtual) file that runs the
FastCGI application. The trailing slashes are important as their use will
correctly set the PATH_INFO environment variable used by Catalyst to
@@ -326,14 +326,14 @@
FastCgiServer /path/to/myapp/script/myapp_fastcgi.pl -processes 3
Alias /myapp/ /path/to/myapp/script/myapp_fastcgi.pl/
-
+
FastCgiServer tells Apache to start three processes of your application at
startup. The Alias command maps a path to the FastCGI application. Again,
the trailing slashes are important.
-
+
=head3 Dynamic mode
-In FastCGI dynamic mode, Apache will run your application on demand,
+In FastCGI dynamic mode, Apache will run your application on demand,
typically by requesting a file with a specific extension (e.g. .fcgi). ISPs
often use this type of setup to provide FastCGI support to many customers.
@@ -365,7 +365,7 @@
Then a request for /script/myapp_fastcgi.pl will run the
application.
-
+
For more information on using FastCGI under Apache, visit
L<http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html>
@@ -399,7 +399,7 @@
=head3 Static mode
server.document-root = "/var/www/MyApp/root"
-
+
fastcgi.server = (
"" => (
"MyApp" => (
@@ -412,12 +412,12 @@
)
)
)
-
+
Note that in newer versions of lighttpd, the min-procs and idle-timeout
values are disabled. The above example would start 5 processes.
=head3 Non-root configuration
-
+
You can also run your application at any non-root location with either of the
above modes. Note the required mod_rewrite rule.
@@ -435,11 +435,11 @@
=head2 Microsoft IIS
-It is possible to run Catalyst under IIS with FastCGI, but only on IIS 6.0
+It is possible to run Catalyst under IIS with FastCGI, but only on IIS 6.0
(Microsoft Windows 2003), IIS 7.0 (Microsoft Windows 2008 and Vista) and
hopefully its successors.
-Even if it is declared that FastCGI is supported on IIS 5.1 (Windows XP) it
+Even if it is declared that FastCGI is supported on IIS 5.1 (Windows XP) it
does not support some features (specifically: wildcard mappings) that prevents
running Catalyst application.
@@ -457,18 +457,18 @@
FastCGI is not a standard part of IIS 6 - you have to install it separately. For
more info and download go to L<http://www.iis.net/extensions/FastCGI>. Choose
-approptiate version (32-bit/64-bit), installation is quite simple
+approptiate version (32-bit/64-bit), installation is quite simple
(in fact no questions, no options).
=item Create a new website
-Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager".
+Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager".
Click "Action" > "New" > "Web Site". After you finish the installation wizard
-you need to go to the new website's properties.
+you need to go to the new website's properties.
=item Set website properties
-On tab "Web site" set proper values for:
+On tab "Web site" set proper values for:
Site Description, IP Address, TCP Port, SSL Port etc.
On tab "Home Directory" set the following:
@@ -477,7 +477,7 @@
Local path permission flags: check only "Read" + "Log visits"
Execute permitions: "Scripts only"
-Click "Configuration" button (still on Home Directory tab) then click "Insert"
+Click "Configuration" button (still on Home Directory tab) then click "Insert"
the wildcard application mapping and in the next dialog set:
Executable: "c:\windows\system32\inetsrv\fcgiext.dll"
@@ -487,7 +487,7 @@
=item Edit fcgiext.ini
-Put the following lines into c:\windows\system32\inetsrv\fcgiext.ini (on 64-bit
+Put the following lines into c:\windows\system32\inetsrv\fcgiext.ini (on 64-bit
system c:\windows\syswow64\inetsrv\fcgiext.ini):
[Types]
@@ -498,19 +498,19 @@
; to list websites: "cscript adsutil.vbs ENUM /P /W3SVC"
; to get site name: "cscript adsutil.vbs GET /W3SVC/<number>/ServerComment"
; to get all details: "cscript adsutil.vbs GET /W3SVC/<number>"
- ; - or look where are the logs located:
- ; c:\WINDOWS\SYSTEM32\Logfiles\W3SVC7\whatever.log
+ ; - or look where are the logs located:
+ ; c:\WINDOWS\SYSTEM32\Logfiles\W3SVC7\whatever.log
; means that the corresponding number is "7"
- ;if you are running just one website using FastCGI you can use '*=CatalystApp'
+ ;if you are running just one website using FastCGI you can use '*=CatalystApp'
[CatalystApp]
ExePath=d:\strawberry\perl\bin\perl.exe
Arguments="d:\WWW\WebApp\script\webapp_fastcgi.pl -e"
- ;by setting this you can instruct IIS to serve Catalyst static files
+ ;by setting this you can instruct IIS to serve Catalyst static files
;directly not via FastCGI (in case of any problems try 1)
IgnoreExistingFiles=0
-
+
;do not be fooled by Microsoft doc talking about "IgnoreExistingDirectories"
;that does not work and use "IgnoreDirectories" instead
IgnoreDirectories=1
@@ -527,22 +527,22 @@
=item Necessary steps during IIS7 installation
During IIS7 installation after you have added role "Web Server (IIS)"
-you need to check to install role feature "CGI" (do not be nervous that it is
-not FastCGI). If you already have IIS7 installed you can add "CGI" role feature
-through "Control panel" > "Programs and Features".
+you need to check to install role feature "CGI" (do not be nervous that it is
+not FastCGI). If you already have IIS7 installed you can add "CGI" role feature
+through "Control panel" > "Programs and Features".
=item Create a new website
-Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager"
+Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager"
> "Add Web Site".
site name: "CatalystSite"
- content directory: "d:\WWW\WebApp\root"
+ content directory: "d:\WWW\WebApp\root"
binding: set proper IP address, port etc.
=item Configure FastCGI
-You can configure FastCGI extension using commandline utility
+You can configure FastCGI extension using commandline utility
"c:\windows\system32\inetsrv\appcmd.exe"
=over 4
@@ -555,7 +555,7 @@
appcmd.exe set config "CatalystSite" -section:system.webServer/handlers /+"[name='CatalystFastCGI',path='*',verb='GET,HEAD,POST',modules='FastCgiModule',scriptProcessor='d:\strawberry\perl\bin\perl.exe|d:\www\WebApp\script\webapp_fastcgi.pl -e',resourceType='Unspecified',requireAccess='Script']" /commit:apphost
-Note: before launching the commands above do not forget to change site
+Note: before launching the commands above do not forget to change site
name and paths to values relevant for your server setup.
=back
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -45,7 +45,7 @@
my @changes;
my @changed_files;
-
+
my $delay = ( defined $self->delay ) ? $self->delay : 1;
sleep $delay if $delay > 0;
@@ -177,7 +177,7 @@
regex => '\.yml$|\.yaml$|\.conf|\.pm$',
delay => 1,
);
-
+
while (1) {
my @changed_files = $watcher->watch();
}
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -27,8 +27,8 @@
if !Catalyst::Engine::HTTP::Restarter::Watcher::DETECT_PACKAGE_COMPILATION;
my $watcher = Catalyst::Engine::HTTP::Restarter::Watcher->new(
- directory => (
- $options->{restart_directory} ||
+ directory => (
+ $options->{restart_directory} ||
File::Spec->catdir( $FindBin::Bin, '..' )
),
follow_symlinks => $options->{follow_symlinks},
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -72,8 +72,8 @@
# Should we keep the connection open?
my $connection = $c->request->header('Connection');
- if ( $self->options->{keepalive}
- && $connection
+ if ( $self->options->{keepalive}
+ && $connection
&& $connection =~ /^keep-alive$/i
) {
$res_headers->header( Connection => 'keep-alive' );
@@ -116,7 +116,7 @@
sub read_chunk {
my $self = shift;
my $c = shift;
-
+
# If we have any remaining data in the input buffer, send it back first
if ( $_[0] = delete $self->{inputbuf} ) {
my $read = length( $_[0] );
@@ -359,11 +359,11 @@
my $sel = IO::Select->new;
$sel->add( \*STDIN );
-
+
REQUEST:
while (1) {
my ( $path, $query_string ) = split /\?/, $uri, 2;
-
+
# Initialize CGI environment
local %ENV = (
PATH_INFO => $path || '',
@@ -390,38 +390,38 @@
$class->handle_request( env => \%ENV );
}
-
+
DEBUG && warn "Request done\n";
-
+
# Allow keepalive requests, this is a hack but we'll support it until
# the next major release.
if ( $self->_is_keepalive ) {
$self->_clear_keepalive;
-
+
DEBUG && warn "Reusing previous connection for keep-alive request\n";
-
- if ( $sel->can_read(1) ) {
+
+ if ( $sel->can_read(1) ) {
if ( !$self->_read_headers ) {
# Error reading, give up
last REQUEST;
}
( $method, $uri, $protocol ) = $self->_parse_request_line;
-
+
DEBUG && warn "Parsed request: $method $uri $protocol\n";
-
+
# Force HTTP/1.0
$protocol = '1.0';
-
+
next REQUEST;
}
-
+
DEBUG && warn "No keep-alive request within 1 second\n";
}
-
+
last REQUEST;
}
-
+
DEBUG && warn "Closing connection\n";
close Remote;
@@ -493,19 +493,19 @@
}
}
$headers->push_header( $key, $val ) if $key;
-
+
DEBUG && warn "Parsed headers: " . dump($headers) . "\n";
# Convert headers into ENV vars
$headers->scan( sub {
my ( $key, $val ) = @_;
-
+
$key = uc $key;
$key = 'COOKIE' if $key eq 'COOKIES';
$key =~ tr/-/_/;
$key = 'HTTP_' . $key
unless $key =~ m/\A(?:CONTENT_(?:LENGTH|TYPE)|COOKIE)\z/;
-
+
if ( exists $ENV{$key} ) {
$ENV{$key} .= ", $val";
}
@@ -519,16 +519,16 @@
my ( $self, $handle ) = @_;
my $remote_sockaddr = getpeername($handle);
- my ( undef, $iaddr ) = $remote_sockaddr
- ? sockaddr_in($remote_sockaddr)
+ my ( undef, $iaddr ) = $remote_sockaddr
+ ? sockaddr_in($remote_sockaddr)
: (undef, undef);
-
+
my $local_sockaddr = getsockname($handle);
my ( undef, $localiaddr ) = sockaddr_in($local_sockaddr);
# This mess is necessary to keep IE from crashing the server
my $data = {
- peeraddr => $iaddr
+ peeraddr => $iaddr
? ( inet_ntoa($iaddr) || '127.0.0.1' )
: '127.0.0.1',
localname => gethostbyaddr( $localiaddr, AF_INET ) || 'localhost',
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -248,7 +248,7 @@
}
/* from http://users.tkk.fi/~tkarvine/linux/doc/pre-wrap/pre-wrap-css3-mozilla-opera-ie.html */
/* Browser specific (not valid) styles to make preformatted text wrap */
- pre {
+ pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
@@ -323,7 +323,7 @@
$request->_body->tmpdir( $c->config->{uploadtmp} )
if exists $c->config->{uploadtmp};
}
-
+
while ( my $buffer = $self->read($c) ) {
$c->prepare_body_chunk($buffer);
}
@@ -356,15 +356,15 @@
=head2 $self->prepare_body_parameters($c)
-Sets up parameters from body.
+Sets up parameters from body.
=cut
sub prepare_body_parameters {
my ( $self, $c ) = @_;
-
+
return unless $c->request->_body;
-
+
$c->request->body_parameters( $c->request->_body->param );
}
@@ -444,7 +444,7 @@
sub prepare_query_parameters {
my ( $self, $c, $query_string ) = @_;
-
+
# Check for keywords (no = signs)
# (yes, index() is faster than a regex :))
if ( index( $query_string, '=' ) < 0 ) {
@@ -456,17 +456,17 @@
# replace semi-colons
$query_string =~ s/;/&/g;
-
+
my @params = grep { length $_ } split /&/, $query_string;
for my $item ( @params ) {
-
- my ($param, $value)
+
+ my ($param, $value)
= map { $self->unescape_uri($_) }
split( /=/, $item, 2 );
-
+
$param = $self->unescape_uri($item) unless defined $param;
-
+
if ( exists $query{$param} ) {
if ( ref $query{$param} ) {
push @{ $query{$param} }, $value;
@@ -494,7 +494,7 @@
# Initialize the read position
$self->read_position(0);
-
+
# Initialize the amount of data we think we need to read
$self->read_length( $c->request->header('Content-Length') || 0 );
}
@@ -628,17 +628,17 @@
$self->prepare_write($c);
$self->_prepared_write(1);
}
-
+
return 0 if !defined $buffer;
-
+
my $len = length($buffer);
my $wrote = syswrite STDOUT, $buffer;
-
+
if ( !defined $wrote && $! == EWOULDBLOCK ) {
# Unable to write on the first try, will retry in the loop below
$wrote = 0;
}
-
+
if ( defined $wrote && $wrote < $len ) {
# We didn't write the whole buffer
while (1) {
@@ -650,11 +650,11 @@
next if $! == EWOULDBLOCK;
return;
}
-
+
last if $wrote >= $len;
}
}
-
+
return $wrote;
}
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request/Upload.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request/Upload.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request/Upload.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -108,7 +108,7 @@
=head2 $upload->link_to
-Creates a hard link to the temporary file. Returns true for success,
+Creates a hard link to the temporary file. Returns true for success,
false for failure.
$upload->link_to('/path/to/target');
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -106,7 +106,7 @@
is => 'rw', clearer => '_clear_body', predicate => '_has_body',
);
# Eugh, ugly. Should just be able to rename accessor methods to 'body'
-# and provide a custom reader..
+# and provide a custom reader..
sub body {
my $self = shift;
$self->_context->prepare_body();
@@ -327,7 +327,7 @@
present.
http://localhost/path?some+keywords
-
+
$c->request->query_keywords will contain 'some keywords'
=head2 $req->match
@@ -342,7 +342,7 @@
=head2 $req->param
-Returns GET and POST parameters with a CGI.pm-compatible param method. This
+Returns GET and POST parameters with a CGI.pm-compatible param method. This
is an alternative method for accessing parameters in $c->req->parameters.
$value = $c->request->param( 'foo' );
@@ -451,7 +451,7 @@
print $c->request->query_parameters->{field};
print $c->request->query_parameters->{field}->[0];
-
+
=head2 $req->read( [$maxlength] )
Reads a chunk of data from the request body. This method is intended to be
@@ -546,7 +546,7 @@
=head2 $req->uploads
Returns a reference to a hash containing uploads. Values can be either a
-L<Catalyst::Request::Upload> object, or an arrayref of
+L<Catalyst::Request::Upload> object, or an arrayref of
L<Catalyst::Request::Upload> objects.
my $upload = $c->request->uploads->{field};
@@ -567,7 +567,7 @@
sub uri_with {
my( $self, $args ) = @_;
-
+
carp( 'No arguments passed to uri_with()' ) unless $args;
foreach my $value ( values %$args ) {
@@ -577,7 +577,7 @@
utf8::encode( $_ ) if utf8::is_utf8($_);
}
};
-
+
my $uri = $self->uri->clone;
my %query = ( %{ $uri->query_form_hash }, %$args );
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Response.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Response.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Response.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -103,7 +103,7 @@
parameters of the same name, except they are used without a leading dash.
Possible parameters are:
-=over
+=over
=item value
@@ -173,7 +173,7 @@
$c->response->status(404);
$res->code is an alias for this, to match HTTP::Response->code.
-
+
=head2 $res->write( $data )
Writes $data to the output stream.
@@ -199,7 +199,7 @@
defined $self->write($,) or return;
defined $self->write($_) or return;
}
-
+
return 1;
}
@@ -209,7 +209,7 @@
=head1 COPYRIGHT
-This library is free software. You can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Stats.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Stats.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Stats.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -121,7 +121,7 @@
$visitor->searchForUID($uid);
$self->accept($visitor);
return $visitor->getResult;
-}
+}
sub addChild {
my $self = shift;
@@ -206,7 +206,7 @@
$c->stats->profile("completed second part of critical bit");
# more code
...
- $c->stats->profile(end => "mysub");
+ $c->stats->profile(end => "mysub");
}
Supposing mysub was called from the action "process" inside a Catalyst
@@ -233,7 +233,7 @@
=head2 new
-Constructor.
+Constructor.
$stats = Catalyst::Stats->new;
@@ -252,7 +252,7 @@
Marks a profiling point. These can appear in pairs, to time the block of code
between the begin/end pairs, or by themselves, in which case the time of
-execution to the previous profiling point will be reported.
+execution to the previous profiling point will be reported.
The argument may be either a single comment string or a list of name-value
pairs. Thus the following are equivalent:
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Utils.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Utils.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Utils.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -21,7 +21,7 @@
=head1 DESCRIPTION
-Catalyst Utilities.
+Catalyst Utilities.
=head1 METHODS
@@ -297,7 +297,7 @@
my ( $lefthash, $righthash ) = @_;
return $lefthash unless defined $righthash;
-
+
my %merged = %$lefthash;
for my $key ( keys %$righthash ) {
my $right_ref = ( ref $righthash->{ $key } || '' ) eq 'HASH';
@@ -311,7 +311,7 @@
$merged{ $key } = $righthash->{ $key };
}
}
-
+
return \%merged;
}
@@ -346,10 +346,10 @@
1) Install Term::Size::Any, or
-2) Export $COLUMNS from your shell.
+2) Export $COLUMNS from your shell.
(Warning to bash users: 'echo $COLUMNS' may be showing you the bash
-variable, not $ENV{COLUMNS}. 'export COLUMNS=$COLUMNS' and you should see
+variable, not $ENV{COLUMNS}. 'export COLUMNS=$COLUMNS' and you should see
that 'env' now lists COLUMNS.)
As last resort, default value of 80 chars will be used.
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/View.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/View.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/View.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -19,15 +19,15 @@
=head1 DESCRIPTION
-This is the Catalyst View base class. It's meant to be used as
+This is the Catalyst View base class. It's meant to be used as
a base class by Catalyst views.
-As a convention, views are expected to read template names from
+As a convention, views are expected to read template names from
$c->stash->{template}, and put the output into $c->res->body.
Some views default to render a template named after the dispatched
action's private name. (See L<Catalyst::Action>.)
-=head1 METHODS
+=head1 METHODS
Implements the same methods as other Catalyst components, see
L<Catalyst::Component>
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2009-06-11 07:10:46 UTC (rev 10500)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2009-06-11 07:27:56 UTC (rev 10501)
@@ -2504,7 +2504,7 @@
$plugins ||= [];
my @plugins = map { s/\A\+// ? $_ : "Catalyst::Plugin::$_" } @$plugins;
-
+
for my $plugin ( reverse @plugins ) {
Class::MOP::load_class($plugin);
my $meta = find_meta($plugin);
@@ -2518,7 +2518,7 @@
grep { $_ && blessed($_) && $_->isa('Moose::Meta::Role') }
map { find_meta($_) }
@plugins;
-
+
Moose::Util::apply_all_roles(
$class => @roles
) if @roles;
More information about the Catalyst-commits
mailing list