aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2013-10-19 17:43:04 +0000
committermistic100 <mistic@piwigo.org>2013-10-19 17:43:04 +0000
commitae707279a1945e383c312cd648d288606a79e341 (patch)
tree917bdc6e0609ed0eefed5f3693de3a017685acc4 /include
parent35ff1b7c1f933799397a0ce0a6723cf82f416ff3 (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')
-rw-r--r--include/calendar_monthly.class.php2
-rw-r--r--include/calendar_weekly.class.php3
-rw-r--r--include/category_cats.inc.php2
-rw-r--r--include/dblayer/functions_mysql.inc.php16
-rw-r--r--include/dblayer/functions_mysqli.inc.php16
-rw-r--r--include/filter.inc.php5
-rw-r--r--include/functions.inc.php6
-rw-r--r--include/functions_calendar.inc.php2
-rw-r--r--include/functions_comment.inc.php12
-rw-r--r--include/functions_mail.inc.php4
-rw-r--r--include/functions_notification.inc.php16
-rw-r--r--include/functions_plugins.inc.php2
-rw-r--r--include/functions_search.inc.php49
-rw-r--r--include/functions_tag.inc.php2
-rw-r--r--include/functions_url.inc.php15
-rw-r--r--include/picture_comment.inc.php6
-rw-r--r--include/section_init.inc.php2
-rw-r--r--include/ws_functions.inc.php54
-rw-r--r--include/ws_protocols/rest_encoder.php2
19 files changed, 89 insertions, 127 deletions
diff --git a/include/calendar_monthly.class.php b/include/calendar_monthly.class.php
index f3eb2a909..091d78884 100644
--- a/include/calendar_monthly.class.php
+++ b/include/calendar_monthly.class.php
@@ -388,7 +388,7 @@ SELECT id, file,representative_ext,path,width,height,rotation, '.pwg_db_get_dayo
$first_day_dow -= 1;
}
- array_push( $wday_labels, array_shift($wday_labels) );
+ $wday_labels[] = array_shift($wday_labels);
}
list($cell_width, $cell_height) = ImageStdParams::get_by_type(IMG_SQUARE)->sizing->ideal_size;
diff --git a/include/calendar_weekly.class.php b/include/calendar_weekly.class.php
index 5c2a346b1..0bd133284 100644
--- a/include/calendar_weekly.class.php
+++ b/include/calendar_weekly.class.php
@@ -68,8 +68,7 @@ class Calendar extends CalendarBase
{
$this->calendar_levels[CWEEK]['sql'] = pwg_db_get_week($this->date_field, 5).'+1';
$this->calendar_levels[CDAY]['sql'] = pwg_db_get_weekday($this->date_field);
- array_push( $this->calendar_levels[CDAY]['labels'],
- array_shift( $this->calendar_levels[CDAY]['labels'] ) );
+ $this->calendar_levels[CDAY]['labels'][] = array_shift($this->calendar_levels[CDAY]['labels']);
}
}
diff --git a/include/category_cats.inc.php b/include/category_cats.inc.php
index 8d334f6a0..f579a6cdd 100644
--- a/include/category_cats.inc.php
+++ b/include/category_cats.inc.php
@@ -207,7 +207,7 @@ SELECT *
if (isset($image_id) and !in_array($image_id, $image_ids))
{
- array_push($new_image_ids, $image_id);
+ $new_image_ids[] = $image_id;
}
if ($conf['representative_cache_on_level'])
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.');
}
}
diff --git a/include/filter.inc.php b/include/filter.inc.php
index 4b0f93bbf..45440d0fd 100644
--- a/include/filter.inc.php
+++ b/include/filter.inc.php
@@ -123,7 +123,10 @@ WHERE ';
unset($filter_key);
if (get_filter_page_value('add_notes'))
{
- $header_notes[] = l10n_dec('Photos posted within the last %d day.', 'Photos posted within the last %d days.', $filter['recent_period']);
+ $header_notes[] = l10n_dec(
+ 'Photos posted within the last %d day.', 'Photos posted within the last %d days.',
+ $filter['recent_period']
+ );
}
include_once(PHPWG_ROOT_PATH.'include/functions_filter.inc.php');
}
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 6f2df2880..5dc8ea255 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -878,8 +878,10 @@ SELECT element_id
foreach ($caddiables as $caddiable)
{
- array_push($datas, array('element_id' => $caddiable,
- 'user_id' => $user['id']));
+ $datas[] = array(
+ 'element_id' => $caddiable,
+ 'user_id' => $user['id'],
+ );
}
if (count($caddiables) > 0)
diff --git a/include/functions_calendar.inc.php b/include/functions_calendar.inc.php
index 59f2ee571..b8ad3d0fa 100644
--- a/include/functions_calendar.inc.php
+++ b/include/functions_calendar.inc.php
@@ -212,7 +212,7 @@ WHERE id IN (' . implode(',',$page['items']) .')';
$chronology_date = array();
if ( isset($page['chronology_date'][0]) )
{
- array_push($chronology_date, $page['chronology_date'][0]);
+ $chronology_date[] = $page['chronology_date'][0];
}
}
else
diff --git a/include/functions_comment.inc.php b/include/functions_comment.inc.php
index 42ceb5cc3..9ea597672 100644
--- a/include/functions_comment.inc.php
+++ b/include/functions_comment.inc.php
@@ -93,7 +93,7 @@ function insert_user_comment( &$comm, $key, &$infos )
{
if ($conf['comments_author_mandatory'])
{
- array_push($infos, l10n('Username is mandatory') );
+ $infos[] = l10n('Username is mandatory');
$comment_action='reject';
}
$comm['author'] = 'guest';
@@ -110,7 +110,7 @@ SELECT COUNT(*) AS user_exists
$row = pwg_db_fetch_assoc( pwg_query( $query ) );
if ( $row['user_exists'] == 1 )
{
- array_push($infos, l10n('This login is already used by another user') );
+ $infos[] = l10n('This login is already used by another user');
$comment_action='reject';
}
}
@@ -141,7 +141,7 @@ SELECT COUNT(*) AS user_exists
}
if (!url_check_format($comm['website_url']))
{
- array_push($infos, l10n('Your website URL is invalid'));
+ $infos[] = l10n('Your website URL is invalid');
$comment_action='reject';
}
}
@@ -155,13 +155,13 @@ SELECT COUNT(*) AS user_exists
}
else if ($conf['comments_email_mandatory'])
{
- array_push($infos, l10n('Email address is missing. Please specify an email address.') );
+ $infos[] = l10n('Email address is missing. Please specify an email address.');
$comment_action='reject';
}
}
else if (!email_check_format($comm['email']))
{
- array_push($infos, l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)'));
+ $infos[] = l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)');
$comment_action='reject';
}
@@ -192,7 +192,7 @@ SELECT count(1) FROM '.COMMENTS_TABLE.'
list($counter) = pwg_db_fetch_row(pwg_query($query));
if ( $counter > 0 )
{
- array_push( $infos, l10n('Anti-flood system : please wait for a moment before trying to post another comment') );
+ $infos[] = l10n('Anti-flood system : please wait for a moment before trying to post another comment');
$comment_action='reject';
}
}
diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php
index 51858cf33..b67f46d3c 100644
--- a/include/functions_mail.inc.php
+++ b/include/functions_mail.inc.php
@@ -293,7 +293,7 @@ SELECT
{
if (!empty($admin['mail_address']))
{
- array_push($admins, format_email($admin['username'], $admin['mail_address']));
+ $admins[] = format_email($admin['username'], $admin['mail_address']);
}
}
}
@@ -419,7 +419,7 @@ WHERE
{
if (!empty($row['mail_address']))
{
- array_push($Bcc, format_email(stripslashes($row['username']), $row['mail_address']));
+ $Bcc[] = format_email(stripslashes($row['username']), $row['mail_address']);
}
}
diff --git a/include/functions_notification.inc.php b/include/functions_notification.inc.php
index a687195d9..18378cbb4 100644
--- a/include/functions_notification.inc.php
+++ b/include/functions_notification.inc.php
@@ -206,7 +206,7 @@ function custom_notification_query($action, $type, $start, $end)
while ($row = pwg_db_fetch_assoc($result))
{
- array_push($infos, $row);
+ $infos[] = $row;
}
return $infos;
@@ -369,7 +369,7 @@ function add_news_line(&$news, $count, $singular_fmt_key, $plural_fmt_key, $url=
{
$line = '<a href="'.$url.'">'.$line.'</a>';
}
- array_push($news, $line);
+ $news[] = $line;
}
}
@@ -450,7 +450,7 @@ SELECT date_available,
$dates = array();
while ($row = pwg_db_fetch_assoc($result))
{
- array_push($dates, $row);
+ $dates[] = $row;
}
for ($i=0; $i<count($dates); $i++)
@@ -469,7 +469,7 @@ SELECT DISTINCT i.*
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
{
- array_push($dates[$i]['elements'], $row);
+ $dates[$i]['elements'][] = $row;
}
}
@@ -489,7 +489,7 @@ SELECT DISTINCT c.uppercats, COUNT(DISTINCT i.id) AS img_count
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
{
- array_push($dates[$i]['categories'], $row);
+ $dates[$i]['categories'][] = $row;
}
}
}
@@ -546,8 +546,7 @@ function get_html_description_recent_post_date($date_detail)
$description .=
'<li>'
- .l10n_dec('%d album updated', '%d albums updated',
- $date_detail['nb_cats'])
+ .l10n_dec('%d album updated', '%d albums updated', $date_detail['nb_cats'])
.'</li>';
$description .= '<ul>';
@@ -557,8 +556,7 @@ function get_html_description_recent_post_date($date_detail)
'<li>'
.get_cat_display_name_cache($cat['uppercats'])
.' ('.
- l10n_dec('%d new photo',
- '%d new photos', $cat['img_count']).')'
+ l10n_dec('%d new photo', '%d new photos', $cat['img_count']).')'
.'</li>';
}
$description .= '</ul>';
diff --git a/include/functions_plugins.inc.php b/include/functions_plugins.inc.php
index e11e35dc5..03dcbf851 100644
--- a/include/functions_plugins.inc.php
+++ b/include/functions_plugins.inc.php
@@ -220,7 +220,7 @@ SELECT * FROM '.PLUGINS_TABLE;
$plugins = array();
while ($row = pwg_db_fetch_assoc($result))
{
- array_push($plugins, $row);
+ $plugins[] = $row;
}
return $plugins;
}
diff --git a/include/functions_search.inc.php b/include/functions_search.inc.php
index 6494f0d61..6c57b9e90 100644
--- a/include/functions_search.inc.php
+++ b/include/functions_search.inc.php
@@ -68,18 +68,15 @@ function get_sql_search_clause($search)
$local_clauses = array();
foreach ($search['fields'][$textfield]['words'] as $word)
{
- array_push($local_clauses, $textfield." LIKE '%".$word."%'");
+ $local_clauses[] = $textfield." LIKE '%".$word."%'";
}
// adds brackets around where clauses
$local_clauses = prepend_append_array_items($local_clauses, '(', ')');
- array_push(
- $clauses,
- implode(
- ' '.$search['fields'][$textfield]['mode'].' ',
- $local_clauses
- )
+ $clauses[] = implode(
+ ' '.$search['fields'][$textfield]['mode'].' ',
+ $local_clauses
);
}
}
@@ -100,15 +97,12 @@ function get_sql_search_clause($search)
$field_clauses = array();
foreach ($fields as $field)
{
- array_push($field_clauses, $field." LIKE '%".$word."%'");
+ $field_clauses[] = $field." LIKE '%".$word."%'";
}
// adds brackets around where clauses
- array_push(
- $word_clauses,
- implode(
- "\n OR ",
- $field_clauses
- )
+ $word_clauses[] = implode(
+ "\n OR ",
+ $field_clauses
);
}
@@ -117,26 +111,18 @@ function get_sql_search_clause($search)
create_function('&$s','$s="(".$s.")";')
);
- array_push(
- $clauses,
- "\n ".
+ $clauses[] = "\n ".
implode(
- "\n ".
- $search['fields']['allwords']['mode'].
- "\n ",
+ "\n ". $search['fields']['allwords']['mode']. "\n ",
$word_clauses
- )
- );
+ );
}
foreach (array('date_available', 'date_creation') as $datefield)
{
if (isset($search['fields'][$datefield]))
{
- array_push(
- $clauses,
- $datefield." = '".$search['fields'][$datefield]['date']."'"
- );
+ $clauses[] = $datefield." = '".$search['fields'][$datefield]['date']."'"
}
foreach (array('after','before') as $suffix)
@@ -145,15 +131,10 @@ function get_sql_search_clause($search)
if (isset($search['fields'][$key]))
{
- array_push(
- $clauses,
-
- $datefield.
+ $clauses[] = $datefield.
($suffix == 'after' ? ' >' : ' <').
($search['fields'][$key]['inc'] ? '=' : '').
- " '".$search['fields'][$key]['date']."'"
-
- );
+ " '".$search['fields'][$key]['date']."'";
}
}
}
@@ -171,7 +152,7 @@ function get_sql_search_clause($search)
}
$local_clause = 'category_id IN ('.implode(',', $cat_ids).')';
- array_push($clauses, $local_clause);
+ $clauses[] = $local_clause;
}
// adds brackets around where clauses
diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php
index 17ae996ab..52f01ab88 100644
--- a/include/functions_tag.inc.php
+++ b/include/functions_tag.inc.php
@@ -332,7 +332,7 @@ SELECT *
$tags = array();
while ($row = pwg_db_fetch_assoc($result))
{
- array_push($tags, $row);
+ $tags[] = $row;
}
return $tags;
}
diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php
index 2e56c67c9..02b938ecb 100644
--- a/include/functions_url.inc.php
+++ b/include/functions_url.inc.php
@@ -466,14 +466,13 @@ function parse_section_url( $tokens, &$next_token)
{
if (empty($maybe_permalinks))
{
- array_push($maybe_permalinks, $tokens[$current_token]);
+ $maybe_permalinks[] = $tokens[$current_token];
}
else
{
- array_push($maybe_permalinks,
+ $maybe_permalinks[] =
$maybe_permalinks[count($maybe_permalinks)-1]
- . '/' . $tokens[$current_token]
- );
+ . '/' . $tokens[$current_token];
}
$current_token++;
}
@@ -527,11 +526,11 @@ function parse_section_url( $tokens, &$next_token)
if ( $conf['tag_url_style'] != 'tag' and preg_match('/^(\d+)(?:-(.*)|)$/', $tokens[$i], $matches) )
{
- array_push($requested_tag_ids, $matches[1]);
+ $requested_tag_ids[] = $matches[1];
}
else
{
- array_push($requested_tag_url_names, $tokens[$i]);
+ $requested_tag_url_names[] = $tokens[$i];
}
$i++;
}
@@ -597,7 +596,7 @@ function parse_section_url( $tokens, &$next_token)
if (empty($tokens[$next_token]))
{
// Add dummy element list
- array_push($page['list'], -1);
+ $page['list'][] = -1;
}
// With pictures list
else
@@ -608,7 +607,7 @@ function parse_section_url( $tokens, &$next_token)
}
foreach (explode(',', $tokens[$next_token]) as $image_id)
{
- array_push($page['list'], $image_id);
+ $page['list'][] = $image_id;
}
}
$next_token++;
diff --git a/include/picture_comment.inc.php b/include/picture_comment.inc.php
index 9a4cef3dd..090c595bf 100644
--- a/include/picture_comment.inc.php
+++ b/include/picture_comment.inc.php
@@ -60,13 +60,13 @@ if ( $page['show_comments'] and isset( $_POST['content'] ) )
switch ($comment_action)
{
case 'moderate':
- array_push($page['infos'], l10n('An administrator must authorize your comment before it is visible.') );
+ $page['infos'][] = l10n('An administrator must authorize your comment before it is visible.');
case 'validate':
- array_push($page['infos'], l10n('Your comment has been registered'));
+ $page['infos'][] = l10n('Your comment has been registered');
break;
case 'reject':
set_status_header(403);
- array_push($page['errors'], l10n('Your comment has NOT been registered because it did not pass the validation rules') );
+ $page['errors'][] = l10n('Your comment has NOT been registered because it did not pass the validation rules');
break;
default:
trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING);
diff --git a/include/section_init.inc.php b/include/section_init.inc.php
index c71c44780..0b85c2c33 100644
--- a/include/section_init.inc.php
+++ b/include/section_init.inc.php
@@ -339,7 +339,7 @@ else
$page['tag_ids'] = array();
foreach ($page['tags'] as $tag)
{
- array_push($page['tag_ids'], $tag['id']);
+ $page['tag_ids'][] = $tag['id'];
}
$items = get_image_ids_for_tags($page['tag_ids']);
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index f5f136279..4d8a40af8 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -401,7 +401,7 @@ SELECT id
$datas = array();
foreach ( array_from_query($query, 'id') as $id )
{
- array_push($datas, array('element_id'=>$id, 'user_id'=>$user['id']) );
+ $datas[] = array('element_id'=>$id, 'user_id'=>$user['id']);
}
if (count($datas))
{
@@ -793,7 +793,7 @@ SELECT id, path, representative_ext, level
if (isset($image_id) and !in_array($image_id, $image_ids))
{
- array_push($new_image_ids, $image_id);
+ $new_image_ids[] = $image_id;
}
if ($conf['representative_cache_on_level'])
@@ -832,13 +832,10 @@ SELECT id, path, representative_ext
foreach ($user_representative_updates_for as $cat_id => $image_id)
{
- array_push(
- $updates,
- array(
- 'user_id' => $user['id'],
- 'cat_id' => $cat_id,
- 'user_representative_picture_id' => $image_id,
- )
+ $updates[] = array(
+ 'user_id' => $user['id'],
+ 'cat_id' => $cat_id,
+ 'user_representative_picture_id' => $image_id,
);
}
@@ -994,13 +991,13 @@ SELECT DISTINCT image_id
switch ($comment_action)
{
case 'reject':
- array_push($infos, l10n('Your comment has NOT been registered because it did not pass the validation rules') );
+ $infos[] = l10n('Your comment has NOT been registered because it did not pass the validation rules');
return new PwgError(403, implode("; ", $infos) );
case 'validate':
case 'moderate':
$ret = array(
- 'id' => $comm['id'],
- 'validation' => $comment_action=='validate',
+ 'id' => $comm['id'],
+ 'validation' => $comment_action=='validate',
);
return array( 'comment' => new PwgNamedStruct($ret) );
default:
@@ -1071,7 +1068,7 @@ SELECT id, name, permalink, uppercats, global_rank, commentable
)
);
$row['id']=(int)$row['id'];
- array_push($related_categories, $row);
+ $related_categories[] = $row;
}
usort($related_categories, 'global_rank_compare');
if ( empty($related_categories) )
@@ -1544,7 +1541,7 @@ function merge_chunks($output_filepath, $original_sum, $type)
if (preg_match($pattern, $file))
{
ws_logfile($file);
- array_push($chunks, $upload_dir.'/'.$file);
+ $chunks[] = $upload_dir.'/'.$file;
}
}
closedir($handle);
@@ -1601,7 +1598,7 @@ function remove_chunks($original_sum, $type)
{
if (preg_match($pattern, $file))
{
- array_push($chunks, $upload_dir.'/'.$file);
+ $chunks[] = $upload_dir.'/'.$file;
}
}
closedir($handle);
@@ -1958,8 +1955,7 @@ SELECT *
{
foreach ($params['tags'] as $tag_name)
{
- $tag_id = tag_id_from_tag_name($tag_name);
- array_push($tag_ids, $tag_id);
+ $tag_ids[] = tag_id_from_tag_name($tag_name);
}
}
else
@@ -1967,8 +1963,7 @@ SELECT *
$tag_names = preg_split('~(?<!\\\),~', $params['tags']);
foreach ($tag_names as $tag_name)
{
- $tag_id = tag_id_from_tag_name(preg_replace('#\\\\*,#', ',', $tag_name));
- array_push($tag_ids, $tag_id);
+ $tag_ids[] = tag_id_from_tag_name(preg_replace('#\\\\*,#', ',', $tag_name));
}
}
@@ -2662,7 +2657,7 @@ function ws_images_delete($params, $service)
{
if ($image_id > 0)
{
- array_push($image_ids, $image_id);
+ $image_ids[] = $image_id;
}
}
@@ -2694,7 +2689,7 @@ function ws_add_image_category_relations($image_id, $categories_string, $replace
continue;
}
- array_push($cat_ids, $cat_id);
+ $cat_ids[] = $cat_id;
if (!isset($rank))
{
@@ -2803,13 +2798,10 @@ SELECT
foreach ($new_cat_ids as $cat_id)
{
- array_push(
- $inserts,
- array(
- 'image_id' => $image_id,
- 'category_id' => $cat_id,
- 'rank' => $rank_on_category[$cat_id],
- )
+ $inserts[] = array(
+ 'image_id' => $image_id,
+ 'category_id' => $cat_id,
+ 'rank' => $rank_on_category[$cat_id],
);
}
@@ -2995,7 +2987,7 @@ function ws_categories_delete($params, $service)
{
if ($category_id > 0)
{
- array_push($category_ids, $category_id);
+ $category_ids[] = $category_id;
}
}
@@ -3053,7 +3045,7 @@ function ws_categories_move($params, $service)
{
if ($category_id > 0)
{
- array_push($category_ids, $category_id);
+ $category_ids[] = $category_id;
}
}
@@ -3420,7 +3412,7 @@ function ws_extensions_ignoreupdate($params, $service)
// Add or remove extension from ignore list
if (!in_array($params['id'], $conf['updates_ignored'][$params['type']]))
{
- array_push($conf['updates_ignored'][$params['type']], $params['id']);
+ $conf['updates_ignored'][ $params['type'] ][] = $params['id'];
}
conf_update_param('updates_ignored', pwg_db_real_escape_string(serialize($conf['updates_ignored'])));
unset($_SESSION['extensions_need_update']);
diff --git a/include/ws_protocols/rest_encoder.php b/include/ws_protocols/rest_encoder.php
index c02d18222..da493c14e 100644
--- a/include/ws_protocols/rest_encoder.php
+++ b/include/ws_protocols/rest_encoder.php
@@ -66,7 +66,7 @@ class PwgXmlWriter
}
$this->_output( '<'.$name );
$this->_lastTagOpen = true;
- array_push( $this->_elementStack, $name);
+ $this->_elementStack[] = $name;
}
function end_element($x)