Skip to content

Commit

Permalink
Post-Merge fixes: mod_perl isn't the only persistent environment. Fas…
Browse files Browse the repository at this point in the history
…tCGI should also get the message to restart the webserver after switching plugins on/off
  • Loading branch information
jayallen committed Jul 16, 2010
1 parent 184e227 commit c78c933
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/MT/CMS/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sub list_plugins {
nav_settings => 1,
nav_plugins => 1,
switched => $app->param('switched') || 0,
mod_perl => $ENV{MOD_PERL},
needs_restart => ( $ENV{MOD_PERL} || $ENV{FAST_CGI} ),
screen_id => 'list-plugins',
screen_class => 'plugin-settings',
);
Expand All @@ -33,7 +33,7 @@ sub cfg_plugins {
switched => $app->param('switched') || 0,
reset => $app->param('reset') || 0,
saved => $app->param('saved') || 0,
mod_perl => $ENV{MOD_PERL},
needs_restart => ( $ENV{MOD_PERL} || $ENV{FAST_CGI} ),
plugin => $app->param('plugin'),
screen_id => 'list-plugins',
screen_class => 'plugin-settings',
Expand Down Expand Up @@ -66,7 +66,7 @@ sub cfg_plugin_dialog {
my $cfg = $app->config;
$param{can_config} = _can_config_plugins($app),
$param{use_plugins} = $cfg->UsePlugins;
$param{mod_perl} = 1 if $ENV{MOD_PERL};
$param{needs_restart} = ( $ENV{MOD_PERL} || $ENV{FAST_CGI} );
$param{plugin} = $app->param('plugin');
$param{plugin_name} = $plugin->name;
$param{plugin_sig} = $plugin->{plugin_sig};
Expand Down
4 changes: 2 additions & 2 deletions tmpl/cms/cfg_plugin.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
</mtapp:statusmsg>
</mt:if>
<mt:if name="switched">
<mt:if name="mod_perl">
<mt:if name="needs_restart">
<mtapp:statusmsg
id="switched"
class="success">
<__trans phrase="Your plugins have been reconfigured. Since you're running mod_perl, you will need to restart your web server for these changes to take effect.">
<__trans phrase="Your plugins have been reconfigured. Since you're running in a persistent application environment, you will need to restart your web server for these changes to take effect.">
</mtapp:statusmsg>
<mt:else>
<mtapp:statusmsg
Expand Down
8 changes: 4 additions & 4 deletions tmpl/cms/list_plugin.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
</mtapp:statusmsg>
</mt:if>
<mt:if name="switched">
<mt:if name="mod_perl">
<mt:if name="needs_restart">
<mtapp:statusmsg
id="switched"
class="success">
<__trans phrase="Your plugins have been reconfigured. Since you're running mod_perl, you will need to restart your web server for these changes to take effect.">
<__trans phrase="Your plugins have been reconfigured. Since you're running in a persistent application environment, you will need to restart your web server for these changes to take effect.">
</mtapp:statusmsg>
<mt:else>
<mtapp:statusmsg
Expand All @@ -54,11 +54,11 @@
</mtapp:statusmsg>
</mt:if>
<mt:if name="switched">
<mt:if name="mod_perl">
<mt:if name="needs_restart">
<mtapp:statusmsg
id="switched"
class="success">
<__trans phrase="Your plugins have been reconfigured. Since you're running mod_perl, you will need to restart your web server for these changes to take effect.">
<__trans phrase="Your plugins have been reconfigured. Since you're running in a persistent application environment, you will need to restart your web server for these changes to take effect.">
</mtapp:statusmsg>
<mt:else>
<mtapp:statusmsg
Expand Down

4 comments on commit c78c933

@reedacartwright
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good change, but needs a bit more to support dispatchers.

  1. Support for the fact that some fastcgi implementations will auto restart.

  2. Support for the fact that some fastcgi implementations are restarted independent of the webserver.

needs_restart => ( !$ENV{NO_RESTART} && ( $ENV{MOD_PERL} || $ENV{FAST_CGI} )),

This way the restart message can be overridden.

The phrase itself needs to say something like "you will need to restart your web server or persistent application environment ..."

@jayallen
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good points all around, Reed. Should I expect a pull request from you or were you asking me to make these changes?

@reedacartwright
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea how to use git, so it would be nice if you could make the changes.

@jayallen
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'd be happy to. Just in case you weren't aware, though, you can fork the code and edit it completely through the GitHub website without ever using Git (see http://skitch.com/jayallen/dc6bq/editing-through-github-s-website). Or you could use Subversion (see http://svn.github.com/openmelody/melody). Or, you could just provide us with a patch. Lots of ways to participate if you don't want to git with Git.

Please sign in to comment.