diff --git a/build/package.php b/build/package.php
index 7cb30bd493..a0da6404c6 100755
--- a/build/package.php
+++ b/build/package.php
@@ -518,6 +518,14 @@ foreach ($compress_programs as $extension => $compress_command)
$package->run_command('md5sum ./release_files/' . $package->get('release_filename') . '.' . $extension . ' > ./release_files/' . $package->get('release_filename') . '.' . $extension . '.md5');
}
+// Microsoft Web PI packaging
+$package->begin_status('Packaging phpBB for Microsoft WebPI');
+$file = './release_files/' . $package->get('release_filename') . '.webpi.zip';
+$package->run_command("rm -v $file");
+$package->run_command('cp -p ./release_files/' . $package->get('release_filename') . ".zip $file");
+$package->run_command('cd ./../webpi && ' . $compress_programs['zip'] . " ./../new_version/$file *");
+$package->run_command("md5sum $file > $file.md5");
+
// verify results
chdir($package->locations['root']);
$package->begin_status('********** Verifying packages **********');
diff --git a/build/webpi/install/mssql.sql b/build/webpi/install/mssql.sql
new file mode 100644
index 0000000000..9c0b46678a
--- /dev/null
+++ b/build/webpi/install/mssql.sql
@@ -0,0 +1,39 @@
+/**********************************************************************/
+/* Install.SQL */
+/* Creates a login and makes the user a member of db roles */
+/* */
+/**********************************************************************/
+
+-- Declare variables for database name, username and password
+DECLARE @dbName sysname,
+ @dbUser sysname,
+ @dbPwd nvarchar(max);
+
+-- Set variables for database name, username and password
+SET @dbName = 'PlaceHolderForDb';
+SET @dbUser = 'PlaceHolderForUser';
+SET @dbPwd = 'PlaceHolderForPassword';
+
+DECLARE @cmd nvarchar(max)
+
+-- Create login
+IF( SUSER_SID(@dbUser) is null )
+BEGIN
+ print '-- Creating login '
+ SET @cmd = N'CREATE LOGIN ' + quotename(@dbUser) + N' WITH PASSWORD ='''+ replace(@dbPwd, '''', '''''') + N''''
+ EXEC(@cmd)
+END
+
+-- Create database user and map to login
+-- and add user to the datareader, datawriter, ddladmin and securityadmin roles
+--
+SET @cmd = N'USE ' + quotename(@DBName) + N';
+IF( NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = ''' + replace(@dbUser, '''', '''''') + N'''))
+BEGIN
+ print ''-- Creating user'';
+ CREATE USER ' + quotename(@dbUser) + N' FOR LOGIN ' + quotename(@dbUser) + N';
+ print ''-- Adding user'';
+ EXEC sp_addrolemember ''db_owner'', ''' + replace(@dbUser, '''', '''''') + N''';
+END'
+EXEC(@cmd)
+GO
diff --git a/build/webpi/install/mysql.sql b/build/webpi/install/mysql.sql
new file mode 100644
index 0000000000..5c9d8cd922
--- /dev/null
+++ b/build/webpi/install/mysql.sql
@@ -0,0 +1,15 @@
+USE PlaceHolderForDb$$
+
+DROP PROCEDURE IF EXISTS add_user $$
+
+CREATE PROCEDURE add_user()
+BEGIN
+DECLARE EXIT HANDLER FOR 1044 BEGIN END;
+GRANT ALL PRIVILEGES ON PlaceHolderForDb.* to 'PlaceHolderForUser'@'PlaceHolderForServer' IDENTIFIED BY 'PlaceHolderForPassword';
+FLUSH PRIVILEGES;
+END
+$$
+
+CALL add_user() $$
+
+DROP PROCEDURE IF EXISTS add_user $$
diff --git a/build/webpi/manifest.xml b/build/webpi/manifest.xml
new file mode 100644
index 0000000000..947377893b
--- /dev/null
+++ b/build/webpi/manifest.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/build/webpi/parameters.xml b/build/webpi/parameters.xml
new file mode 100644
index 0000000000..770cabf95b
--- /dev/null
+++ b/build/webpi/parameters.xml
@@ -0,0 +1,226 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit
index 23ab8d6cdb..9719b91746 100755
--- a/git-tools/hooks/pre-commit
+++ b/git-tools/hooks/pre-commit
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
#
# A hook to disallow php syntax errors to be committed
# by running php -l (lint) on them. It requires php-cli
@@ -27,7 +27,10 @@ fi
error=0
errors=""
-IFS=$'\n'
+# dash does not support $'\n':
+# http://forum.soft32.com/linux2/Bug-409179-DASH-Settings-IFS-work-properly-ftopict70039.html
+IFS='
+'
# get a list of staged files
for line in $(git diff-index --cached --full-index $against)
do
@@ -59,7 +62,7 @@ do
then
error=1
# Swap back in correct filenames
- errors+=${result//in - on/"$filename"}
+ errors=$(echo "$errors"; echo "$result" |sed -e "s@in - on@in $filename on@g")
fi
done
unset IFS