Add "-C" option to "pgpool" command.
authorNozomi Anzai <anzai@sraoss.co.jp>
Tue, 29 May 2012 06:19:18 +0000 (15:19 +0900)
committerNozomi Anzai <anzai@sraoss.co.jp>
Tue, 29 May 2012 06:19:18 +0000 (15:19 +0900)
Some refactoring.

12 files changed:
conf/pgmgt.conf.php
config.php
install/checkParameter.php
install/defaultParameter.php
install/lang/en.lang.php
install/lang/ja.lang.php
lang/en.lang.php
lang/ja.lang.php
login.php
status.php
templates/status.tpl
version.php

index 86160de8339913bf70c6adf4496fe89a830fd22d..83813601044ac2be6b3a8fbdf99facb74061a5a6 100644 (file)
@@ -8,9 +8,9 @@ define('_PGPOOL2_CMD_OPTION_LARGE_D', '0');
 define('_PGPOOL2_CMD_OPTION_D', '0');
 define('_PGPOOL2_CMD_OPTION_M', 's');
 define('_PGPOOL2_CMD_OPTION_N', '0');
+define('_PGPOOL2_CMD_OPTION_LARGE_C', '0');
 define('_PGPOOL2_LOG_FILE', '/tmp/pgpool.log');
 define('_PGPOOL2_PCP_DIR', '/usr/local/bin');
 define('_PGPOOL2_PCP_HOSTNAME', 'localhost');
-define('_PGPOOL2_PCP_TIMEOUT', '10');
 define('_PGPOOL2_STATUS_REFRESH_TIME', '0');
 ?>
index 7bfb8f1cd75c1ed6b646d887138e6080dd6240be..94a8e5905e4b7afd8df73da41038d1a11c2d8741 100644 (file)
@@ -19,7 +19,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando <ando@ecomas.co.jp>
- * @copyright  2003-2011 PgPool Global Development Group
+ * @copyright  2003-2012 PgPool Global Development Group
  * @version    CVS: $Id$
  */
 
@@ -73,6 +73,8 @@ $params['m']                  = (defined('_PGPOOL2_CMD_OPTION_M')) ?
                                 _PGPOOL2_CMD_OPTION_M : $message['errNoDefined'];
 $params['n']                  = (defined('_PGPOOL2_CMD_OPTION_N')) ?
                                 _PGPOOL2_CMD_OPTION_N : $message['errNoDefined'];
+$params['C']                  = (defined('_PGPOOL2_CMD_OPTION_LARGE_C')) ?
+                                _PGPOOL2_CMD_OPTION_LARGE_C  : $message['errNoDefined'];
 $params['pgpool_logfile']     = (defined('_PGPOOL2_LOG_FILE')) ?
                                 _PGPOOL2_LOG_FILE : $message['errNoDefined'];
 $params['pcp_client_dir']     = (defined('_PGPOOL2_PCP_DIR')) ?
@@ -229,44 +231,22 @@ function writePgmtConf($pgmgtConfigFile)
     $str = "<?php\n";
     fputs($fp, $str);
 
-    $str = 'define(\'_PGPOOL2_LANG\', \'' . $params['lang'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_CONFIG_FILE\', \'' .  $params['pgpool_config_file'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_PASSWORD_FILE\', \'' .  $params['password_file'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_COMMAND\', \'' .  $params['pgpool_command'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_CMD_OPTION_C\', \'' .  $params['c'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_CMD_OPTION_LARGE_D\', \'' .  $params['D'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_CMD_OPTION_D\', \'' .  $params['d'] . '\');' . "\n";
-    fputs($fp, $str);
+    write($fp, '_PGPOOL2_LANG',               $params['lang']);
+    write($fp, '_PGPOOL2_CONFIG_FILE',        $params['pgpool_config_file']);
+    write($fp, '_PGPOOL2_PASSWORD_FILE',      $params['password_file']);
+    write($fp, '_PGPOOL2_COMMAND',            $params['pgpool_command']);
 
-    $str = 'define(\'_PGPOOL2_CMD_OPTION_M\', \'' .  $params['m'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_CMD_OPTION_N\', \'' .  $params['n'] . '\');' . "\n";
-    fputs($fp, $str);
+    write($fp, '_PGPOOL2_CMD_OPTION_C',       $params['c']);
+    write($fp, '_PGPOOL2_CMD_OPTION_LARGE_D', $params['D']);
+    write($fp, '_PGPOOL2_CMD_OPTION_D',       $params['n']);
+    write($fp, '_PGPOOL2_CMD_OPTION_M',       $params['m']);
+    write($fp, '_PGPOOL2_CMD_OPTION_N',       $params['n']);
+    write($fp, '_PGPOOL2_CMD_OPTION_LARGE_C', $params['C']);
 
-    $str = 'define(\'_PGPOOL2_LOG_FILE\', \'' .  $params['pgpool_logfile'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_PCP_DIR\', \'' .  $params['pcp_client_dir'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_PCP_HOSTNAME\', \'' .  $params['pcp_hostname'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_STATUS_REFRESH_TIME\', \'' .  $params['pcp_refresh_time'] . '\');' . "\n";
-    fputs($fp, $str);
+    write($fp, '_PGPOOL2_LOG_FILE',            $params['pgpool_logfile']);
+    write($fp, '_PGPOOL2_PCP_DIR',             $params['pcp_client_dir']);
+    write($fp, '_PGPOOL2_PCP_HOSTNAME',        $params['pcp_hostname']);
+    write($fp, '_PGPOOL2_STATUS_REFRESH_TIME', $params['pcp_refresh_time']);
 
     $str = "?>\n";
     fputs($fp, $str);
@@ -274,4 +254,9 @@ function writePgmtConf($pgmgtConfigFile)
     fclose($fp);
     return TRUE;
 }
+
+function write($fp, $defname, $val)
+{
+    fputs($fp, "define('{$defname}', '{$val}');\n");
+}
 ?>
index 59bb64f977d9beeb55aa3e0e840ca81b6fc48ac2..9f907e9d88070e48a2280b164940b769e9861851 100644 (file)
@@ -19,7 +19,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando <ando@ecomas.co.jp>
- * @copyright  2003-2011 PgPool Global Development Group
+ * @copyright  2003-2012 PgPool Global Development Group
  * @version    CVS: $Id$
  */
 
@@ -107,6 +107,7 @@ $msgCmdLargeD = '';
 $msgCmdD = '';
 $msgCmdN = '';
 $msgCmdM = '';
+$msgCmdLargeC = '';
 
 $msgPgpoolLogFile = '';
 if (isset($_POST['pgpool_logfile']) && $_POST['pgpool_logfile']) {
@@ -123,6 +124,7 @@ if ($pgpool_logfile != '' && strpos($pgpool_logfile, '|') !== FALSE) {
         $error = TRUE;
     }
 
+// check log file directory
 } elseif (!is_dir(dirname($pgpool_logfile))) {
     $msgPgpoolLogFile = 'Directory not found';
     $error = TRUE;
@@ -132,6 +134,7 @@ if ($pgpool_logfile != '' && strpos($pgpool_logfile, '|') !== FALSE) {
     $error = TRUE;
 }
 
+// check pcp parameters
 if (isset($_POST['pcp_client_dir']) && $_POST['pcp_client_dir']) {
     $pcp_client_dir = $_POST['pcp_client_dir'];
 } else {
@@ -141,7 +144,8 @@ if (isset($_POST['pcp_client_dir']) && $_POST['pcp_client_dir']) {
 $msgPcpClientDir = '';
 if (!is_dir($pcp_client_dir)) {
     $msgPcpClientDir = 'Directory not found';
-        $error = TRUE;
+    $error = TRUE;
+
 } else {
     $command = array('pcp_attach_node',
                      'pcp_detach_node',
@@ -170,18 +174,18 @@ if (isset($_POST['pcp_hostname']) && $_POST['pcp_hostname']) {
     $pcp_hostname =  _PGPOOL2_PCP_HOSTNAME;
 }
 
+$msgPcpTimeout = '';
 if (isset($_POST['pcp_timeout']) && $_POST['pcp_timeout']) {
     $pcp_timeout= $_POST['pcp_timeout'];
 } else {
     $pcp_timeout =  _PGPOOL2_PCP_TIMEOUT;
-    $msgPcpTimeout = '';
 }
 
+$msgPcpRefreshTime = '';
 if (isset($_POST['pcp_refreshTime']) && $_POST['pcp_refreshTime']) {
     $pcp_refreshTime = $_POST['pcp_refreshTime'];
 } else {
     $pcp_refreshTime =  _PGPOOL2_STATUS_REFRESH_TIME;
-    $msgPcpRefreshTime = '';
 }
 
 /* --------------------------------------------------------------------- */
@@ -202,76 +206,27 @@ if ($error || (isset($_POST['submitBack']) && $_POST['submitBack'] != NULL)) {
 }
 
 if (!$error && $action == 'next') {
-
     $fp = fopen( "../conf/pgmgt.conf.php", "w");
 
     fputs($fp, "<?php"."\n");
 
-    $str = 'define(\'_PGPOOL2_LANG\', \'' . $_SESSION['lang'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_CONFIG_FILE\', \'' . $_POST['pgpool2_config_file'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_PASSWORD_FILE\', \'' . $_POST['password_file'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_COMMAND\', \'' . $_POST['pgpool_command'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    if (isset($_POST['c'])) {
-        $c = 1;
-    } else {
-        $c = 0;
-    }
-
-    if (isset($_POST['D'])) {
-        $D = 1;
-    } else {
-        $D = 0;
-    }
-
-    if (isset($_POST['d'])) {
-        $d = 1;
-    } else {
-        $d = 0;
-    }
-
-    if (isset($_POST['n'])) {
-        $n = 1;
-    } else {
-        $n = 0;
-    }
-
-    $str = 'define(\'_PGPOOL2_CMD_OPTION_C\', \'' . $c . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_CMD_OPTION_LARGE_D\', \'' . $D . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_CMD_OPTION_D\', \'' . $d . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_CMD_OPTION_M\', \'' . $_POST['m'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_CMD_OPTION_N\', \'' . $n . '\');' . "\n";
-    fputs($fp, $str);
+    write($fp, '_PGPOOL2_LANG',               $_SESSION['lang']);
+    write($fp, '_PGPOOL2_CONFIG_FILE',        $_POST['pgpool2_config_file']);
+    write($fp, '_PGPOOL2_PASSWORD_FILE',      $_POST['password_file']);
+    write($fp, '_PGPOOL2_COMMAND',            $_POST['pgpool_command']);
 
-    $str = 'define(\'_PGPOOL2_LOG_FILE\', \'' . $_POST['pgpool_logfile'] . '\');' . "\n";
-    fputs($fp, $str);
+    write($fp, '_PGPOOL2_CMD_OPTION_C',       (int)isset($_POST['c']));
+    write($fp, '_PGPOOL2_CMD_OPTION_LARGE_D', (int)isset($_POST['D']));
+    write($fp, '_PGPOOL2_CMD_OPTION_D',       (int)isset($_POST['d']));
+    write($fp, '_PGPOOL2_CMD_OPTION_M',       $_POST['m']);
+    write($fp, '_PGPOOL2_CMD_OPTION_N',       (int)isset($_POST['n']));
+    write($fp, '_PGPOOL2_CMD_OPTION_LARGE_C', (int)isset($_POST['C']));
 
-    $str = 'define(\'_PGPOOL2_PCP_DIR\', \'' . $_POST['pcp_client_dir'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_PCP_HOSTNAME\', \'' . $_POST['pcp_hostname'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_PCP_TIMEOUT\', \'' . $_POST['pcp_timeout'] . '\');' . "\n";
-    fputs($fp, $str);
-
-    $str = 'define(\'_PGPOOL2_STATUS_REFRESH_TIME\', \'' . $_POST['pcp_refreshTime'] . '\');' . "\n";
-    fputs($fp, $str);
+    write($fp, '_PGPOOL2_LOG_FILE',            $_POST['pgpool_logfile']);
+    write($fp, '_PGPOOL2_PCP_DIR',             $_POST['pcp_client_dir']);
+    write($fp, '_PGPOOL2_PCP_HOSTNAME',        $_POST['pcp_hostname']);
+    write($fp, '_PGPOOL2_PCP_TIMEOUT',         $_POST['pcp_timeout']);
+    write($fp, '_PGPOOL2_STATUS_REFRESH_TIME', $_POST['pcp_refreshTime']);
 
     fputs($fp, "?>"."\n");
 
@@ -298,6 +253,7 @@ if (!$error && $action == 'next') {
     </div>
       <div id="content">
   <h2>Welcome to pgpool-II Administration Tool</h2>
+
   <h3><?php echo $message['strParameterCheck']; ?></h3>
   <form action="checkParameter.php" method="post" name="CheckPath" id="CheckPath">
     <?php
@@ -307,195 +263,113 @@ if (!$error && $action == 'next') {
         echo '<input type="hidden" name="action" value="next">';
     }
     ?>
+
 <table>
   <tbody>
   <tr>
     <th><label><?php echo $message['strPgConfFile'] ?></label></th>
     <td><input name="pgpool2_config_file" type="text" value="<?php echo $pgpool2_config_file?>" size="50" />
-    <?php
-    if ($msgPgpoolConfigFile != '') {
-        echo '<br />' . $msgPgpoolConfigFile;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <?php showResult($msgPgpoolConfigFile); ?>
     </td>
   </tr>
   <tr>
     <th><label><?php echo $message['strPasswordFile'] ?></label></th>
-      <td><input name="password_file" type="text" value="<?php echo $password_file ?>" size="50" />
-    <?php
-    if ($msgPasswordFile != '') {
-        echo '<br />' . $msgPasswordFile;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <td><input name="password_file" type="text" value="<?php echo $password_file ?>" size="50" />
+    <?php showResult($msgPasswordFile); ?>
     </td>
   </tr>
   <tr>
     <th><label><?php echo $message['strPgpoolCommand'] ?></label></th>
-                  <td><input name="pgpool_command" type="text" value="<?php echo $pgpool_command ?>" size="50" />
-    <?php
-    if ($msgPgpoolCommand != '') {
-        echo '<br />' . $msgPgpoolCommand;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <td><input name="pgpool_command" type="text" value="<?php echo $pgpool_command ?>" size="50" />
+    <?php showResult($msgPgpoolCommand); ?>
     </td>
   </tr>
+
   <tr>
     <th colspan="3"><h3><?php echo $message['strPgpoolCommandOption'] ?></h3></th>
   </tr>
+
   <tr>
     <th><label><?php echo $message['strCmdC'] ?></label></th>
-      <td><input type="checkbox" name="c" /></td>
-    <?php
-    if ($msgCmdC != '') {
-        echo '<br />' . $msgCmdC;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <td><input type="checkbox" name="c" />
+    <?php showResult($msgCmdC); ?>
     </td>
   </tr>
   <tr>
     <th><label><?php echo $message['strCmdLargeD'] ?></label></th>
-      <td><input type="checkbox" name="D" /></td>
-    <?php
-    if ($msgCmdLargeD != '') {
-        echo '<br />' . $msgCmdLargeD;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <td><input type="checkbox" name="D" />
+    <?php showResult($msgCmdLargeD); ?>
     </td>
   </tr>
   <tr>
     <th><label><?php echo $message['strCmdN'] ?></label></th>
-      <td><input type="checkbox" name="n" /></td>
-    <?php
-    if ($msgCmdN != '') {
-        echo '<br />' . $msgCmdN;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <td><input type="checkbox" name="n" />
+    <?php showResult($msgCmdN); ?>
+    </td>
+  </tr>
+  <tr>
+    <th><label><?php echo $message['strCmdLargeC'] ?></label></th>
+    <td><input type="checkbox" name="D" />
+    <?php showResult($msgCmdLargeC); ?>
     </td>
   </tr>
   <tr>
     <th><label><?php echo $message['strCmdD'] ?></label></th>
-      <td><input type="checkbox" name="d" /></td>
-    <?php
-    if ($msgCmdD != '') {
-        echo '<br />' . $msgCmdD;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <td><input type="checkbox" name="d" />
+    <?php showResult($msgCmdD); ?>
     </td>
   </tr>
   <tr>
     <th><label><?php echo $message['strCmdM'] ?></label></th>
-      <td><select  name="m" />
-           <option value="s" selected="selected">smart</optgroup>
-           <option value="f">fast</optgroup>
-           <option value="i">immediate</optgroup>
-           </select>
-     </td>
-    <?php
-    if ($msgCmdM != '') {
-        echo '<br />' . $msgCmdM;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <td><select  name="m" />
+          <option value="s" selected="selected">smart</optgroup>
+          <option value="f">fast</optgroup>
+          <option value="i">immediate</optgroup>
+        </select>
+    <?php showResult($msgCmdM); ?>
     </td>
   </tr>
   <tr>
     <th><label><?php echo $message['strPgpoolLogFile'] ?></label></th>
-                  <td><input name="pgpool_logfile" type="text" value="<?php echo $pgpool_logfile ?>" size="50" />
-    <?php
-    if ($msgPgpoolLogFile != '') {
-        echo '<br />' . $msgPgpoolLogFile;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <td><input name="pgpool_logfile" type="text" value="<?php echo $pgpool_logfile ?>" size="50" />
+    <?php showResult($msgPgpoolLogFile); ?>
     </td>
   </tr>
 
   <tr>
     <th><label><?php echo $message['strPcpDir'] ?></label></th>
-                  <td><input name="pcp_client_dir" type="text" value="<?php echo $pcp_client_dir ?>" size="50" />
-    <?php
-    if ($msgPcpClientDir != '') {
-        echo '<br />' . $msgPcpClientDir;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <td><input name="pcp_client_dir" type="text" value="<?php echo $pcp_client_dir ?>" size="50" />
+    <?php showResult($msgPcpClientDir); ?>
     </td>
   </tr>
   <tr>
     <th><label><?php echo $message['strPcpHostName'] ?></label></th>
-                  <td><input name="pcp_hostname" type="text" value="<?php echo $pcp_hostname ?>" size="50" />
-    <?php
-    if ($msgPcpHostname != '') {
-        echo '<br />' . $msgPcpHostname;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <td><input name="pcp_hostname" type="text" value="<?php echo $pcp_hostname ?>" size="50" />
+    <?php showResult($msgPcpHostname); ?>
     </td>
   </tr>
   <tr>
     <th><label><?php echo $message['strPcpTimeout'] ?></label></th>
-                  <td><input name="pcp_timeout" type="text" value="<?php echo $pcp_timeout?>" size="50" />
-    <?php
-    if ($msgPcpHostname != '') {
-        echo '<br />' . $msgPcpHostname;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <td><input name="pcp_timeout" type="text" value="<?php echo $pcp_timeout?>" size="50" />
+    <?php showResult($msgPcpTimeout); ?>
     </td>
   </tr>
   <tr>
     <th><label><?php echo $message['strPcpRefreshTime'] ?></label></th>
-                  <td><input name="pcp_refreshTime" type="text" value="<?php echo $pcp_refreshTime ?>" size="50" />
-    <?php
-    if ($msgPcpRefreshTime != '') {
-        echo '<br />' . $msgPcpRefreshTime;
-        echo '</td><td><img src="images/ng.gif" alt="ng" />';
-    } else {
-        echo '</td><td><img src="images/ok.gif" alt="ok" />';
-    }
-    ?>
+    <td><input name="pcp_refreshTime" type="text" value="<?php echo $pcp_refreshTime ?>" size="50" />
+    <?php showResult($msgPcpRefreshTime); ?>
     </td>
   </tr>
   </tbody>
 </table>
+
 <p>
 <?php
 if ($error) {
-echo '<input type="submit" value="' . $message['strCheck'] . '" />';
+    echo '<input type="submit" value="' . $message['strCheck'] . '" />';
 }
 else {
-echo '<input type="submit" value="' . $message['strNext'] . '" />';
+    echo '<input type="submit" value="' . $message['strNext'] . '" />';
 }
 ?>
 </p>
@@ -507,3 +381,24 @@ echo '<input type="submit" value="' . $message['strNext'] . '" />';
     </div>
   </body>
 </html>
+
+<?php
+
+/* --------------------------------------------------------------------- */
+/* Function                                                              */
+/* --------------------------------------------------------------------- */
+
+function write($fp, $defname, $val)
+{
+    fputs($fp, "define('{$defname}', '{$val}');\n");
+}
+
+function showResult($msg)
+{
+    if ($msg != '') {
+        echo '<br />' . $msg;
+        echo '</td><td><img src="images/ng.gif" alt="ng" />';
+    } else {
+        echo '</td><td><img src="images/ok.gif" alt="ok" />';
+    }
+}
index 6bf0bf97ae926cf3431e2582dffd0d7a7f6b3737..1be6c121d12e925aaffe77e37aa858840a3f03e0 100644 (file)
@@ -19,7 +19,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando <ando@ecomas.co.jp>
- * @copyright  2003-2011:PgPool Global Development Group
+ * @copyright  2003-2012:PgPool Global Development Group
  * @version    CVS: $Id$
  */
 
@@ -31,6 +31,7 @@ define("_PGPOOL2_CMD_OPTION_LARGE_D", "0");
 define("_PGPOOL2_CMD_OPTION_D", "0");
 define("_PGPOOL2_CMD_OPTION_M", "s");
 define("_PGPOOL2_CMD_OPTION_N", "0");
+define("_PGPOOL2_CMD_OPTION_LARGE_C", "0");
 define("_PGPOOL2_LOG_FILE", "/tmp/pgpool.log");
 define("_PGPOOL2_PCP_DIR", "/usr/local/bin");
 define("_PGPOOL2_PCP_HOSTNAME", "localhost");
index bb6f7c12fb513d1c030130aa1b28c043fc84d8e7..91fe97003365c80d6fc3380dc283055ab19e88dc 100644 (file)
@@ -19,7 +19,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando <ando@ecomas.co.jp>
- * @copyright  2003-2008               PgPool Global Development Group
+ * @copyright  2003-2012               PgPool Global Development Group
  * @version    CVS: $Id$
  */
 
@@ -42,6 +42,7 @@ $message = array(
     'strCmdM' => 'stop mode',
     'strCmdLargeD' => 'Discard pgpool_status file',
     'strCmdN' => 'don\'t run in daemon mode',
+    'strCmdLargeC' => 'Discard oid maps for om memory query cache',
     'strCmdPgpoolFile' => 'pgpool.conf',
     'strCmdPcpFile' => 'pcp.conf',
     'strCmdDesc' => 'If it is a blank, this option is ignored.',
index ec57016f112c70da396456697346351c9b47f942..700380fce195cd556f63afb149b505972adb766f 100644 (file)
@@ -19,7 +19,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando <ando@ecomas.co.jp>
- * @copyright  2003-2008               PgPool Global Development Group
+ * @copyright  2003-2012               PgPool Global Development Group
  * @version    CVS: $Id$
  */
 
@@ -42,6 +42,7 @@ $message = array(
     'strCmdM' => '停止モード',
     'strCmdLargeD' => 'pgpool_status を無視',
     'strCmdN' => '非デーモンモード',
+    'strCmdLargeC' => 'オンメモリキャッシュの oid map をリセット',
     'strCmdPgpoolFile' => 'pgpool.conf',
     'strCmdPcpFile' => 'pcp.conf',
     'strCmdDesc' => '空白の場合には無視',
index cde2290c26736d23e90d049ad19a18aa6b9500dd..95cffe07c63df4c06a4444368ceeaea0d9e150ff 100644 (file)
@@ -19,7 +19,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando <ando@ecomas.co.jp>
- * @copyright  2003-2009 PgPool Global Development Group
+ * @copyright  2003-2012 PgPool Global Development Group
  * @version    CVS: $Id$
  */
 
@@ -177,6 +177,7 @@ $message = array(
     'strCmdC' => 'Clears query cache',
     'strCmdD' => 'Debug mode',
     'strCmdDesc' => 'If it is a blank, this option is ignored.',
+    'strCmdLargeC' => 'Discard oid maps for on memory query cache',
     'strCmdLargeD' => 'Discard pgpool_status file',
     'strCmdM' => 'Stop mode',
     'strCmdN' => 'Don\'t run in daemon mode',
index 692cd036741fb43165dad6de1cabee9654602c55..ad7feae0e2541fee83a6448dd86963e56dfa89aa 100644 (file)
@@ -19,7 +19,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando <ando@ecomas.co.jp>
- * @copyright  2003-2008 PgPool Global Development Group
+ * @copyright  2003-2012 PgPool Global Development Group
  * @version    CVS: $Id$
  */
 
@@ -169,6 +169,7 @@ $message = array(
     'strCmdC' => 'クエリキャッシュクリア',
     'strCmdD' => 'デバッグモード',
     'strCmdDesc' => '空白の場合には無視',
+    'strCmdLargeC' => 'オンメモリキャッシュの oid map をリセット',
     'strCmdLargeD' => 'pgpool_status を無視',
     'strCmdM' => '停止モード',
     'strCmdN' => '非デーモンモード',
index 8535c85983c7f1b983b834e0daadb8fcaef6e905..aae1e81faba2534d95cdc125f14355275eb97742 100644 (file)
--- a/login.php
+++ b/login.php
@@ -19,7 +19,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando <ando@ecomas.co.jp>
- * @copyright  2003-2008 PgPool Global Development Group
+ * @copyright  2003-2012 PgPool Global Development Group
  * @version    CVS: $Id$
  */
 
@@ -96,6 +96,7 @@ $tpl->assign('D', _PGPOOL2_CMD_OPTION_LARGE_D);
 $tpl->assign('d', _PGPOOL2_CMD_OPTION_D);
 $tpl->assign('m', _PGPOOL2_CMD_OPTION_M);
 $tpl->assign('n', _PGPOOL2_CMD_OPTION_N);
+$tpl->assign('C', _PGPOOL2_CMD_OPTION_LARGE_C);
 
 $tpl->assign('pgpoolStatus',  NULL);
 $tpl->assign('pgpoolMessage', NULL);
index ad0a6cbc85b39a49a0f114c94d9ce8ca38efcc6b..0ce1bb0515256bda5b5b6a43c3b101f57c387dbe 100644 (file)
@@ -19,7 +19,7 @@
  * is" without express or implied warranty.
  *
  * @author     Ryuma Ando <ando@ecomas.co.jp>
- * @copyright  2003-2008 PgPool Global Development Group
+ * @copyright  2003-2012 PgPool Global Development Group
  * @version    SVN: $Id$
  */
 
@@ -55,6 +55,7 @@ $tpl->assign('D', _PGPOOL2_CMD_OPTION_LARGE_D);
 $tpl->assign('d', _PGPOOL2_CMD_OPTION_D);
 $tpl->assign('m', _PGPOOL2_CMD_OPTION_M);
 $tpl->assign('n', _PGPOOL2_CMD_OPTION_N);
+$tpl->assign('C', _PGPOOL2_CMD_OPTION_LARGE_C);
 
 if (isPipe(_PGPOOL2_LOG_FILE)) {
     $tpl->assign('pipe', 1);
@@ -95,6 +96,9 @@ switch ($action) {
                 $args = "$args -n > $pgpoolLog ";
             }
         }
+        if (isset($_POST['C'])) {
+            $args = $args . "-C ";
+        }
 
         $ret = execPcp('PCP_START_PGPOOL', $args);
         if (!array_key_exists('SUCCESS', $ret)) {
@@ -209,6 +213,9 @@ switch ($action) {
                 $args = "$args -n > $pgpoolLog ";
             }
         }
+        if (isset($_POST['C'])) {
+            $args = $args . "-C ";
+        }
 
         $ret = execPcp('PCP_START_PGPOOL', $args);
         if (!array_key_exists('SUCCESS', $ret)) {
index 04068a156a042f56aa12cb24e4a57cbb52edeffc..9cf57e7ecc5e8302def391eabc322b0ae3becde2 100644 (file)
@@ -268,6 +268,14 @@ function changeView(chView){
           {/if}
         </tr>
 
+        <tr><td>{$message.strCmdLargeC|escape} (-C)</td>
+          {if $C == 1}
+          <td><input type="checkbox" name="C" checked="checked" /></td>
+          {else}
+          <td><input type="checkbox" name="C" /></td>
+          {/if}
+        </tr>
+
         <tr><td>{$message.strCmdD|escape} (-d)</td>
           {if $d == 1}
           <td><input type="checkbox" name="d" checked="checked" /></td>
@@ -376,6 +384,14 @@ function changeView(chView){
           {/if}
         </tr>
 
+        <tr><td>{$message.strCmdLargeC|escape} (-C)</td>
+          {if $C == 1}
+          <td><input type="checkbox" name="C" checked="checked" /></td>
+          {else}
+          <td><input type="checkbox" name="C" /></td>
+          {/if}
+        </tr>
+
         <tr><td>{$message.strCmdD|escape}(-d)</td>
           {if $d == 1}
           <td><input type="checkbox" name="d" checked="checked" /></td>
index 92190ab024aa392be7b89b6fa775e57ea06565bf..b309012aa390cb43f811a94dff03e7ef076b76ac 100644 (file)
  * is" without express or implied warranty.\r
  *\r
  * @author     Ryuma Ando <ando@ecomas.co.jp>\r
- * @copyright  2003-2011 PgPool Global Development Group\r
+ * @copyright  2003-2012 PgPool Global Development Group\r
  * @version    SVN: $Id$\r
  */\r
 \r
-$version = '3.1.1';\r
+$version = '3.2.0';\r
 \r
 ?>\r