diff options
author | mistic100 <mistic@piwigo.org> | 2013-10-19 17:43:04 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2013-10-19 17:43:04 +0000 |
commit | ae707279a1945e383c312cd648d288606a79e341 (patch) | |
tree | 917bdc6e0609ed0eefed5f3693de3a017685acc4 /include/dblayer | |
parent | 35ff1b7c1f933799397a0ce0a6723cf82f416ff3 (diff) |
remove all array_push (50% slower than []) + some changes missing for feature:2978
git-svn-id: http://piwigo.org/svn/trunk@25018 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/dblayer')
-rw-r--r-- | include/dblayer/functions_mysql.inc.php | 16 | ||||
-rw-r--r-- | include/dblayer/functions_mysqli.inc.php | 16 |
2 files changed, 10 insertions, 22 deletions
diff --git a/include/dblayer/functions_mysql.inc.php b/include/dblayer/functions_mysql.inc.php index 9c73637ee..3992ed6c2 100644 --- a/include/dblayer/functions_mysql.inc.php +++ b/include/dblayer/functions_mysql.inc.php @@ -328,7 +328,7 @@ SHOW FULL COLUMNS FROM '.$tablename; { $column.= " collate '".$row['Collation']."'"; } - array_push($columns, $column); + $columns[] = $column; } } @@ -564,7 +564,7 @@ function do_maintenance_all_tables() $result = pwg_query($query); while ($row = pwg_db_fetch_row($result)) { - array_push($all_tables, $row[0]); + $all_tables[] = $row[0]; } // Repair all tables @@ -582,7 +582,7 @@ function do_maintenance_all_tables() { if ($row['Key'] == 'PRI') { - array_push($all_primary_key, $row['Field']); + $all_primary_key[] = $row['Field']; } } @@ -598,17 +598,11 @@ function do_maintenance_all_tables() $mysql_rc = $mysql_rc && pwg_query($query); if ($mysql_rc) { - array_push( - $page['infos'], - l10n('All optimizations have been successfully completed.') - ); + $page['infos'][] = l10n('All optimizations have been successfully completed.'); } else { - array_push( - $page['errors'], - l10n('Optimizations have been completed with some errors.') - ); + $page['errors'][] = l10n('Optimizations have been completed with some errors.'); } } diff --git a/include/dblayer/functions_mysqli.inc.php b/include/dblayer/functions_mysqli.inc.php index 8c1ffe5ae..8dc4e46ce 100644 --- a/include/dblayer/functions_mysqli.inc.php +++ b/include/dblayer/functions_mysqli.inc.php @@ -365,7 +365,7 @@ SHOW FULL COLUMNS FROM '.$tablename; { $column.= " collate '".$row['Collation']."'"; } - array_push($columns, $column); + $columns[] = $column; } } @@ -601,7 +601,7 @@ function do_maintenance_all_tables() $result = pwg_query($query); while ($row = pwg_db_fetch_row($result)) { - array_push($all_tables, $row[0]); + $all_tables[] = $row[0]; } // Repair all tables @@ -619,7 +619,7 @@ function do_maintenance_all_tables() { if ($row['Key'] == 'PRI') { - array_push($all_primary_key, $row['Field']); + $all_primary_key[] = $row['Field']; } } @@ -635,17 +635,11 @@ function do_maintenance_all_tables() $mysqli_rc = $mysqli_rc && pwg_query($query); if ($mysqli_rc) { - array_push( - $page['infos'], - l10n('All optimizations have been successfully completed.') - ); + $page['infos'][] = l10n('All optimizations have been successfully completed.'); } else { - array_push( - $page['errors'], - l10n('Optimizations have been completed with some errors.') - ); + $page['errors'][] = l10n('Optimizations have been completed with some errors.'); } } |