0.003
2010-04-xx
- Fixed not_found call when an unexisting script is requested.
+ Fixed internal not_found call to properly pass $c when an unexisting
+ script was requested.
+
+ Implemented chaining so that Catalyst::Controller::WrapCGI::wrap_cgi
+ can properly populate $ENV{SCRIPT_NAME} with
+ $c->uri_for($c->action, $c->req->captures)->path
0.002
2010-04-13
has 'mt_home' => (is => 'rw'); # /my/app/root/mt/
-sub run_mt_script :Path {
- my ($self, $c, $cgi_script) = @_;
+# Use chaining here, so that Catalyst::Controller::WrapCGI::wrap_cgi can properly
+# populate $ENV{SCRIPT_NAME} with $c->uri_for($c->action, $c->req->captures)->path,
+# so that MovableType can then extract the correct path of location.
+sub capture_mt_script :Chained('/') :PathPart('mt') :CaptureArgs(1) { }
+
+sub run_mt_script :Chained('capture_mt_script') :PathPart('') :Args {
+ my ($self, $c) = @_;
+ my $captures = $c->req->captures;
+ my $cgi_script = $captures->[0];
my %mt_scripts
= map +($_ => 1),
Catalyst::Controller::MovableType - Run Movable Type through Catalyst
+=head1 DESCRIPTION
+
+Runs Movable Type 5 through Catalyst.
+Download Movable Type 5 from http://www.movabletype.org/
+
+=head1 SYNOPSIS
+
+ package MyApp::Controller::Mt;
+
+ use Moose;
+ BEGIN {extends 'Catalyst::Controller::MovableType'; }
+ use utf8;
+
+ 1;
+
=head1 INSTALLATION
Install Movable Type by extracting the zip into your template root directory.
config add:
<Controller::Root>
- cgi_root_path mt/
- cgi_dir mt/
+ cgi_root_path mt/
+ cgi_dir mt/
</Controller::Root>
<Controller::Mt>
- mt_home = /full/path/to/MyApp/root/mt/
+ mt_home = /full/path/to/MyApp/root/mt/
+ <actions>
+ <capture_script_name>
+ PathPart = mt
+ </capture_script_name>
+ </actions>
</Controller::Mt>
The cgi_* directives are always given for the Root controller, no matter what
-the Root controller is or even if it doesn't even exist.
+the Root controller is.
+
+You can modify the path where the script matches by configuring the PathPart as
+shown above. This controller defaults to match on the path "/mt".
Finally, make sure that the Static::Simple doesn't affect the Movable Type's
installation directory. An example:
}
);
+=head1 METHODS
-=head1 SYNOPSIS
-
- package MyApp::Controller::Mt;
-
- use Moose;
- BEGIN {extends 'Catalyst::Controller::MovableType'; }
- use utf8;
-
- 1;
-
-=head1
-
-=head1 DESCRIPTION
-
-Runs Movable Type 5 through Catalyst.
-Download Movable Type 5 from http://www.movabletype.org/
+=head2 capture_mt_script
-=head1 METHODS
+Captures the path of the Movable Type.
=head2 run_mt_script