12. NEW FEATURE
‣ Rich Text Editor
‣ Site Path Restriction
‣ SMTP AUTH
‣ tools/upgrade
‣ Cloud
13. NEW FEATURE
‣ Rich Text Editor
‣ Site Path Restriction
‣ SMTP AUTH
‣ tools/upgrade
‣ Cloud
14.
15. ‣ Mail::Sendmail → Net::SMTP Family
‣ Net::SMTP
‣ Net::SMTP::SSL
‣ Net::SMTP::TLS
‣ SSL/TLS | STARTTLS support
‣ Submission Port support
‣ Debug support
‣ Function interface is same as 5.1x
16. NEW CONFIGURATION DIRECTIVE
SMTPAuth [0 / 1 / ssl / starttls]
SMTPUser login username
SMTPPassword login password
SMTPPort port number
17. NEW FEATURE
‣ Rich Text Editor
‣ Site Path Restriction
‣ SMTP AUTH
‣ tools/upgrade
‣ Cloud
18. NEW FEATURE
‣ Rich Text Editor
‣ Site Path Restriction
‣ SMTP AUTH
‣ tools/upgrade
‣ Cloud
20. Installs or upgrades a database to the current MT schema.
--quiet
Stop progress reports.
--dryrun
Determine the upgrade steps required without executing any changes.
--sql
Report the SQL that would be performed instead of executing it.
--name <name>
The author as whom to perform the upgrade steps.
Required when performing an upgrade (not at initial install).
21. Installs or upgrades a database to the current MT schema.
--quiet
Stop progress reports.
--dryrun
Determine the upgrade steps required without executing any changes.
--sql
Report the SQL that would be performed instead of executing it.
--name <name>
The author as whom to perform the upgrade steps.
Required when performing an upgrade (not at initial install).
At initial install, these parameters are all required. All values must be URI escaped.
--username <name>
--password <pass>
--nickname <name>
--email <name>
--use_system_email [0 or 1]
--preferred_language [ja|de|en-us|es|fr|nl]
--site_name <name>
--site_url <url>
--site_path <path>
--site_theme <theme>
--site_timezone <timezone in numeric>
--rebuild [0|1]
22. NEW FEATURE
‣ Rich Text Editor
‣ Site Path Restriction
‣ SMTP AUTH
‣ tools/upgrade
‣ Cloud
23. NEW FEATURE
‣ Rich Text Editor
‣ Site Path Restriction
‣ SMTP AUTH
‣ tools/upgrade
‣ Cloud
28. “Plack is a set of tools for using the PSGI
stack. It contains middleware components,
a reference server and utilities for Web
application frameworks. Plack is like Ruby's
Rack or Python's Paste for WSGI.”
cite: http://search.cpan.org/~miyagawa/Plack-1.0001/lib/Plack.pm
29. before
Apache
mod_cgi mod_perl mod_fcgi
CGI mod_perl FastCGI
Movable Type
30. after Apache
mod_cgi mod_perl mod_fcgi
Plack
Movable Type
33. ‣ mt.psgi / MT::PSGI
‣ Auto mount applications
‣ Graceful reloading
‣ Support for plugins
34. ‣ mt.psgi / MT::PSGI
‣ Auto mount applications
‣ Graceful reloading
‣ Support for plugins
35. mt.psgi / MT::PSGI
• mt.psgi
#!/usr/bin/perl
# Movable Type (r) Open Source (C) 2001-2012 Six Apart, Ltd.
# This program is distributed under the terms of the
# GNU General Public License, version 2.
#
# $Id$
use strict;
use lib $ENV{MT_HOME} ? "$ENV{MT_HOME}/lib" : 'lib';
use lib $ENV{MT_HOME} ? "$ENV{MT_HOME}/extlib" : 'extlib';
use MT::PSGI;
my $app = MT::PSGI->new()->to_app();
$ starman --workers 2 --port 5000 --pid=/var/run/mt.pid /path/to/mt.psgi
• MT::PSGI
• Like a MT::Bootstrap
• Wrapping Movable Type applications as PSGI application
36. ‣ mt.psgi / MT::PSGI
‣ Auto mount applications
‣ Graceful reloading
‣ Support for plugins
37. ‣ mt.psgi / MT::PSGI
‣ Auto mount applications
‣ Graceful reloading
‣ Support for plugins
38. Auto mount applications
• Read application information from the registry at initializing
• Not only for core applications. Your application in the plugin
will be able to auto-mount
applications:
community:
handler: MT::App::Community
script: $Community::MT::App::Community::script_name
~ addons/Community.pack/config.yaml ~
applications => {
'xmlrpc' => {
handler => 'MT::XMLRPCServer',
script => sub { MT->config->XMLRPCScript },
type => 'xmlrpc',
},
'atom' => {
handler => 'MT::AtomServer',
script => sub { MT->config->AtomScript },
},
~ lib/MT/Core.pm ~
39. ‣ mt.psgi / MT::PSGI
‣ Auto mount applications
‣ Graceful reloading
‣ Support for plugins
40. ‣ mt.psgi / MT::PSGI
‣ Auto mount applications
‣ Graceful reloading
‣ Support for plugins
41. Graceful reloading
• reboot() method in MT::App
=head2 $app->reboot
Reboot all MT instance. Now, this method sends SIGHUP to the process manager
which specified by PIDFilePath config directive. If PIDFilePath isn't set, no
signals would be sent.
~ lib/MT/App.pm : POD ~
my $app = MT->instace;
$app->reboot();
• Currently, reloading automatically at following event
• Install / Upgrade
• Post save mt_config (settings)
• Post save mt_field (custom fields)
• Your plugin should call reboot method if you want to reload
43. ‣ mt.psgi / MT::PSGI
‣ Auto mount applications
‣ Graceful reloading
‣ Support for plugins
44. ‣ mt.psgi / MT::PSGI
‣ Auto mount applications
‣ Graceful reloading
‣ Support for plugins
45. Support for plugin
• If your plugin have an application, should set following attribute
• script: Required, Subroutine reference that returns your script's
endpoint name
• cgi_path: Optional, If you want to mount your application on the
path different from other applications, you can set subroutine
reference that returns path to your application
• type: Optional, Specify the application type. Only 'run_once' and
'xmlrpc' are acceptable value. default, persistent CGI script
• run_once: Run as non-persistent CGI script
• xmlrpc: Special mode for apps which constructed on XMLRPC::Lite. Make PSGI app
with using XMLRPC::Transport::HTTP::Plack
• Your plugin will never change about output (almost)