svn: /php/php-benchmarks/trunk/benchweb/installers/phpbb/ bench/benchmark.php benchmark.php phpbb-3.0.5.patch setup.php

From: Date: Fri, 14 Aug 2009 09:54:52 +0000
Subject: svn: /php/php-benchmarks/trunk/benchweb/installers/phpbb/ bench/benchmark.php benchmark.php phpbb-3.0.5.patch setup.php
Groups: php.qa 
Request: Send a blank email to php-qa+get-65286@lists.php.net to get a copy of this message
hjalle Fri, 14 Aug 2009 09:54:52 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=287282 Log: Removes phpBB from the repository and modifies the setup to download the software from a mirror (ohloh.net) instead and the changes to phpBB are set via a patch. Changed paths: U php/php-benchmarks/trunk/benchweb/installers/phpbb/bench/benchmark.php U php/php-benchmarks/trunk/benchweb/installers/phpbb/benchmark.php D php/php-benchmarks/trunk/benchweb/installers/phpbb/phpBB3/ A php/php-benchmarks/trunk/benchweb/installers/phpbb/phpbb-3.0.5.patch U php/php-benchmarks/trunk/benchweb/installers/phpbb/setup.php Modified: php/php-benchmarks/trunk/benchweb/installers/phpbb/bench/benchmark.php =================================================================== --- php/php-benchmarks/trunk/benchweb/installers/phpbb/bench/benchmark.php 2009-08-14 09:48:28 UTC (rev 287281) +++ php/php-benchmarks/trunk/benchweb/installers/phpbb/bench/benchmark.php 2009-08-14 09:54:52 UTC (rev 287282) @@ -31,6 +31,7 @@ $VERBOSE = TRUE; while($x < $tot_rec) { $cur = num_childs(); + usleep(200); if ($cur < $concurrency) { $pid = pcntl_fork(); Modified: php/php-benchmarks/trunk/benchweb/installers/phpbb/benchmark.php =================================================================== --- php/php-benchmarks/trunk/benchweb/installers/phpbb/benchmark.php 2009-08-14 09:48:28 UTC (rev 287281) +++ php/php-benchmarks/trunk/benchweb/installers/phpbb/benchmark.php 2009-08-14 09:54:52 UTC (rev 287282) @@ -1,7 +1,7 @@ <?php $file_ips = "../../ips.txt"; -require "../../functions.php"; +require "../../config.php"; $server = unserialize(file_get_contents($file_ips)); if ($argc != 3) { @@ -12,7 +12,7 @@ } echo "Benchmark has started\n"; echo "*********************\n"; -passthru("ssh -f -oUserKnownHostsFile=/home/phpappbench/known_hosts -oStrictHostKeyChecking=no root@192.168.0.151 \"php /home/bench/benchmark.php $argv[1] $argv[2]\""); +passthru("ssh -f -oUserKnownHostsFile={$HOME_DIR}known_hosts -oStrictHostKeyChecking=no root@192.168.0.151 \"php /home/bench/benchmark.php $argv[1] $argv[2]\""); echo "*********************\n"; echo "Benchmark has ended\n"; ?> Added: php/php-benchmarks/trunk/benchweb/installers/phpbb/phpbb-3.0.5.patch =================================================================== --- php/php-benchmarks/trunk/benchweb/installers/phpbb/phpbb-3.0.5.patch (rev 0) +++ php/php-benchmarks/trunk/benchweb/installers/phpbb/phpbb-3.0.5.patch 2009-08-14 09:54:52 UTC (rev 287282) @@ -0,0 +1,82 @@ +diff -uNr phpBB3/configdef.php phpBB3-mod/configdef.php +--- phpBB3/configdef.php 1969-12-31 18:00:00.000000000 -0600 ++++ phpBB3-mod/configdef.php 2009-08-14 03:52:49.000000000 -0500 +@@ -0,0 +1,17 @@ ++<?php ++ ++// Configuration file for PHPBB3 ++ ++$dbms = 'mysqli'; ++$dbhost = 'sqlhost'; ++$dbport = ''; ++$dbname = 'sqldb'; ++$dbuser = 'sqluser'; ++$dbpasswd = 'sqlpass'; ++$table_prefix = 'phpbb_'; ++$acm_type = 'file'; ++$load_extensions = ''; ++ ++@define('PHPBB_INSTALLED',true); ++ ++?> +diff -uNr phpBB3/includes/functions.php phpBB3-mod/includes/functions.php +--- phpBB3/includes/functions.php 2009-05-31 05:58:58.000000000 -0500 ++++ phpBB3-mod/includes/functions.php 2009-08-14 03:52:49.000000000 -0500 +@@ -2377,7 +2377,7 @@ + $creation_time = abs(request_var('creation_time', 0)); + $token = request_var('form_token', ''); + +- $diff = time() - $creation_time; ++ $diff = time() + 2 - $creation_time; + + // If creation_time and the time() now is zero we can assume it was not a human doing this (the check for if ($diff)... + if ($diff && ($diff <= $timespan || $timespan === -1)) +@@ -3985,4 +3985,4 @@ + return; + } + +-?> +\ No newline at end of file ++?> +diff -uNr phpBB3/install.php phpBB3-mod/install.php +--- phpBB3/install.php 1969-12-31 18:00:00.000000000 -0600 ++++ phpBB3-mod/install.php 2009-08-14 03:52:48.000000000 -0500 +@@ -0,0 +1,18 @@ ++<?php ++//This file will install phpBB3 to the webserver with an mysql connection ++//to $_GET['db_ip'] along with $_GET['db_name'],$_GET['db_pass'],$_GET['db_user'] ++error_reporting(E_ALL); ++ ++$db_ip = $_GET['db_ip']; ++$db_name = $_GET['db_name']; ++$db_pass = $_GET['db_pass']; ++$db_user = $_GET['db_user']; ++$hostname = $_SERVER['SERVER_ADDR']; ++$data = file_get_contents("configdef.php"); ++$data = str_replace("sqlhost",$db_ip,$data); ++$data = str_replace("sqldb",$db_name,$data); ++$data = str_replace("sqluser",$db_user,$data); ++$data = str_replace("sqlpass",$db_pass,$data); ++$data = str_replace("domain",$hostname,$data); ++file_put_contents("config.php",$data); ++?> +diff -uNr phpBB3/posting.php phpBB3-mod/posting.php +--- phpBB3/posting.php 2009-05-31 05:58:57.000000000 -0500 ++++ phpBB3-mod/posting.php 2009-08-14 03:52:48.000000000 -0500 +@@ -47,7 +47,8 @@ + + + // Was cancel pressed? If so then redirect to the appropriate page +-if ($cancel || ($current_time - $lastclick < 2 && $submit)) ++//if ($cancel || ($current_time - $lastclick < 2 && $submit)) ++if($cancel) //Hard to bench otherwise + { + $f = ($forum_id) ? 'f=' . $forum_id . '&amp;' : ''; + $redirect = ($post_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $f . 'p=' . $post_id) . '#p' . $post_id : (($topic_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $f . 't=' . $topic_id) : (($forum_id) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) : append_sid("{$phpbb_root_path}index.$phpEx"))); +@@ -1501,4 +1502,4 @@ + trigger_error('USER_CANNOT_DELETE'); + } + +-?> +\ No newline at end of file ++?> Modified: php/php-benchmarks/trunk/benchweb/installers/phpbb/setup.php =================================================================== --- php/php-benchmarks/trunk/benchweb/installers/phpbb/setup.php 2009-08-14 09:48:28 UTC (rev 287281) +++ php/php-benchmarks/trunk/benchweb/installers/phpbb/setup.php 2009-08-14 09:54:52 UTC (rev 287282) @@ -3,6 +3,20 @@ $dir = "phpBB3"; require "../../config.php"; +//Download phpBB3 +shell_exec("wget http://d10xg45o6p6dbl.cloudfront.net/projects/p/phpbb/phpBB-3.0.5.tar.bz2"); + +if (!file_exists("phpBB-3.0.5.tar.bz2")) { + die("Error downloading phpBB3. Check for another download source"); +} else { +shell_exec("tar -jxvf phpBB-3.0.5.tar.bz2"); + +//Remove the install directory so it doesn't disturb +shell_exec("rm -r phpBB3/install"); +} +//Apply the patch that modifies the needed files +shell_exec("patch -p1 -d phpBB3 < phpbb-3.0.5.patch "); + //Let's upload the directory to the www-root of the web server. //We then, from the directory, requests the file "install.php" which will //setup the application. As an argument, we send the database ip.

« previous php.qa (#65286) next »