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