ChangeSet ID: 30240 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner@winehq.org 2006/12/02 13:44:31
Modified files: include : config.php.sample mail.php unit_test : run_tests.php
Log message: Chris Morgan cmorgan@alum.wpi.edu Unit tests should disable sending email before they execute, we don't want any accidental emails sent when developers are running the unit tests to verify functionality. Add commented out example code that will enable developers to disable email via a define in include/config.php
Patch: http://cvs.winehq.org/patch.py?id=30240
Old revision New revision Changes Path 1.12 1.13 +3 -0 appdb/include/config.php.sample 1.6 1.7 +5 -0 appdb/include/mail.php 1.7 1.8 +4 -0 appdb/unit_test/run_tests.php
Index: appdb/include/config.php.sample diff -u -p appdb/include/config.php.sample:1.12 appdb/include/config.php.sample:1.13 --- appdb/include/config.php.sample:1.12 2 Dec 2006 19:44:31 -0000 +++ appdb/include/config.php.sample 2 Dec 2006 19:44:31 -0000 @@ -19,6 +19,9 @@ define("APPDB_OWNER_URL","http://www.win define("APPDB_OWNER_EMAIL","appdb@winehq.org"); // e-mail of this product/company define("BUGZILLA_ROOT","http://bugs.winehq.org/"); // path to bugzilla
+// AppDB developers: Use this define to disable email from being sent from the appdb during testing +//if(!defined("DISABLE_EMAIL")) +// define("DISABLE_EMAIL", true); // disable email, see mail_appdb() in include/mail.php
/* * apps database info Index: appdb/include/mail.php diff -u -p appdb/include/mail.php:1.6 appdb/include/mail.php:1.7 --- appdb/include/mail.php:1.6 2 Dec 2006 19:44:31 -0000 +++ appdb/include/mail.php 2 Dec 2006 19:44:31 -0000 @@ -3,6 +3,11 @@ require_once(BASE."include/config.php");
function mail_appdb($sEmailList,$sSubject,$sMsg) { + // NOTE: For AppDB developers: If email is disabled return from this function + // immediately. See include/config.php.sample for information + if(defined("DISABLE_EMAIL")) + return; + $sHeaders = "MIME-Version: 1.0\r\n"; $sHeaders .= "From: AppDB <".APPDB_OWNER_EMAIL.">\r\n"; $sHeaders .= "Reply-to: AppDB <".APPDB_OWNER_EMAIL.">\r\n"; Index: appdb/unit_test/run_tests.php diff -u -p appdb/unit_test/run_tests.php:1.7 appdb/unit_test/run_tests.php:1.8 --- appdb/unit_test/run_tests.php:1.7 2 Dec 2006 19:44:31 -0000 +++ appdb/unit_test/run_tests.php 2 Dec 2006 19:44:31 -0000 @@ -7,6 +7,10 @@
error_reporting(E_ALL);
+// disable emailing +if(!defined("DISABLE_EMAIL")) + define("DISABLE_EMAIL", true); + include_once("test_user.php"); echo "\n"; include_once("test_query.php");