b2evolution PHP Cross Reference Blogging Systems

Source: /inc/cron/jobs/_light_db_maintenance.job.php - 41 lines - 1182 bytes - Text - Print

Description: This file implements the test Cron controller

   1  <?php
   2  /**

   3   * This file implements the test Cron controller

   4   *

   5   * @author fplanque: Francois PLANQUE

   6   *

   7   * @version $Id: _light_db_maintenance.job.php 9 2011-10-24 22:32:00Z fplanque $

   8   */
   9  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  10  
  11  global $dbm_tables_count;
  12  
  13  load_funcs('tools/model/_dbmaintenance.funcs.php');
  14  
  15  // Execute query to get results of ANALYZE command

  16  $results = dbm_analyze_tables( false, false );
  17  
  18  $simple_keys = array( 0, 1, 2, 3 );
  19  $failed_results = array();
  20  foreach( $results as $result )
  21  {
  22      if( $result->Msg_type != 'status' )
  23      { // Add different result types then 'status' to the failed resulsts array, so they can be display on the cron task view
  24          // Convert keys to simple integer values to decrease a size of the data

  25          $failed_results[] = array_combine( $simple_keys, (array)$result );
  26      }
  27  }
  28  
  29  $result_message = array(
  30      'message' => sprintf( T_('The command ANALYZE has been executed for all %d tables.'), $dbm_tables_count ),
  31      'table_cols' => array(
  32          T_('Table'),
  33          T_('Operation'),
  34          T_('Result'),
  35          T_('Message ')
  36      ),
  37      'table_data' => $failed_results
  38  );
  39  
  40  return 1; /* ok */
  41  ?>

title

Description

title

Description

title

Description

title

title

Body