- Timestamp:
- Mar 28, 2006, 11:05:12 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r1105 r1111 2093 2093 ); 2094 2094 } 2095 2096 /** 2097 * Do maintenance on all PWG tables 2098 * 2099 * @return nono 2100 */ 2101 function do_maintenance_all_tables() 2102 { 2103 global $prefixeTable; 2104 2105 $all_tables = array(); 2106 2107 // List all tables 2108 $query = 'SHOW TABLES LIKE \''.$prefixeTable.'%\';'; 2109 $result = pwg_query($query); 2110 while ($row = mysql_fetch_array($result)) 2111 { 2112 array_push($all_tables, $row[0]); 2113 } 2114 2115 // Repair all tables 2116 $query = 'REPAIR TABLE '.implode(', ', $all_tables).';'; 2117 pwg_query($query); 2118 2119 // Re-Order all tables 2120 foreach ($all_tables as $table_name) 2121 { 2122 $all_primary_key = array(); 2123 2124 $query = 'DESC '.$table_name.';'; 2125 $result = pwg_query($query); 2126 while ($row = mysql_fetch_array($result)) 2127 { 2128 if ($row['Key'] == 'PRI') 2129 { 2130 array_push($all_primary_key, $row['Field']); 2131 } 2132 } 2133 2134 if (count($all_primary_key) != 0) 2135 { 2136 $query = 'ALTER TABLE '.$table_name.' ORDER BY '.implode(', ', $all_primary_key).';'; 2137 pwg_query($query); 2138 } 2139 } 2140 2141 // Optimize all tables 2142 $query = 'OPTIMIZE TABLE '.implode(', ', $all_tables).';'; 2143 pwg_query($query); 2144 2145 } 2146 2147 2095 2148 ?> -
trunk/admin/maintenance.php
r1085 r1111 42 42 // +-----------------------------------------------------------------------+ 43 43 44 $action = isset($_GET['action']) ? $_GET['action'] : '';44 $action = (isset($_GET['action']) and !is_adviser()) ? $_GET['action'] : ''; 45 45 46 46 switch ($action) … … 85 85 break; 86 86 } 87 case 'database' : 88 { 89 do_maintenance_all_tables(); 90 break; 91 } 87 92 default : 88 93 { … … 99 104 $start_url = PHPWG_ROOT_PATH.'admin.php?page=maintenance&action='; 100 105 101 if (!is_adviser()) 102 { 103 $template->assign_vars( 104 array( 105 'U_MAINT_CATEGORIES' => $start_url.'categories', 106 'U_MAINT_IMAGES' => $start_url.'images', 107 'U_MAINT_HISTORY' => $start_url.'history', 108 'U_MAINT_SESSIONS' => $start_url.'sessions', 109 'U_MAINT_FEEDS' => $start_url.'feeds', 110 'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=maintenance', 111 ) 112 ); 113 } 114 else 115 { 116 $template->assign_vars( 117 array( 118 'U_MAINT_CATEGORIES' => $start_url, 119 'U_MAINT_IMAGES' => $start_url, 120 'U_MAINT_HISTORY' => $start_url, 121 'U_MAINT_SESSIONS' => $start_url, 122 'U_MAINT_FEEDS' => $start_url, 123 'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=maintenance', 124 ) 125 ); 126 } 106 $template->assign_vars( 107 array( 108 'U_MAINT_CATEGORIES' => $start_url.'categories', 109 'U_MAINT_IMAGES' => $start_url.'images', 110 'U_MAINT_HISTORY' => $start_url.'history', 111 'U_MAINT_SESSIONS' => $start_url.'sessions', 112 'U_MAINT_FEEDS' => $start_url.'feeds', 113 'U_MAINT_DATABASE' => $start_url.'database', 114 'U_HELP' => PHPWG_ROOT_PATH.'/popuphelp.php?page=maintenance', 115 ) 116 ); 127 117 128 118 // +-----------------------------------------------------------------------+ -
trunk/language/en_UK.iso-8859-1/admin.lang.php
r1107 r1111 294 294 $lang['purge history'] = 'purge history'; 295 295 $lang['purge never used notification feeds'] = 'purge never used notification feeds'; 296 $lang['repair and optimize database'] = 'repair and optimize database'; 296 297 $lang['purge sessions'] = 'purge sessions'; 297 298 $lang['randomly represented'] = 'randomly represented'; -
trunk/language/en_UK.iso-8859-1/help/maintenance.html
r889 r1111 12 12 <ul> 13 13 14 <li><strong> update categories informations</strong>. For each category,14 <li><strong>Update categories informations</strong>. For each category, 15 15 informations to update or control are the following : list of parent 16 16 categories, number of pictures, date of the last picture, position among … … 18 18 the coherence of representative picture.</li> 19 19 20 <li><strong> update images informations</strong>. For each picture,20 <li><strong>Update images informations</strong>. For each picture, 21 21 informations to update are : full path to file, average 22 22 rate. <em>Warning</em>: do not get confuse with metadata informations … … 26 26 example).</li> 27 27 28 <li><strong> purge history</strong>. Delete all lines from28 <li><strong>Purge history</strong>. Delete all lines from 29 29 <code>history</code> table. Screen <span class="pwgScreen">Administration, 30 30 General, History</span> shows no informations anymore on past … … 32 32 get informations back.</li> 33 33 34 <li><strong> purge sessions</strong>. Delete expired user sessions.</li>34 <li><strong>Purge sessions</strong>. Delete expired user sessions.</li> 35 35 36 <li><strong>purge never used notification feeds</strong></li> 36 <li><strong>Purge never used notification feeds</strong></li> 37 38 <li><strong>Repair and optimize database</strong> 39 For each table, re-odrer, repair and optimize operations are done. 40 </li> 37 41 38 42 </ul> -
trunk/language/fr_FR.iso-8859-1/admin.lang.php
r1107 r1111 294 294 $lang['purge history'] = 'purger l\'historique'; 295 295 $lang['purge never used notification feeds'] = 'purger les flux de notification jamais utilisés'; 296 $lang['repair and optimize database'] = 'réparer et optimiser la base de données'; 296 297 $lang['purge sessions'] = 'purger les sessions'; 297 298 $lang['randomly represented'] = 'représentant au hasard'; -
trunk/language/fr_FR.iso-8859-1/help/maintenance.html
r1099 r1111 29 29 class="pwgScreen">picture.php</span>).</li> 30 30 31 <li><strong> purger l'historique</strong>. Supprime toutes les lignes de31 <li><strong>Purger l'historique</strong>. Supprime toutes les lignes de 32 32 la table <code>history</code>. L'écran <span 33 33 class="pwgScreen">Administration, Général, Historique</span> ne montre alors … … 35 35 seront perdues et il n'existe aucun moyen de les récupérer.</li> 36 36 37 <li><strong> purger les sessions</strong>. Supprimer les sessions37 <li><strong>Purger les sessions</strong>. Supprimer les sessions 38 38 expirées..</li> 39 39 40 <li><strong>purger les flux de notification jamais utilisés</strong></li> 40 <li><strong>Purger les flux de notification jamais utilisés</strong></li> 41 42 <li><strong>Réparer et optimiser la base de données</strong> 43 Pour chaque tables de la base de données PhpWegGallery, les opérations de ré-ordonnancement, de réparation et d'optimisation sont effectuées. 44 </li> 41 45 42 46 </ul> -
trunk/template/yoga/admin/maintenance.tpl
r1085 r1111 13 13 <li><a href="{U_MAINT_SESSIONS}" {TAG_INPUT_ENABLED}>{lang:purge sessions}</a></li> 14 14 <li><a href="{U_MAINT_FEEDS}" {TAG_INPUT_ENABLED}>{lang:purge never used notification feeds}</a></li> 15 <li><a href="{U_MAINT_DATABASE}" {TAG_INPUT_ENABLED}>{lang:repair and optimize database}</a></li> 15 16 </ul>
Note: See TracChangeset
for help on using the changeset viewer.