Skip to content

Instantly share code, notes, and snippets.

@usualoma
Created July 30, 2013 09:30
Show Gist options
  • Save usualoma/6111572 to your computer and use it in GitHub Desktop.
Save usualoma/6111572 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use lib $ENV{MT_HOME} ? "$ENV{MT_HOME}/lib" : 'lib';
use lib $ENV{MT_HOME} ? "$ENV{MT_HOME}/extlib" : 'extlib';
use lib $ENV{MT_HOME} ? "$ENV{MT_HOME}/t/lib" : 't/lib';
BEGIN {
$ENV{MT_CONFIG} ||= 'mysql-test.cfg';
}
use Plack::Loader;
use Getopt::Long;
use MT;
eval(
$ENV{SKIP_REINITIALIZE_DATABASE}
? "use MT::Test;"
: "use MT::Test qw(:db :data);"
);
use MT::PSGI;
my $port = 5000;
my @plugin_paths = ();
GetOptions(
'port=i' => \$port,
'plugin-path=s' => \@plugin_paths,
) or exit(1);
my $mt = MT->new;
$mt->_init_plugins_core( {}, 1, \@plugin_paths ) if @plugin_paths;
my $app = MT::PSGI->new()->to_app();
my $loader = Plack::Loader->load(
'Starman',
port => $port,
max_workers => 1
);
$loader->run($app);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment