1 package Catalyst::Controller::MovableType;
3 BEGIN { extends 'Catalyst::Controller::WrapCGI'; }
5 use namespace::autoclean;
7 has 'perl' => (is => 'rw', default => 'perl');
9 has 'mt_home' => (is => 'rw'); # /my/app/root/mt/
11 sub run_mt_script :Path {
12 my ($self, $c, $cgi_script) = @_;
28 ) # mt-config.cgi intentionally left out
31 # http://www.movabletype.org/documentation/installation/install-movable-type.html#start-blogging states:
32 # Warning: because the mt-check.cgi script displays server details which could be useful to a hacker, it
33 # is recommended that this script be removed or renamed.
35 # Allow it only in debug mode.
36 $mt_scripts{'mt_check.cgi'} = 1 if ($c->debug());
38 $self->not_found() unless ($mt_scripts{$cgi_script});
40 $ENV{MT_HOME} = $self->mt_home;
42 $self->cgi_to_response($c, sub {
43 system($self->perl, $self->mt_home.$cgi_script);
47 sub not_found :Private {
49 $c->response->status(404);
50 $c->response->body('Not found!');
60 Catalyst::Controller::MovableType - Run Movable Type through Catalyst
64 package MyApp::Controller::Mt;
67 BEGIN {extends 'Catalyst::Controller::MT'; }
74 Install Movable Type by extracting the zip into your template root directory.
75 Move mt-static to root/static/mt, and configure Movable Type accordingly.
79 Runs Movable Type 5 through Catalyst.
80 Download Movable Type 5 from http://www.movabletype.org/
86 Runs the requested Movable Type .cgi script transparently with cgi_to_response.
90 Sets the response to a simple 404 Not found page. You can override this method
99 L<Catalyst::Controller::WrapCGI>
103 Oskari 'Okko' Ojala <perl@okko.net>
107 Matt S. Trout <mst@shadowcatsystems.co.uk>
109 =head1 COPYRIGHT & LICENSE
111 Copyright 2010 the above author(s).
113 This sofware is free software, and is licensed under the same terms as Perl itself.