[ Index ]
 

Code source de Plume CMS 1.2.2

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/manager/tools/info/ -> index.php (source)

   1  <?php
   2  /*
   3  # ***** BEGIN LICENSE BLOCK *****
   4  # This file is part of Plume CMS, a website management application.
   5  # Copyright (C) 2001-2005 Loic d'Anterroches and contributors.
   6  #
   7  # Plume CMS is free software; you can redistribute it and/or modify
   8  # it under the terms of the GNU General Public License as published by
   9  # the Free Software Foundation; either version 2 of the License, or
  10  # (at your option) any later version.
  11  #
  12  # Plume CMS is distributed in the hope that it will be useful,
  13  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15  # GNU General Public License for more details.
  16  #
  17  # You should have received a copy of the GNU General Public License
  18  # along with this program; if not, write to the Free Software
  19  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  20  #
  21  # ***** END LICENSE BLOCK ***** */
  22  
  23  include_once dirname(__FILE__).'/../../extinc/lib.image.php';
  24  include_once dirname(__FILE__).'/lib.dir.php';
  25  
  26  $m->l10n->loadPlugin($m->user->lang, 'info');
  27  
  28  if (!$is_user_root):
  29      $m->setError( __('You do not have the rights to access this plugin.'));
  30  else:    
  31  
  32  if (!empty($_GET['cleancache']) && !empty($_GET['id'])) {
  33      // try to clean the cache
  34      $siteid = $_GET['id'];
  35      if (!empty($m->user->wdata[$siteid]['website_name'])) {
  36          // ok the site exists
  37          recursiveDelete($_PX_config['manager_path'].'/cache/'.$siteid.'/');
  38          clearstatcache();
  39          @mkdir($_PX_config['manager_path'].'/cache/'.$siteid.'/', 0777);
  40          @touch($_PX_config['manager_path'].'/cache/'.$siteid.'/MASS_UPDATE', time());
  41          $msg =  __('The cache of the website has been reset.');
  42          header('Location: tools.php?p=info&msg='.urlencode($msg));
  43          exit; 
  44      } else {
  45          $m->setError( __('Error&nbsp;: Website not available.'), 400);
  46      }                
  47  }
  48  
  49  ?>
  50  <h1><?php  echo __('Information'); ?></h1>
  51  
  52  <h2><?php  echo __('General information'); ?></h2>
  53  <?php
  54  
  55  
  56  // Version 
  57  if (file_exists(dirname(__FILE__).'/../../VERSION')) {
  58      $px_version = trim(implode('',file(dirname(__FILE__).'/../../VERSION')));
  59      
  60      echo '<p>'.sprintf( __('You are using PLUME CMS version <strong>%s</strong>.'), $px_version).'</p>';
  61  }
  62  
  63  $con =& pxDBConnect();
  64  $rs = $con->select('SHOW TABLE STATUS FROM '.$_PX_config['db']['db_database']);
  65  
  66  echo '<p>'. __('The PLUME CMS tables in your database are:').'</p>';
  67  echo '<table class="clean-table">';
  68  echo '<tr><th>'. __('Name').'</th><th>'. __('Records').'</th><th>'. __('Size').'</th></tr>';
  69  while (!$rs->EOF())
  70  {
  71      if (preg_match('#'.$con->pfx.'#',$rs->f('name'))) {
  72          echo '<tr>';
  73          echo '<td>'.$rs->f('name').'</td>';
  74          echo '<td>'.$rs->f('rows').'</td>';
  75          echo '<td>'.prettySize($rs->f('Data_length')+$rs->f('Index_length')).'</td>';
  76          echo '</tr>';
  77      }
  78      
  79      $rs->moveNext();
  80  }
  81  echo '</table>';
  82  ?>
  83  
  84  <h3><?php  echo __('Cache information'); ?></h3>
  85  
  86  <?php
  87  echo '<table class="clean-table">';
  88  echo '<tr><th>'. __('Website').'</th><th>'. __('Cache size').'</th><th>'. __('Reset the cache').'</th></tr>';
  89  reset($m->user->webs);
  90  foreach ($m->user->webs as $site => $score) {
  91      $size = dirSize($_PX_config['manager_path'].'/cache/'.$site.'/');
  92      if ($size) {
  93          $link = sprintf('<a href="tools.php?p=info&amp;cleancache=1&amp;id='.$site.'">%s</a>', __('Reset'));
  94      } else {
  95          $link = '&nbsp;';
  96      }         
  97      echo '<tr>';
  98      echo '<td>'.$m->user->wdata[$site]['website_name'].'</td>';
  99      echo '<td>'.prettySize($size).'</td>';
 100      echo '<td>'.$link.'</td>';
 101      echo '</tr>';
 102  }
 103  echo '</table>';
 104  
 105  ?>
 106  
 107  <p><?php  echo __('If you are making modifications to your templates, you should clean the cache before testing them.'); ?></p>
 108  
 109  <h3><?php  echo __('File information'); ?></h3>
 110  
 111  <?php $img_check = '<img src="themes/'.$_px_theme.'/images/check_%s.png" alt="" />'; ?>
 112  
 113  <?php
 114  
 115  if (is_writable($_PX_config['manager_path'].'/cache')) {
 116      echo '<p>'.sprintf($img_check,'on').' '.sprintf( __('The system has write access on the folder %s.'),cleanDirname($_PX_config['manager_path'].'/cache')).'</p>';
 117  } else {
 118      echo '<p>'.sprintf($img_check,'off').' '.sprintf( __('The system has no write access on the folder %s.'),cleanDirname($_PX_config['manager_path'].'/cache')).'</p>';
 119  }
 120  
 121  if (is_writable($_PX_config['manager_path'].'/conf')) {
 122      echo '<p>'.sprintf($img_check,'on').' '.sprintf( __('The system has write access on the folder %s.'),cleanDirname($_PX_config['manager_path'].'/conf')).'</p>';
 123  } else {
 124      echo '<p>'.sprintf($img_check,'off').' '.sprintf( __('The system has no write access on the folder %s.'),cleanDirname($_PX_config['manager_path'].'/conf')).'</p>';
 125  }
 126  
 127  reset($m->user->webs);
 128  foreach ($m->user->webs as $site => $score) {
 129      if (is_writable($_PX_config['manager_path'].'/conf/configweb_'.$site.'.php')) {
 130          echo '<p>'.sprintf($img_check,'on').' '.sprintf( __('The system has write access on the file %s.'),cleanDirname($_PX_config['manager_path'].'/conf/configweb_'.$site.'.php')).'</p>';
 131      } else {
 132          echo '<p>'.sprintf($img_check,'off').' '.sprintf( __('The system has no write access on the file %s.'),cleanDirname($_PX_config['manager_path'].'/conf/configweb_'.$site.'.php')).'</p>';
 133      }
 134      if (is_writable($m->user->wdata[$site]['website_xmedia_path'])) {
 135          echo '<p>'.sprintf($img_check,'on').' '.sprintf( __('The system has write access on the folder %s.'),cleanDirname($m->user->wdata[$site]['website_xmedia_path'])).'</p>';
 136      } else {
 137          echo '<p>'.sprintf($img_check,'off').' '.sprintf( __('The system has no write access on the folder %s.'),cleanDirname($m->user->wdata[$site]['website_xmedia_path'])).'</p>';
 138      }
 139      if (is_writable($m->user->wdata[$site]['website_xmedia_path'].'/thumb')) {
 140          echo '<p>'.sprintf($img_check,'on').' '.sprintf( __('The system has write access on the folder %s.'),cleanDirname($m->user->wdata[$site]['website_xmedia_path'].'/thumb')).'</p>';
 141      } else {
 142          echo '<p>'.sprintf($img_check,'off').' '.sprintf( __('The system has no write access on the folder %s.'),cleanDirname($m->user->wdata[$site]['website_xmedia_path'].'/thumb')).'</p>';
 143      }
 144  }
 145  
 146  ?>
 147  
 148  
 149  <h3><?php  echo __('Server information'); ?></h3>
 150  
 151  <p><?php echo sprintf( __('Your PHP version is <strong>%s</strong>.'),phpversion()); ?></p>
 152  
 153  <?php
 154  if (($rs = $con->select('SELECT VERSION() AS version')) !== false) {
 155      $mysql_version = preg_replace('/-log$/','',$rs->f(0));
 156      echo '<p>'.sprintf( __('Your MySQL version is <strong>%s</strong>.'),$mysql_version).'</p>';
 157      
 158  }
 159  
 160  if (!empty($_SERVER['SERVER_SOFTWARE'])) {
 161      echo '<p>'.sprintf( __('Your webserver is <strong>%s</strong>.'),$_SERVER['SERVER_SOFTWARE']).'</p>';
 162  }
 163  
 164  $gd_version = gd_version(); 
 165  
 166  if ($gd_version) {
 167      echo '<p>'.sprintf( __('Your GD graphic library version is <strong>%s</strong>.'),$gd_version).'</p>';
 168  }
 169  
 170  endif;
 171  ?>


Généré le : Mon Nov 26 11:57:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics