diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000000..e536a561ff --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,139 @@ +build: false +clone_folder: c:\projects\phpbb +version: '{build}' + +services: + - iis + +environment: + matrix: + - db: mssql + db_version: sql2012sp1 + php: 7.0 + - db: mssql + db_version: sql2014 + php: 7.0 + - db: mssql + db_version: sql2016 + php: 7.0 + - db: mssql + db_version: sql2017 + php: 7.1 +# - db: mariadb +# php: 7.1 +# - db: mysqli +# php: 7.1 +# - db: sqlite +# php: 7.1 +# - db: postgresql +# php: 7.1 + +hosts: + phpbb.test: 127.0.0.1 + +init: + - SET PATH=%systemroot%\system32\inetsrv\;C:\Program Files\OpenSSL;C:\tools\php;c:\php;%PATH% + - SET ANSICON=121x90 (121x90) + - REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f + +before_test: + - ps: | + Set-Service wuauserv -StartupType Manual + cinst -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') + Get-ChildItem -Path "c:\tools\php$($env:php -replace '[.]','')" -Recurse | + Move-Item -destination "c:\tools\php" + cd c:\tools\php + cat php.ini-production | %{$_ -replace "memory_limit = 128M","memory_limit = 1024M"} | Out-File -Encoding "Default" php.ini + Add-Content php.ini "`n date.timezone=UTC" + Add-Content php.ini "`n display_errors=On" + Add-Content php.ini "`n extension_dir=ext" + Add-Content php.ini "`n extension=php_openssl.dll" + Add-Content php.ini "`n extension=php_mbstring.dll" + Add-Content php.ini "`n extension=php_curl.dll" + Add-Content php.ini "`n extension=php_gd2.dll" + Add-Content php.ini "`n extension=php_tidy.dll" + Add-Content php.ini "`n extension=php_fileinfo.dll" + Add-Content php.ini "`n extension=php_pdo_sqlite.dll" + Add-Content php.ini "`n extension=php_sqlite3.dll" + Add-Content php.ini "`n extension=php_pdo_mysql.dll" + Add-Content php.ini "`n extension=php_mysqli.dll" + Add-Content php.ini "`n extension=php_pdo_pgsql.dll" + Add-Content php.ini "`n extension=php_pgsql.dll" + + # Get MSSQL driver + if ($env:db -eq "mssql") { + cd c:\tools\php\ext + $DLLVersion = "4.1.6.1" + appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/sqlsrv/$($:DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip + 7z x -y php_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip > $null + appveyor-retry appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip + 7z x -y php_pdo_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip > $null + Remove-Item c:\tools\php\* -include .zip + cd c:\tools\php + Add-Content php.ini "`nextension=php_sqlsrv.dll" + Add-Content php.ini "`nextension=php_pdo_sqlsrv.dll" + Add-Content php.ini "`n" + + $instanceName = $env:db_version.ToUpper() + Start-Service "MSSQL`$$instanceName" + Set-Variable -Name "sqlServerPath" -Value "(local)\$($env:db_version.ToUpper())" + + # Create database write test config + sqlcmd -S $sqlServerPath -Q "Use [master]; CREATE DATABASE [phpbb_test] COLLATE Latin1_General_CI_AS" + $data = "verbose = $verbose; // Get last two entries - $_latest = $this->versions[sizeof($this->versions) - 1]; - $_before = $this->versions[sizeof($this->versions) - 2]; + $_latest = $this->versions[count($this->versions) - 1]; + $_before = $this->versions[count($this->versions) - 2]; $this->locations = array( 'new_version' => dirname(dirname(__FILE__)) . '/phpBB/', diff --git a/build/package.php b/build/package.php index 178a27faad..18798d0602 100755 --- a/build/package.php +++ b/build/package.php @@ -33,7 +33,7 @@ echo "Now all three package types (patch, files, release) are built as well as t // Go trough all versions making a diff if we even have old versions // For phpBB 3.0.x we might choose a different update method, rendering the things below useless... -if (sizeof($package->old_packages)) +if (count($package->old_packages)) { chdir($package->locations['old_versions']); @@ -76,7 +76,7 @@ if (sizeof($package->old_packages)) // Create Directories along the way? $file = explode('/', $file); // Remove filename portion - $file[sizeof($file)-1] = ''; + $file[count($file)-1] = ''; chdir($dest_filename_dir); foreach ($file as $entry) @@ -169,7 +169,7 @@ if (sizeof($package->old_packages)) // Create Directories along the way? $file = explode('/', $file); // Remove filename portion - $file[sizeof($file)-1] = ''; + $file[count($file)-1] = ''; chdir($dest_filename_dir . '/install/update/old'); foreach ($file as $entry) @@ -214,7 +214,7 @@ if (sizeof($package->old_packages)) // Create Directories along the way? $file = explode('/', $file); // Remove filename portion - $file[sizeof($file)-1] = ''; + $file[count($file)-1] = ''; chdir($dest_filename_dir . '/install/update/new'); foreach ($file as $entry) @@ -321,7 +321,7 @@ $update_info = array( \'version\' => array(\'from\' => \'' . str_replace('_to_', '', $package->old_packages[$_package_name]) . '\', \'to\' => \'' . $package->get('new_version_number') . '\'), '; - if (sizeof($file_contents['all'])) + if (count($file_contents['all'])) { $index_contents .= "\t'files' => array(\n\t\t'" . implode("',\n\t\t'", $file_contents['all']) . "',\n\t),\n"; } @@ -330,7 +330,7 @@ $update_info = array( $index_contents .= "\t'files' => array(),\n"; } - if (sizeof($file_contents['binary'])) + if (count($file_contents['binary'])) { $index_contents .= "\t'binary' => array(\n\t\t'" . implode("',\n\t\t'", $file_contents['binary']) . "',\n\t),\n"; } @@ -339,7 +339,7 @@ $update_info = array( $index_contents .= "\t'binary' => array(),\n"; } - if (sizeof($file_contents['deleted'])) + if (count($file_contents['deleted'])) { $index_contents .= "\t'deleted' => array(\n\t\t'" . implode("',\n\t\t'", $file_contents['deleted']) . "',\n\t),\n"; } @@ -380,7 +380,7 @@ $compress_programs = array( 'zip' => 'zip -r' ); -if (sizeof($package->old_packages)) +if (count($package->old_packages)) { // Build Patch Files chdir($package->get('patch_directory')); diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php index c575729d91..d7308a1acc 100644 --- a/phpBB/develop/add_permissions.php +++ b/phpBB/develop/add_permissions.php @@ -185,7 +185,7 @@ while ($row = $db->sql_fetchrow($result)) } $db->sql_freeresult($result); -if (sizeof($remove_auth_options)) +if (count($remove_auth_options)) { $db->sql_query('DELETE FROM ' . ACL_USERS_TABLE . ' WHERE auth_option_id IN (' . implode(', ', $remove_auth_options) . ')'); $db->sql_query('DELETE FROM ' . ACL_GROUPS_TABLE . ' WHERE auth_option_id IN (' . implode(', ', $remove_auth_options) . ')'); @@ -199,7 +199,7 @@ $prefixes = array('f_', 'a_', 'm_', 'u_'); foreach ($prefixes as $prefix) { $var = $prefix . 'permissions'; - if (sizeof(${$var})) + if (count(${$var})) { foreach (${$var} as $auth_option => $l_ary) { diff --git a/phpBB/develop/check_flash_bbcodes.php b/phpBB/develop/check_flash_bbcodes.php index 5dc112bfc0..282adad229 100644 --- a/phpBB/develop/check_flash_bbcodes.php +++ b/phpBB/develop/check_flash_bbcodes.php @@ -51,7 +51,7 @@ function check_table_flash_bbcodes($table_name, $id_field, $content_field, $uid_ $ids = get_table_flash_bbcode_pkids($table_name, $id_field, $content_field, $uid_field, $bitfield_field); - $size = sizeof($ids); + $size = count($ids); if ($size) { echo "Found $size potentially dangerous flash bbcodes.\n"; diff --git a/phpBB/develop/create_variable_overview.php b/phpBB/develop/create_variable_overview.php index ace2e4d953..da9a4fe683 100644 --- a/phpBB/develop/create_variable_overview.php +++ b/phpBB/develop/create_variable_overview.php @@ -489,12 +489,12 @@ foreach ($lang_references as $lang_var => $filenames) $html_data .= '' . $lang_var . '