Doc, add new upgrading caveat, and start what works on Moose docs for lack of a bette...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Request.pm
index 45b87f1..81bda0f 100644 (file)
@@ -26,7 +26,7 @@ has query_parameters  => (is => 'rw', default => sub { {} });
 has secure => (is => 'rw', default => 0);
 has captures => (is => 'rw', default => sub { [] });
 has uri => (is => 'rw', predicate => 'has_uri');
-has remote_user => (is => 'rw');
+has user => (is => 'rw');
 has headers => (
   is      => 'rw',
   isa     => 'HTTP::Headers',
@@ -76,15 +76,19 @@ has parameters => (
   default => sub { {} },
 );
 
-before parameters => sub {
-  my ($self, $params) = @_;
-  if ( $params && !ref $params ) {
-    $self->_context->log->warn(
-        "Attempt to retrieve '$params' with req->params(), " .
-        "you probably meant to call req->param('$params')" );
-    $params = undef;
-  }
-
+around parameters => sub {
+    my ($orig, $self, $params) = @_;
+    if ($params) {
+        if ( !ref $params ) {
+            $self->_context->log->warn(
+                "Attempt to retrieve '$params' with req->params(), " .
+                "you probably meant to call req->param('$params')"
+            );
+            $params = undef;
+        }
+        return $self->$orig($params);
+    }
+    $self->$orig();
 };
 
 has base => (
@@ -121,20 +125,6 @@ has hostname => (
 
 has _path => ( is => 'rw', predicate => '_has_path', clearer => '_clear_path' );
 
-# XXX: Deprecated in 5.8000 due to confusion between Engines and Plugin::Authentication. Remove in 5.x000?
-has user => (is => 'rw');
-
-before user => sub {
-  my ($self, $user) = @_;
-  # Allow Engines and Plugin::Authentication to set without warning
-  my $caller = (caller(2))[0];
-  if ( $caller !~ /^Catalyst::(Engine|Plugin::Authentication)/ ) {
-    $self->_context->log->warn(
-      'Attempt to use $c->req->user; this is deprecated. ' .
-      'You probably meant to call $c->user or $c->req->remote_user' );
-  }
-};
-
 sub args            { shift->arguments(@_) }
 sub body_params     { shift->body_parameters(@_) }
 sub input           { shift->body(@_) }
@@ -233,7 +223,10 @@ Shortcut for arguments.
 
 =head2 $req->base
 
-Contains the URI base. This will always have a trailing slash.
+Contains the URI base. This will always have a trailing slash. Note that the
+URI scheme (eg., http vs. https) must be determined through heuristics;
+depending on your server configuration, it may be incorrect. See $req->secure
+for more info.
 
 If your application was queried with the URI
 C<http://localhost:3000/some/path> then C<base> is C<http://localhost:3000/>.
@@ -469,7 +462,12 @@ Shortcut for $req->headers->referer. Returns the referring page.
 
 =head2 $req->secure
 
-Returns true or false, indicating whether the connection is secure (https).
+Returns true or false, indicating whether the connection is secure
+(https). Note that the URI scheme (eg., http vs. https) must be determined
+through heuristics, and therefore the reliablity of $req->secure will depend
+on your server configuration. If you are serving secure pages on the standard
+SSL port (443) and/or setting the HTTPS environment variable, $req->secure
+should be valid.
 
 =head2 $req->captures
 
@@ -591,11 +589,6 @@ sub uri_with {
 Returns the currently logged in user. Deprecated. The method recommended for
 newer plugins is $c->user.
 
-=head2 $req->remote_user
-
-Returns the value of the C<REMOTE_USER> environment variable. Previously
-available via $req->user.
-
 =head2 $req->user_agent
 
 Shortcut to $req->headers->user_agent. Returns the user agent (browser)