aboutsummaryrefslogtreecommitdiffstats
path: root/install.php
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 /install.php
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 'install.php')
-rw-r--r--install.php50
1 files changed, 27 insertions, 23 deletions
diff --git a/install.php b/install.php
index d1a6f88ea..e41498cbb 100644
--- a/install.php
+++ b/install.php
@@ -252,25 +252,35 @@ include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$dblayer.'.inc.php');
include(PHPWG_ROOT_PATH . 'admin/include/functions_install.inc.php');
include(PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php');
-if ( isset( $_POST['install'] ))
+if (isset($_POST['install']))
{
install_db_connect($infos, $errors);
pwg_db_check_charset();
- $webmaster = trim(preg_replace( '/\s{2,}/', ' ', $admin_name ));
- if ( empty($webmaster))
- array_push( $errors, l10n('enter a login for webmaster') );
- else if ( preg_match( '/[\'"]/', $webmaster ) )
- array_push( $errors, l10n('webmaster login can\'t contain characters \' or "') );
- if ( $admin_pass1 != $admin_pass2 || empty($admin_pass1) )
- array_push( $errors, l10n('please enter your password again') );
- if ( empty($admin_mail))
- array_push( $errors, l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)') );
+ $webmaster = trim(preg_replace('/\s{2,}/', ' ', $admin_name));
+ if (empty($webmaster))
+ {
+ $errors[] = l10n('enter a login for webmaster');
+ }
+ else if (preg_match( '/[\'"]/', $webmaster))
+ {
+ $errors[] = l10n('webmaster login can\'t contain characters \' or "');
+ }
+ if ($admin_pass1 != $admin_pass2 || empty($admin_pass1))
+ {
+ $errors[] = l10n('please enter your password again');
+ }
+ if (empty($admin_mail))
+ {
+ $errors[] = l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)');
+ }
else
{
$error_mail_address = validate_mail_address(null, $admin_mail);
if (!empty($error_mail_address))
- array_push( $errors, $error_mail_address );
+ {
+ $errors[] = $error_mail_address;
+ }
}
if ( count( $errors ) == 0 )
@@ -388,13 +398,10 @@ INSERT INTO '.$prefixeTable.'config (param,value,comment)
$datas = array();
foreach (get_available_upgrade_ids() as $upgrade_id)
{
- array_push(
- $datas,
- array(
- 'id' => $upgrade_id,
- 'applied' => CURRENT_DATE,
- 'description' => 'upgrade included in installation',
- )
+ $datas[] = array(
+ 'id' => $upgrade_id,
+ 'applied' => CURRENT_DATE,
+ 'description' => 'upgrade included in installation',
);
}
mass_inserts(
@@ -449,14 +456,11 @@ if ($step == 1)
}
else
{
- array_push(
- $infos,
- l10n('Congratulations, Piwigo installation is completed')
- );
+ $infos[] = l10n('Congratulations, Piwigo installation is completed');
if (isset($error_copy))
{
- array_push($errors, $error_copy);
+ $errors[] = $error_copy;
}
else
{