Commit: c02b488ca09b5f896be5278c86988de0821c9681 Author: Matt Ficken <v-maf...@microsoft.com> Tue, 1 Jan 2013 21:07:55 -0800 Parents: b2ebf385f0613cd92ec2b1e73a43c0a03afebbcf Branches: master
Link: http://git.php.net/?p=pftt2.git;a=commitdiff;h=c02b488ca09b5f896be5278c86988de0821c9681 Log: scenario changes Former-commit-id: a7e6afbe5189f9b21c9f975ff566f47e57452cce Changed paths: A app/appleseedproj-appleseed-faf8b52.zip A app/atrium-1-1.zip A app/limesurvey200plus-build121220.zip.REMOVED.git-id A app/moodle-2.4.zip.REMOVED.git-id A app/phpMyAdmin-3.4.9-all-languages.zip A app/phpPgAdmin-5.0.3.zip A app/phpTickets-1_1_0.zip A conf/app/appleseed.groovy D conf/app/eyeos.groovy A conf/app/hello_world.groovy A conf/app/lime_survey.groovy A conf/app/moodle.groovy A conf/app/open_atrium.groovy A conf/app/phpmyadmin.groovy A conf/app/phppgadmin.groovy A conf/app/phptickets.groovy A conf/app/xos.groovy M src/com/mostc/pftt/host/Host.java M src/com/mostc/pftt/main/PfttMain.java M src/com/mostc/pftt/model/phpt/PhpDebugPack.java M src/com/mostc/pftt/results/ConsoleManager.java M src/com/mostc/pftt/runner/PhptTestPackRunner.java M src/com/mostc/pftt/scenario/AbstractFileSystemScenario.java M src/com/mostc/pftt/scenario/AbstractINIScenario.java M src/com/mostc/pftt/scenario/AbstractSAPIScenario.java M src/com/mostc/pftt/scenario/AbstractWebServerScenario.java A src/com/mostc/pftt/scenario/AppleseedScenario.java A src/com/mostc/pftt/scenario/DrupalScenario.groovy D src/com/mostc/pftt/scenario/DrupalScenario.java A src/com/mostc/pftt/scenario/HelloWorldScenario.groovy A src/com/mostc/pftt/scenario/JoomlaScenario.groovy D src/com/mostc/pftt/scenario/JoomlaScenario.java A src/com/mostc/pftt/scenario/LimeSurveyScenario.java A src/com/mostc/pftt/scenario/MoodleScenario.java A src/com/mostc/pftt/scenario/OpenAtriumScenario.java A src/com/mostc/pftt/scenario/PhpMyAdminScenario.java A src/com/mostc/pftt/scenario/PhpPgAdminScenario.java A src/com/mostc/pftt/scenario/PhpTicketsScenario.java A src/com/mostc/pftt/scenario/PliggScenario.groovy D src/com/mostc/pftt/scenario/PliggScenario.java M src/com/mostc/pftt/scenario/ScenarioSet.java A src/com/mostc/pftt/scenario/SquirrelMailScenario.groovy D src/com/mostc/pftt/scenario/SquirrelMailScenario.java A src/com/mostc/pftt/scenario/WordpressScenario.groovy D src/com/mostc/pftt/scenario/WordpressScenario.java M src/com/mostc/pftt/scenario/ZipApplication.java M src/com/mostc/pftt/util/DebuggerManager.java M src/com/mostc/pftt/util/WindowsSnapshotDownloadUtil.groovy
diff --git a/app/appleseedproj-appleseed-faf8b52.zip b/app/appleseedproj-appleseed-faf8b52.zip new file mode 100644 index 0000000..275de81 Binary files /dev/null and b/app/appleseedproj-appleseed-faf8b52.zip differ diff --git a/app/atrium-1-1.zip b/app/atrium-1-1.zip new file mode 100644 index 0000000..aa35b0f Binary files /dev/null and b/app/atrium-1-1.zip differ diff --git a/app/limesurvey200plus-build121220.zip.REMOVED.git-id b/app/limesurvey200plus-build121220.zip.REMOVED.git-id new file mode 100644 index 0000000..6eacc2e --- /dev/null +++ b/app/limesurvey200plus-build121220.zip.REMOVED.git-id @@ -0,0 +1 @@ +0c7fadba6cc53e0f5685895367aa9fbbfc7eef67 \ No newline at end of file diff --git a/app/moodle-2.4.zip.REMOVED.git-id b/app/moodle-2.4.zip.REMOVED.git-id new file mode 100644 index 0000000..f61e54e --- /dev/null +++ b/app/moodle-2.4.zip.REMOVED.git-id @@ -0,0 +1 @@ +e8726441d4f4e9a77301ea09157e8d1f76fa552b \ No newline at end of file diff --git a/app/phpMyAdmin-3.4.9-all-languages.zip b/app/phpMyAdmin-3.4.9-all-languages.zip new file mode 100644 index 0000000..a86f465 Binary files /dev/null and b/app/phpMyAdmin-3.4.9-all-languages.zip differ diff --git a/app/phpPgAdmin-5.0.3.zip b/app/phpPgAdmin-5.0.3.zip new file mode 100644 index 0000000..a6cd100 Binary files /dev/null and b/app/phpPgAdmin-5.0.3.zip differ diff --git a/app/phpTickets-1_1_0.zip b/app/phpTickets-1_1_0.zip new file mode 100644 index 0000000..7e87667 Binary files /dev/null and b/app/phpTickets-1_1_0.zip differ diff --git a/conf/app/appleseed.groovy b/conf/app/appleseed.groovy new file mode 100644 index 0000000..a495676 --- /dev/null +++ b/conf/app/appleseed.groovy @@ -0,0 +1,4 @@ + +def scenarios() { + [new AppleseedScenario()] +} diff --git a/conf/app/eyeos.groovy b/conf/app/eyeos.groovy deleted file mode 100644 index 0ef17ab..0000000 --- a/conf/app/eyeos.groovy +++ /dev/null @@ -1,4 +0,0 @@ - -def scenarios() { - [new EyeOSScenario()] -} diff --git a/conf/app/hello_world.groovy b/conf/app/hello_world.groovy new file mode 100644 index 0000000..a3dec39 --- /dev/null +++ b/conf/app/hello_world.groovy @@ -0,0 +1,4 @@ + +def scenarios() { + [new HelloWorldScenario()] +} diff --git a/conf/app/lime_survey.groovy b/conf/app/lime_survey.groovy new file mode 100644 index 0000000..7aa3b6f --- /dev/null +++ b/conf/app/lime_survey.groovy @@ -0,0 +1,4 @@ + +def scenarios() { + [new LimeSurveyScenario()] +} diff --git a/conf/app/moodle.groovy b/conf/app/moodle.groovy new file mode 100644 index 0000000..cffb5a7 --- /dev/null +++ b/conf/app/moodle.groovy @@ -0,0 +1,4 @@ + +def scenarios() { + [new MoodleScenario()] +} diff --git a/conf/app/open_atrium.groovy b/conf/app/open_atrium.groovy new file mode 100644 index 0000000..7d185c4 --- /dev/null +++ b/conf/app/open_atrium.groovy @@ -0,0 +1,4 @@ + +def scenarios() { + [new OpenAtriumScenario()] +} diff --git a/conf/app/phpmyadmin.groovy b/conf/app/phpmyadmin.groovy new file mode 100644 index 0000000..8735645 --- /dev/null +++ b/conf/app/phpmyadmin.groovy @@ -0,0 +1,4 @@ + +def scenarios() { + [new PhpMyAdminScenario()] +} diff --git a/conf/app/phppgadmin.groovy b/conf/app/phppgadmin.groovy new file mode 100644 index 0000000..6c9ef24 --- /dev/null +++ b/conf/app/phppgadmin.groovy @@ -0,0 +1,4 @@ + +def scenarios() { + [new PhpPgAdminScenario()] +} diff --git a/conf/app/phptickets.groovy b/conf/app/phptickets.groovy new file mode 100644 index 0000000..604d1dc --- /dev/null +++ b/conf/app/phptickets.groovy @@ -0,0 +1,4 @@ + +def scenarios() { + [new PhpTicketsScenario()] +} diff --git a/conf/app/xos.groovy b/conf/app/xos.groovy new file mode 100644 index 0000000..7d11ec7 --- /dev/null +++ b/conf/app/xos.groovy @@ -0,0 +1,4 @@ + +def scenarios() { + [new XOSScenario()] +} diff --git a/src/com/mostc/pftt/host/Host.java b/src/com/mostc/pftt/host/Host.java index 552715d..0467530 100644 --- a/src/com/mostc/pftt/host/Host.java +++ b/src/com/mostc/pftt/host/Host.java @@ -890,21 +890,27 @@ public abstract class Host { /** unzips .ZIP file into base_dir * + * @param cm * @param zip_file * @param base_dir * @return */ - public boolean unzip(String zip_file, String base_dir) { - mkdirs(base_dir); - return exec("unzip "+zip_file+" "+base_dir, ONE_HOUR).isSuccess(); - } - public boolean unzip(ConsoleManager cm, String zip_file, String base_dir) { - if (unzip(zip_file, base_dir)) - return true; - cm.println(getClass(), "Unable to unzip: "+zip_file); + try { + mkdirs(base_dir); + if (exec("unzip "+zip_file+" "+base_dir, ONE_HOUR).isSuccess()) + return true; + else + cm.println(getClass(), "Unable to unzip: "+zip_file); + } catch ( Exception ex ) { + cm.printStackTrace(ex); + } return false; } + + public boolean unzip(String zip_file, String base_dir) { + return unzip(null, zip_file, base_dir); + } /** ensures that name is unique by adding a number to the end of it if * it already exists... returns unqiue name. diff --git a/src/com/mostc/pftt/main/PfttMain.java b/src/com/mostc/pftt/main/PfttMain.java index 25f5bc1..4595de8 100644 --- a/src/com/mostc/pftt/main/PfttMain.java +++ b/src/com/mostc/pftt/main/PfttMain.java @@ -41,6 +41,7 @@ import com.mostc.pftt.results.PhptResultPackReader; import com.mostc.pftt.results.PhptResultPackWriter; import com.mostc.pftt.runner.PhpUnitTestPackRunner; import com.mostc.pftt.runner.PhptTestPackRunner; +import com.mostc.pftt.scenario.AbstractSAPIScenario; import com.mostc.pftt.scenario.Scenario; import com.mostc.pftt.scenario.ScenarioSet; import com.mostc.pftt.util.DownloadUtil; @@ -108,7 +109,7 @@ public class PfttMain { // on Windows, missing .DLLs from a php build will cause a blocking winpop dialog msg to appear // in such a case, the test will timeout after 1 minute and then fail (stopping at that point is important) // @see PhpBuild#getExtensionList - if (test.test(build, cm, host, ScenarioSet.getSAPIScenario(scenario_set).getSAPIType())==ESmokeTestStatus.FAIL) { + if (test.test(build, cm, host, AbstractSAPIScenario.getSAPIScenario(scenario_set).getSAPIType())==ESmokeTestStatus.FAIL) { // if this test fails, RequiredFeaturesSmokeTest will fail for sure cm.println("Main", "Failed smoke test: "+test.getName()); break; @@ -184,7 +185,7 @@ public class PfttMain { // { RequiredExtensionsSmokeTest test = new RequiredExtensionsSmokeTest(); - if (test.test(build, cm, host, ScenarioSet.getSAPIScenario(scenario_set).getSAPIType())==ESmokeTestStatus.FAIL) { + if (test.test(build, cm, host, AbstractSAPIScenario.getSAPIScenario(scenario_set).getSAPIType())==ESmokeTestStatus.FAIL) { cm.println("Main", "Failed smoke test: "+test.getName()); break; } @@ -369,7 +370,7 @@ public class PfttMain { } protected static void cmd_release_get(ConsoleManager cm, boolean force, Host host, URL url) { - download_release_and_decompress(cm, force, true, host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, url), url); + download_release_and_decompress(cm, force, "build", host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, url), url); } protected static void cmd_release_get_previous(ConsoleManager cm, boolean force, Host host, EBuildBranch branch, EBuildType build_type) { @@ -379,8 +380,9 @@ public class PfttMain { System.err.println("PFTT: release_get: unable to find previous build of "+branch+" of type "+build_type); return; } - download_release_and_decompress(cm, force, true, host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getBuild()), find_pair.getBuild()); - download_release_and_decompress(cm, force, false, host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getTest_pack()), find_pair.getTest_pack()); + download_release_and_decompress(cm, force, "build", host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getBuild()), find_pair.getBuild()); + download_release_and_decompress(cm, force, "test-pack", host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getTest_pack()), find_pair.getTest_pack()); + download_release_and_decompress(cm, force, "debug-pack", host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getDebug_pack()), find_pair.getDebug_pack()); } protected static void cmd_release_get_newest(ConsoleManager cm, boolean force, Host host, EBuildBranch branch, EBuildType build_type) { @@ -390,8 +392,9 @@ public class PfttMain { System.err.println("PFTT: release_get: unable to find newest build of "+branch+" of type "+build_type); return; } - download_release_and_decompress(cm, force, true, host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getBuild()), find_pair.getBuild()); - download_release_and_decompress(cm, force, false, host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getTest_pack()), find_pair.getTest_pack()); + download_release_and_decompress(cm, force, "build", host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getBuild()), find_pair.getBuild()); + download_release_and_decompress(cm, force, "test-pack", host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getTest_pack()), find_pair.getTest_pack()); + download_release_and_decompress(cm, force, "debug-pack", host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getDebug_pack()), find_pair.getDebug_pack()); } protected static void cmd_release_get_revision(ConsoleManager cm, boolean force, Host host, EBuildBranch branch, EBuildType build_type, String revision) { @@ -403,9 +406,11 @@ public class PfttMain { } if (find_pair.getBuild()!=null) - download_release_and_decompress(cm, force, true, host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getBuild()), find_pair.getBuild()); + download_release_and_decompress(cm, force, "build", host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getBuild()), find_pair.getBuild()); if (find_pair.getTest_pack()!=null) - download_release_and_decompress(cm, force, false, host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getTest_pack()), find_pair.getTest_pack()); + download_release_and_decompress(cm, force, "test-pack", host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getTest_pack()), find_pair.getTest_pack()); + if (find_pair.getDebug_pack()!=null) + download_release_and_decompress(cm, force, "debug-pack", host, WindowsSnapshotDownloadUtil.snapshotURLtoLocalFile(host, find_pair.getDebug_pack()), find_pair.getDebug_pack()); } protected static boolean confirm(String msg) { @@ -418,7 +423,7 @@ public class PfttMain { } } - protected static void download_release_and_decompress(ConsoleManager cm, boolean force, boolean is_build, Host host, File local_dir, URL url) { + protected static void download_release_and_decompress(ConsoleManager cm, boolean force, String download_type, Host host, File local_dir, URL url) { if (!force && local_dir.exists()) { if (!confirm("Overwrite existing folder "+local_dir+"?")) return; @@ -426,15 +431,9 @@ public class PfttMain { System.out.println("PFTT: release_get: downloading "+url+"..."); if (DownloadUtil.downloadAndUnzip(cm, host, url, local_dir.getAbsolutePath())) { - if (is_build) - cm.println("release_get", "build INSTALLED: "+local_dir); - else - cm.println("release_get", "test-pack INSTALLED: "+local_dir); + cm.println("release_get", download_type+" INSTALLED: "+local_dir); } else { - if (is_build) - cm.println("release_get", "unable to decompress build"); - else - cm.println("release_get", "unable to decompress test-pack"); + cm.println("release_get", "unable to decompress "+download_type); } } // end protected static void download_release_and_decompress @@ -534,12 +533,12 @@ public class PfttMain { return null; // build not found/readable error } - protected static PhptSourceTestPack newTestPack(Host host, String path) { + protected static PhptSourceTestPack newTestPack(ConsoleManager cm, Host host, String path) { PhptSourceTestPack test_pack = new PhptSourceTestPack(path); - if (test_pack.open(host)) + if (test_pack.open(cm, host)) return test_pack; test_pack = new PhptSourceTestPack(host.getPhpSdkDir() + "/" + path); - if (test_pack.open(host)) + if (test_pack.open(cm, host)) return test_pack; else return null; // test-pack not found/readable error @@ -576,7 +575,8 @@ public class PfttMain { Config config = null; boolean is_uac = false, windebug = false, show_gui = false, force = false, disable_debug_prompt = false, results_only = false, dont_cleanup_test_pack = false, phpt_not_in_place = false; - String source_pack = null, debug_pack = null; + String source_pack = null; + PhpDebugPack debug_pack = null; LinkedList<File> config_files = new LinkedList<File>(); int stress_all = 0, stress_each = 0; @@ -690,9 +690,10 @@ public class PfttMain { } else if (args[args_i].equals("-src_pack")) { source_pack = args[args_i++]; } else if (args[args_i].equals("-debug_pack")) { - debug_pack = args[args_i++]; - - PhpDebugPack.open(); + if (null == ( debug_pack = PhpDebugPack.open(rt.host, args[args_i++]))) { + System.err.println("PFTT: debug-pack not found: "+args[args_i-1]); + System.exit(-250); + } } else if (args[args_i].startsWith("-")) { System.err.println("User Error: unknown option "+args[args_i]); @@ -756,7 +757,7 @@ public class PfttMain { return; } - PhptSourceTestPack test_pack = newTestPack(rt.host, args[args_i+2]); + PhptSourceTestPack test_pack = newTestPack(cm, rt.host, args[args_i+2]); if (test_pack==null) { System.err.println("IO Error: can not open php test pack: "+test_pack); System.exit(-255); @@ -794,7 +795,7 @@ public class PfttMain { return; } - PhptSourceTestPack test_pack = newTestPack(rt.host, args[args_i+2]); + PhptSourceTestPack test_pack = newTestPack(cm, rt.host, args[args_i+2]); if (test_pack == null) { System.err.println("IO Error: can not open php test pack: "+test_pack); System.exit(-255); @@ -837,7 +838,7 @@ public class PfttMain { return; } - PhptSourceTestPack test_pack = newTestPack(rt.host, args[args_i+2]); + PhptSourceTestPack test_pack = newTestPack(cm, rt.host, args[args_i+2]); if (test_pack == null) { System.err.println("IO Error: can not open php test pack: "+test_pack); System.exit(-255); diff --git a/src/com/mostc/pftt/model/phpt/PhpDebugPack.java b/src/com/mostc/pftt/model/phpt/PhpDebugPack.java index 483846c..8a6ca68 100644 --- a/src/com/mostc/pftt/model/phpt/PhpDebugPack.java +++ b/src/com/mostc/pftt/model/phpt/PhpDebugPack.java @@ -1,7 +1,30 @@ package com.mostc.pftt.model.phpt; +import com.mostc.pftt.host.Host; import com.mostc.pftt.model.DebugPack; +import com.mostc.pftt.util.StringUtil; public class PhpDebugPack extends DebugPack { + protected final String path; + + protected PhpDebugPack(String path) { + this.path = path; + } + + public String getPath() { + return path; + } -} + public static PhpDebugPack open(Host host, String path) { + if (StringUtil.endsWithIC(path, ".zip")) { + // automatically decompress + String zip_file = path; + path = host.uniqueNameFromBase(Host.removeFileExt(path)); + + if (!host.unzip(zip_file, path)) + return null; + } + return new PhpDebugPack(path); + } + +} // end public class PhpDebugPack diff --git a/src/com/mostc/pftt/results/ConsoleManager.java b/src/com/mostc/pftt/results/ConsoleManager.java index 71588ee..4907d34 100644 --- a/src/com/mostc/pftt/results/ConsoleManager.java +++ b/src/com/mostc/pftt/results/ConsoleManager.java @@ -5,6 +5,7 @@ import java.awt.Container; import javax.swing.JFrame; import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpDebugPack; import com.mostc.pftt.model.phpt.PhptTestCase; import com.mostc.pftt.model.phpt.EPhptTestStatus; import com.mostc.pftt.runner.PhptTestPackRunner; @@ -13,10 +14,11 @@ import com.mostc.pftt.util.ErrorUtil; public class ConsoleManager { protected final boolean force, windebug, results_only, show_gui, disable_debug_prompt, dont_cleanup_test_pack, phpt_not_in_place; - protected String source_pack, debug_pack; + protected String source_pack; + protected PhpDebugPack debug_pack; protected PhptDebuggerFrame gui; - public ConsoleManager(String source_pack, String debug_pack, boolean force, boolean windebug, boolean results_only, boolean show_gui, boolean disable_debug_prompt, boolean dont_cleanup_test_pack, boolean phpt_not_in_place) { + public ConsoleManager(String source_pack, PhpDebugPack debug_pack, boolean force, boolean windebug, boolean results_only, boolean show_gui, boolean disable_debug_prompt, boolean dont_cleanup_test_pack, boolean phpt_not_in_place) { this.source_pack = source_pack; this.debug_pack = debug_pack; this.force = force; @@ -106,7 +108,7 @@ public class ConsoleManager { return phpt_not_in_place; } - public String getDebugPack() { + public PhpDebugPack getDebugPack() { return debug_pack; } diff --git a/src/com/mostc/pftt/runner/PhptTestPackRunner.java b/src/com/mostc/pftt/runner/PhptTestPackRunner.java index 7a57efa..f35eaf2 100644 --- a/src/com/mostc/pftt/runner/PhptTestPackRunner.java +++ b/src/com/mostc/pftt/runner/PhptTestPackRunner.java @@ -89,8 +89,8 @@ public class PhptTestPackRunner extends AbstractTestPackRunner { // runner_state.set(ETestPackRunnerState.RUNNING); - sapi_scenario = ScenarioSet.getSAPIScenario(scenario_set); - file_scenario = ScenarioSet.getFileSystemScenario(scenario_set); + sapi_scenario = AbstractSAPIScenario.getSAPIScenario(scenario_set); + file_scenario = AbstractFileSystemScenario.getFileSystemScenario(scenario_set); // ensure all scenarios are implemented if (!scenario_set.isImplemented()) { diff --git a/src/com/mostc/pftt/scenario/AbstractFileSystemScenario.java b/src/com/mostc/pftt/scenario/AbstractFileSystemScenario.java index dc62346..62d773a 100644 --- a/src/com/mostc/pftt/scenario/AbstractFileSystemScenario.java +++ b/src/com/mostc/pftt/scenario/AbstractFileSystemScenario.java @@ -4,6 +4,11 @@ import com.mostc.pftt.host.Host; import com.mostc.pftt.results.ConsoleManager; public abstract class AbstractFileSystemScenario extends AbstractSerialScenario { + + public static AbstractFileSystemScenario getFileSystemScenario(ScenarioSet scenario_set) { + return scenario_set.getScenario(AbstractFileSystemScenario.class, DEFAULT_FILESYSTEM_SCENARIO); + } + @Override public Class<?> getSerialKey() { return AbstractFileSystemScenario.class; diff --git a/src/com/mostc/pftt/scenario/AbstractINIScenario.java b/src/com/mostc/pftt/scenario/AbstractINIScenario.java index febb0d3..d239834 100644 --- a/src/com/mostc/pftt/scenario/AbstractINIScenario.java +++ b/src/com/mostc/pftt/scenario/AbstractINIScenario.java @@ -21,7 +21,7 @@ public abstract class AbstractINIScenario extends AbstractSerialScenario { @Override public boolean setup(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set) { try { - ESAPIType sapi_type = ScenarioSet.getSAPIScenario(scenario_set).getSAPIType(); + ESAPIType sapi_type = AbstractSAPIScenario.getSAPIScenario(scenario_set).getSAPIType(); PhpIni ini = build.getDefaultPhpIni(host, sapi_type); if (setup(cm, host, build, ini)) { diff --git a/src/com/mostc/pftt/scenario/AbstractSAPIScenario.java b/src/com/mostc/pftt/scenario/AbstractSAPIScenario.java index 14867fe..099e0f3 100644 --- a/src/com/mostc/pftt/scenario/AbstractSAPIScenario.java +++ b/src/com/mostc/pftt/scenario/AbstractSAPIScenario.java @@ -27,6 +27,10 @@ import com.mostc.pftt.runner.PhptTestPackRunner.PhptThread; public abstract class AbstractSAPIScenario extends AbstractSerialScenario { + public static AbstractSAPIScenario getSAPIScenario(ScenarioSet scenario_set) { + return scenario_set.getScenario(AbstractSAPIScenario.class, DEFAULT_SAPI_SCENARIO); + } + @Override public Class<?> getSerialKey() { return AbstractSAPIScenario.class; diff --git a/src/com/mostc/pftt/scenario/AbstractWebServerScenario.java b/src/com/mostc/pftt/scenario/AbstractWebServerScenario.java index 8268c71..b1cbe3d 100644 --- a/src/com/mostc/pftt/scenario/AbstractWebServerScenario.java +++ b/src/com/mostc/pftt/scenario/AbstractWebServerScenario.java @@ -32,6 +32,10 @@ public abstract class AbstractWebServerScenario extends AbstractSAPIScenario { public final WebServerManager smgr; // TODO protected protected final PhptHttpClient http_client; + public static AbstractWebServerScenario getWebServerScenario(ScenarioSet scenario_set) { + return scenario_set.getScenario(AbstractWebServerScenario.class, null); + } + protected AbstractWebServerScenario(WebServerManager smgr) { this.smgr = smgr; diff --git a/src/com/mostc/pftt/scenario/AppleseedScenario.java b/src/com/mostc/pftt/scenario/AppleseedScenario.java new file mode 100644 index 0000000..1606f9a --- /dev/null +++ b/src/com/mostc/pftt/scenario/AppleseedScenario.java @@ -0,0 +1,36 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** The Appleseed Project - The First Open Source+Distributed Social Networking Platform + * + * @see http://github.com/appleseedproj/appleseed/ + * + */ + +public class AppleseedScenario extends ZipDbApplication { + + @Override + protected String getZipAppFileName() { + return "appleseedproj-appleseed-faf8b52.zip"; + } + + @Override + protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getName() { + return "Appleseed"; + } + + @Override + public boolean isImplemented() { + return false; + } + +} diff --git a/src/com/mostc/pftt/scenario/DrupalScenario.groovy b/src/com/mostc/pftt/scenario/DrupalScenario.groovy new file mode 100644 index 0000000..76fad29 --- /dev/null +++ b/src/com/mostc/pftt/scenario/DrupalScenario.groovy @@ -0,0 +1,84 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** A free and open-source content management framework (CMF) written in PHP and distributed under + * the GNU General Public License. It is used as a back-end system for at least 2.1% of + * all websites worldwide ranging from personal blogs to corporate, political, and government + * sites including whitehouse.gov and data.gov.uk. It is also used for knowledge management and + * business collaboration. + * + * @see https://drupal.org/ + * + */ + +public class DrupalScenario extends ZipDbApplication { + + @Override + public String getName() { + return "Drupal"; + } + + @Override + public boolean isImplemented() { + return false; + } + + @Override + protected String getZipAppFileName() { + return "drupal-7.18.zip"; + } + + @Override + protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { + // TODO Auto-generated method stub + + host.open("drupal/web.config"); + def xml = """ +<?xml version="1.0" encoding="UTF-8"?> + <configuration> + <system.webServer> + <!-- Don't show directory listings for URLs which map to a directory. --> + <directoryBrowse enabled="false" /> + <rewrite> + <rules> + <rule name="Protect files and directories from prying eyes" stopProcessing="true"> + <action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." /> + </rule> + <rule name="Force simple error message for requests for non-existent favicon.ico" stopProcessing="true"> + <match url="favicon\\.ico" /> + <action type="CustomResponse" statusCode="404" subStatusCode="1" statusReason="File Not Found" statusDescription="The requested file favicon.ico was not found" /> + </rule> + <!-- Rewrite URLs of the form 'x' to the form 'index.php?q=x'. --> + <rule name="Short URLs" stopProcessing="true"> + <conditions> + <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> + <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> + </conditions> + <action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" /> + </rule> + </rules> + </rewrite> + + <httpErrors> + <remove statusCode="404" subStatusCode="-1" /> + <error statusCode="404" prefixLanguageFilePath="" path="/index.php" responseMode="ExecuteURL" /> + </httpErrors> + + <defaultDocument> + <!-- Set the default document --> + <files> + <remove value="index.php" /> + <add value="index.php" /> + </files> + </defaultDocument> + </system.webServer> + </configuration> +""" + + return false; + } + +} diff --git a/src/com/mostc/pftt/scenario/DrupalScenario.java b/src/com/mostc/pftt/scenario/DrupalScenario.java deleted file mode 100644 index c279ab5..0000000 --- a/src/com/mostc/pftt/scenario/DrupalScenario.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.mostc.pftt.scenario; - -import com.mostc.pftt.host.Host; -import com.mostc.pftt.model.phpt.PhpBuild; -import com.mostc.pftt.results.ConsoleManager; - -/** A free and open-source content management framework (CMF) written in PHP and distributed under - * the GNU General Public License. It is used as a back-end system for at least 2.1% of - * all websites worldwide ranging from personal blogs to corporate, political, and government - * sites including whitehouse.gov and data.gov.uk. It is also used for knowledge management and - * business collaboration. - * - * @see https://drupal.org/ - * - */ - -public class DrupalScenario extends ZipDbApplication { - - @Override - public String getName() { - return "Drupal"; - } - - @Override - public boolean isImplemented() { - return false; - } - - @Override - protected String getZipAppFileName() { - return "drupal-7.18.zip"; - } - - @Override - protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/src/com/mostc/pftt/scenario/HelloWorldScenario.groovy b/src/com/mostc/pftt/scenario/HelloWorldScenario.groovy new file mode 100644 index 0000000..400dc32 --- /dev/null +++ b/src/com/mostc/pftt/scenario/HelloWorldScenario.groovy @@ -0,0 +1,40 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** Simple PHP script that just prints 'Hello World' + * + * @author Matt Ficken + * + */ + +public class HelloWorldScenario extends ApplicationScenario { + + @Override + public boolean setup(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set) { + def php_code = """ +<?php + +echo "Hello World"; + +?> +""" + + host.saveTextFile("helloworld.php", php_code) + + return true; + } + + @Override + public String getName() { + return "HelloWorld"; + } + + @Override + public boolean isImplemented() { + return true; + } + +} diff --git a/src/com/mostc/pftt/scenario/JoomlaScenario.groovy b/src/com/mostc/pftt/scenario/JoomlaScenario.groovy new file mode 100644 index 0000000..b4cb1ce --- /dev/null +++ b/src/com/mostc/pftt/scenario/JoomlaScenario.groovy @@ -0,0 +1,94 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** Joomla is a free and open source content management system (CMS) for publishing content on the + * World Wide Web and intranets and a model�view�controller (MVC) Web application framework that can + * also be used independently. + * + * @see http://www.joomla.org/ + * + */ + +public class JoomlaScenario extends ZipDbApplication { + + @Override + public String getName() { + return "Joomla"; + } + + @Override + public boolean isImplemented() { + return false; + } + + @Override + protected String getZipAppFileName() { + return "Joomla_3.0.2-Stable-Full_Package.zip"; + } + + @Override + protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { + // TODO Auto-generated method stub + + host.open("joomla/joomla.xml"); + def xml = """ + <?xml version="1.0" encoding="UTF-8" ?> + - <extension version="3.0" type="file" method="upgrade"> + <name>files_joomla</name> + <author>Joomla! Project</author> + <authorEmail>ad...@joomla.org</authorEmail> + <authorUrl>www.joomla.org</authorUrl> + <copyright>(C) 2005 - 2012 Open Source Matters. All rights reserved</copyright> + <license>GNU General Public License version 2 or later; see LICENSE.txt</license> + <version>3.0.2</version> + <creationDate>November 2012</creationDate> + <description>FILES_JOOMLA_XML_DESCRIPTION</description> + <scriptfile>administrator/components/com_admin/script.php</scriptfile> + - <update> + - <!-- Runs on update; New in 1.7 + --> + - <schemas> + <schemapath type="mysql">administrator/components/com_admin/sql/updates/mysql</schemapath> + <schemapath type="sqlsrv">administrator/components/com_admin/sql/updates/sqlsrv</schemapath> + <schemapath type="sqlazure">administrator/components/com_admin/sql/updates/sqlazure</schemapath> + <schemapath type="postgresql">administrator/components/com_admin/sql/updates/postgresql</schemapath> + </schemas> + </update> + - <fileset> + - <files> + <folder>administrator</folder> + <folder>cache</folder> + <folder>cli</folder> + <folder>components</folder> + <folder>images</folder> + <folder>includes</folder> + <folder>language</folder> + <folder>layouts</folder> + <folder>libraries</folder> + <folder>logs</folder> + <folder>media</folder> + <folder>modules</folder> + <folder>plugins</folder> + <folder>templates</folder> + <folder>tmp</folder> + <file>htaccess.txt</file> + <file>web.config.txt</file> + <file>LICENSE.txt</file> + <file>README.txt</file> + <file>index.php</file> + </files> + </fileset> + - <updateservers> + <server type="collection">http://update.joomla.org/core/list.xml</server> + <server type="collection">http://update.joomla.org/jed/list.xml</server> + </updateservers> + </extension> + """ + + return false; + } + +} diff --git a/src/com/mostc/pftt/scenario/JoomlaScenario.java b/src/com/mostc/pftt/scenario/JoomlaScenario.java deleted file mode 100644 index e11b278..0000000 --- a/src/com/mostc/pftt/scenario/JoomlaScenario.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.mostc.pftt.scenario; - -import com.mostc.pftt.host.Host; -import com.mostc.pftt.model.phpt.PhpBuild; -import com.mostc.pftt.results.ConsoleManager; - -/** Joomla is a free and open source content management system (CMS) for publishing content on the - * World Wide Web and intranets and a model�view�controller (MVC) Web application framework that can - * also be used independently. - * - * @see http://www.joomla.org/ - * - */ - -public class JoomlaScenario extends ZipDbApplication { - - @Override - public String getName() { - return "Joomla"; - } - - @Override - public boolean isImplemented() { - return false; - } - - @Override - protected String getZipAppFileName() { - return "Joomla_3.0.2-Stable-Full_Package.zip"; - } - - @Override - protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/src/com/mostc/pftt/scenario/LimeSurveyScenario.java b/src/com/mostc/pftt/scenario/LimeSurveyScenario.java new file mode 100644 index 0000000..b5794a9 --- /dev/null +++ b/src/com/mostc/pftt/scenario/LimeSurveyScenario.java @@ -0,0 +1,39 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** LimeSurvey (formerly PHPSurveyor) is an free and open source online survey application + * written in PHP based on a MySQL, PostgreSQL or MSSQL database, distributed under the GNU + * General Public License.[1] Designed for ease of use, it enables users to develop and + * publish surveys, and collect responses, without doing any programming. + * + * @see http://www.limesurvey.org/ + * + */ + +public class LimeSurveyScenario extends ZipDbApplication { + + @Override + protected String getZipAppFileName() { + return "limesurvey200plus-build121220.zip"; + } + + @Override + protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getName() { + return "LimeSurvey"; + } + + @Override + public boolean isImplemented() { + return false; + } + +} diff --git a/src/com/mostc/pftt/scenario/MoodleScenario.java b/src/com/mostc/pftt/scenario/MoodleScenario.java new file mode 100644 index 0000000..de5587b --- /dev/null +++ b/src/com/mostc/pftt/scenario/MoodleScenario.java @@ -0,0 +1,38 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** Moodle is a Course Management System (CMS), also known as a Learning Management System (LMS) + * or a Virtual Learning Environment (VLE). It is a Free web application that educators can use + * to create effective online learning sites. + * + * @see http://moodle.org/ + * + */ + +public class MoodleScenario extends ZipDbApplication { + + @Override + protected String getZipAppFileName() { + return "moodle-2.4.zip"; + } + + @Override + protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getName() { + return "Moodle"; + } + + @Override + public boolean isImplemented() { + return false; + } + +} diff --git a/src/com/mostc/pftt/scenario/OpenAtriumScenario.java b/src/com/mostc/pftt/scenario/OpenAtriumScenario.java new file mode 100644 index 0000000..6fe1759 --- /dev/null +++ b/src/com/mostc/pftt/scenario/OpenAtriumScenario.java @@ -0,0 +1,39 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** Open Atrium is an open source platform designed specifically to make great teams + * communicate better. An intranet in a box with: a blog, a wiki, a calendar, a to do + * list, a shoutbox, and a dashboard to manage it all. Let�s not forget that it�s also + * completely customizable. + * + * @see http://openatrium.com/ + * + */ + +public class OpenAtriumScenario extends ZipDbApplication { + + @Override + protected String getZipAppFileName() { + return "atrium-1-1.zip"; + } + + @Override + protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getName() { + return "OpenAtrium"; + } + + @Override + public boolean isImplemented() { + return false; + } + +} diff --git a/src/com/mostc/pftt/scenario/PhpMyAdminScenario.java b/src/com/mostc/pftt/scenario/PhpMyAdminScenario.java new file mode 100644 index 0000000..03c3640 --- /dev/null +++ b/src/com/mostc/pftt/scenario/PhpMyAdminScenario.java @@ -0,0 +1,39 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** phpMyAdmin is a free and open source tool written in PHP intended to handle the + * administration of MySQL with the use of a Web browser. It can perform various tasks + * such as creating, modifying or deleting databases, tables, fields or rows; executing + * SQL statements; or managing users and permissions. + * + * @see http://www.phpmyadmin.net/ + * + */ + +public class PhpMyAdminScenario extends ZipApplication { + + @Override + protected String getZipAppFileName() { + return "phpMyAdmin-3.4.9-all-languages.zip"; + } + + @Override + protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getName() { + return "PhpMyAdmin"; + } + + @Override + public boolean isImplemented() { + return false; + } + +} diff --git a/src/com/mostc/pftt/scenario/PhpPgAdminScenario.java b/src/com/mostc/pftt/scenario/PhpPgAdminScenario.java new file mode 100644 index 0000000..6144457 --- /dev/null +++ b/src/com/mostc/pftt/scenario/PhpPgAdminScenario.java @@ -0,0 +1,37 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** phpPgAdmin is a web-based administration tool for PostgreSQL. It is perfect for + * PostgreSQL DBAs, newbies and hosting services. + * + * @see http://phppgadmin.sourceforge.net/ + * + */ + +public class PhpPgAdminScenario extends ZipApplication { + + @Override + protected String getZipAppFileName() { + return "phpPgAdmin-5.0.3.zip"; + } + + @Override + protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getName() { + return "PhpPgAdmin"; + } + + @Override + public boolean isImplemented() { + return false; + } + +} diff --git a/src/com/mostc/pftt/scenario/PhpTicketsScenario.java b/src/com/mostc/pftt/scenario/PhpTicketsScenario.java new file mode 100644 index 0000000..33528bb --- /dev/null +++ b/src/com/mostc/pftt/scenario/PhpTicketsScenario.java @@ -0,0 +1,38 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** phpTickets is a trouble ticket support system written in PHP and utilizes a mySQL + * database for storage. Tickets can be entered manually or can also be pulled in + * automatically from any POP account. + * + * @see http://www.phptickets.org/ + * + */ + +public class PhpTicketsScenario extends ZipDbApplication { + + @Override + protected String getZipAppFileName() { + return "phpTickets-1_1_0.zip"; + } + + @Override + protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getName() { + return "PhpTickets"; + } + + @Override + public boolean isImplemented() { + return false; + } + +} diff --git a/src/com/mostc/pftt/scenario/PliggScenario.groovy b/src/com/mostc/pftt/scenario/PliggScenario.groovy new file mode 100644 index 0000000..837ab54 --- /dev/null +++ b/src/com/mostc/pftt/scenario/PliggScenario.groovy @@ -0,0 +1,237 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** Pligg is an open source CMS (Content Management System) that you can download and use for free. + * Pligg CMS provides social publishing software that encourages visitors to register on your website + * so that they can submit content and connect with other users. Our software creates websites where + * stories are created and voted on by members, not website editors. Use Pligg content management + * system to start your own social publishing community in minutes. + * + * @see http://pligg.com/ + * + */ + +public class PliggScenario extends ZipDbApplication { + + @Override + public String getName() { + return "Pligg"; + } + + @Override + public boolean isImplemented() { + return false; + } + + @Override + protected String getZipAppFileName() { + return "Pligg_CMS 1.2.2.zip"; + } + + @Override + protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { + // TODO Auto-generated method stub + host.open("pligg/config.php"); + + + def php = """ + <?php + // The source code packaged with this file is Free Software, Copyright (C) 2005 by + // Ricardo Galli <gallir at uib dot es>. + // It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise. + // You can get copies of the licenses here: +// http://www.affero.org/oagpl.html + // AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING". + + ini_set('include_path', '.'); + + define('LOG_FILE','cache/log.php'); + error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING); + ini_set('display_errors','Off'); + ini_set('error_log','cache/log.php'); + + // experimental caching + // 0 = off + // 1 = on + define('caching', 1); + + define('summarize_mysql', 1); + + if (get_magic_quotes_gpc()) { + function stripslashes_deep($value) + { + $value = is_array($value) ? + array_map('stripslashes_deep', $value) : + stripslashes($value); + + return $value; + } + + $_POST = array_map('stripslashes_deep', $_POST); + $_GET = array_map('stripslashes_deep', $_GET); + $_COOKIE = array_map('stripslashes_deep', $_COOKIE); + $_REQUEST = array_map('stripslashes_deep', $_REQUEST); + } + + // Sanitize GET variables used in templates + if ($main_smarty) + { + $get = array(); + foreach ($_GET as $k => $v) + $get[$k] = stripslashes(htmlentities(strip_tags($v),ENT_QUOTES,'UTF-8')); + $get['return'] = addslashes($get['return']); + $main_smarty->assign('get',$get); + } + + // CSFR/XSFR protection + if(!isset($_SESSION)) @session_start(); + if ($_SESSION['xsfr']) + $xsfr_first_page = 0; + else + { + $xsfr_first_page = 1; + $_SESSION['xsfr'] = 1; + } + + // DO NOT EDIT THIS FILE. USE THE ADMIN PANEL (logged in as "god") TO MAKE CHANGES + // IF YOU MUST MAKE CHANGES MANUALLY, EDIT SETTINGS.PHP + + + define("mnmpath", dirname(__FILE__).'/'); + define("mnminclude", dirname(__FILE__).'/libs/'); + define("mnmmodules", dirname(__FILE__).'/modules/'); + + include_once mnminclude . 'pre_install_check.php'; + + include_once 'settings.php'; + function sanit($var){ + return addslashes(htmlentities(strip_tags($var),ENT_QUOTES,'UTF-8')); + } + if ($my_base_url == ''){ + define('my_base_url', "http://" . $_SERVER["HTTP_HOST"]); + if(isset($_REQUEST['action'])){$action = sanit($_REQUEST['action']);}else{$action="";} + + $pos = strrpos($_SERVER["SCRIPT_NAME"], "/"); + $path = substr($_SERVER["SCRIPT_NAME"], 0, $pos); + if ($path == "/"){$path = "";} + + define('my_pligg_base', $path); + $my_pligg_base = $path; + } else { + define('my_base_url', $my_base_url); + define('my_pligg_base', $my_pligg_base); + } + + define('urlmethod', $URLMethod); + + if(isset($_COOKIE['template'])){ + $thetemp = str_replace('..','',sanit($_COOKIE['template'])); + } + + // template check + $file = dirname(__FILE__) . '/templates/' . $thetemp . "/pligg.tpl"; + unset($errors); + if (!file_exists($file)) { $errors[]='You may have typed the template name wrong or "'. $thetemp . '" does not exist. Click <a href = "admin/admin_config.php?page=Template">here</a> to fix it.'; } + if (isset($errors)) { + $thetemp = "wistie"; + $file = dirname(__FILE__) . '/templates/' . $thetemp . "/pligg.tpl"; + if (!file_exists($file)) {echo 'The default Wistie template does not exist anymore. Please fix this by reuploading the Wistie template!'; die();} + + foreach ($errors as $error) { + $output.="<p><b>Error:</b> $error</p>\n"; + } + + if (strpos($_SERVER['SCRIPT_NAME'], "admin_config.php") == 0 && strpos($_SERVER['SCRIPT_NAME'], "login.php") == 0){ + echo "<p><b>Error:</b> $error</p>\n"; + die(); + } + } + + + define('The_Template', $thetemp); + + if(Enable_Extra_Fields){include mnminclude.'extra_fields.php';} + + // Don't touch behind this + $local_configuration = $_SERVER['SERVER_NAME'].'-local.php'; + @include($local_configuration); + + include_once mnminclude.'define_tables.php'; + + // + // start summarization and caching of mysql data + // + + // added to replace 55 redundant queries with 1 + // used with the following functions in /lib/link.php + // function category_name() { + // function category_safe_name() { + // cache the data if caching is enabled + + if(caching == 1){ + $db->cache_dir = mnmpath.'cache'; + $db->use_disk_cache = true; + $db->cache_queries = true; + } + + // if this query changes, be sure to change the 'clear the cache' code in admin_categories.php + $the_cats = loadCategoriesForCache(); + $cached_categories = $the_cats; + + $db->cache_queries = false; + + // a simple cache type system for the users table + // used in the read() function of /libs/user.php + $cached_users = array(); + + // a simple cache type system for the totals table + // functions related to this are in /libs/html1.php + $cached_totals = array(); + + $cached_votes = array(); + + $cached_links = array(); + + $cached_comments = array(); + + $cached_saved_links = array(); + // + // end summarization and caching of mysql data + // + + ob_start(); + include_once mnminclude.'db.php'; + include mnminclude.'utils.php'; + if(!isset($include_login) || $include_login !== false){ + // if $include_login is set to false (like in jspath.php and xmlhttp.php), then we don't + // include login, because login will run a query right away to check user credentials + // and these two files don't require that. + include_once mnminclude.'login.php'; + } + if (!file_exists(dirname(__FILE__) . '/languages/lang_'.$language.'.conf')) {$language = 'english';} + define('pligg_language', $language); + if (!file_exists(dirname(__FILE__) . '/languages/lang_'.$language.'.conf')) {die('The language file /languages/lang_' . $language . '.conf does not exist. Either this file is missing or you did not rename lang.conf after an upgrade. Try renaming /languages/lang.conf to /languages/lang_' . $language . '.conf.');} + + include_once(mnmmodules . 'modules_init.php'); + include mnminclude.'utf8/utf8.php'; + include_once(mnminclude.'dbtree.php'); + + + function loadCategoriesForCache($clear_cache = false) { + global $db; + $sql = "select * from ".table_categories." ORDER BY lft ASC;"; + if ($clear_cache) + $db->un_cache($sql); + return $db->get_results($sql); + } + + ?> +""" + + return false; + } + +} diff --git a/src/com/mostc/pftt/scenario/PliggScenario.java b/src/com/mostc/pftt/scenario/PliggScenario.java deleted file mode 100644 index 058afdd..0000000 --- a/src/com/mostc/pftt/scenario/PliggScenario.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.mostc.pftt.scenario; - -import com.mostc.pftt.host.Host; -import com.mostc.pftt.model.phpt.PhpBuild; -import com.mostc.pftt.results.ConsoleManager; - -/** Pligg is an open source CMS (Content Management System) that you can download and use for free. - * Pligg CMS provides social publishing software that encourages visitors to register on your website - * so that they can submit content and connect with other users. Our software creates websites where - * stories are created and voted on by members, not website editors. Use Pligg content management - * system to start your own social publishing community in minutes. - * - * @see http://pligg.com/ - * - */ - -public class PliggScenario extends ZipDbApplication { - - @Override - public String getName() { - return "Pligg"; - } - - @Override - public boolean isImplemented() { - return false; - } - - @Override - protected String getZipAppFileName() { - return "Pligg_CMS 1.2.2.zip"; - } - - @Override - protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/src/com/mostc/pftt/scenario/ScenarioSet.java b/src/com/mostc/pftt/scenario/ScenarioSet.java index 4344a10..e411f84 100644 --- a/src/com/mostc/pftt/scenario/ScenarioSet.java +++ b/src/com/mostc/pftt/scenario/ScenarioSet.java @@ -164,28 +164,16 @@ public class ScenarioSet extends ArrayList<Scenario> { return true; } - /** finds the SAPI Scenario in the ScenarioSet or returns the default SAPI scenario (CLI) in case the ScenarioSet doesn't specify one. - * - * @see AbstractSAPIScenario - * @param set - * @return - */ - public static AbstractSAPIScenario getSAPIScenario(ScenarioSet set) { - for (Scenario s:set) { - if (s instanceof AbstractSAPIScenario) { - return (AbstractSAPIScenario) s; - } - } - return Scenario.DEFAULT_SAPI_SCENARIO; + public <S extends Scenario> S getScenario(Class<S> clazz) { + return getScenario(clazz, null); } - public static AbstractFileSystemScenario getFileSystemScenario(ScenarioSet set) { - for (Scenario s:set) { - if (s instanceof AbstractFileSystemScenario) { - return (AbstractFileSystemScenario) s; - } + public <S extends Scenario> S getScenario(Class<S> clazz, S def) { + for (Scenario scen : this) { + if (clazz.isAssignableFrom(scen.getClass())) + return (S) scen; } - return Scenario.DEFAULT_FILESYSTEM_SCENARIO; + return def; } /** determines if this set of scenarios can be executed on the given host @@ -208,7 +196,9 @@ public class ScenarioSet extends ArrayList<Scenario> { return (ScenarioSet) super.clone(); } - /** + /** checks if Scenario or Scenario class is contained in set. + * + * if class given, checks for superclasses, inheritance, etc... of Scenario class. * */ @Override @@ -218,7 +208,7 @@ public class ScenarioSet extends ArrayList<Scenario> { for ( Object a : this ) { if (clazz.isAssignableFrom(a.getClass())) return true; - } + } } return super.contains(o); } diff --git a/src/com/mostc/pftt/scenario/SquirrelMailScenario.groovy b/src/com/mostc/pftt/scenario/SquirrelMailScenario.groovy new file mode 100644 index 0000000..2375266 --- /dev/null +++ b/src/com/mostc/pftt/scenario/SquirrelMailScenario.groovy @@ -0,0 +1,1107 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** SquirrelMail is an Open Source project that provides both a web-based email application and + * an IMAP proxy server. + * + * @see http://squirrelmail.org/ + * + */ + +public class SquirrelMailScenario extends ZipDbApplication { + + @Override + public String getName() { + return "SquirrelMail"; + } + + @Override + public boolean isImplemented() { + return false; + } + + @Override + protected String getZipAppFileName() { + return "squirrelmail-webmail-1.4.22.zip"; + } + + @Override + protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { + // TODO Auto-generated method stub + host.open("squirel-webmail/config/config_default.php"); + + def php = """ + <?php + + /** + * Default SquirrelMail configuration file + * + * BEFORE EDITING THIS FILE! + * + * Don't edit this file directly. Copy it to config.php before you + * edit it. However, it is best to use the configuration script + * conf.pl if at all possible. That is the easiest and cleanest way + * to configure. + * + * Note on SECURITY: some options require putting a password in this file. + * Please make sure that you adapt its permissions appropriately to avoid + * passwords being leaked to e.g. other system users. Take extra care when + * the webserver is shared with untrusted users. + * + * @copyright 2000-2011 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: config_default.php 14084 2011-01-06 02:44:03Z pdontthink + * @package squirrelmail + * @subpackage config + */ + + /* Do not change this value. */ + global $version; + global $config_version; + $config_version = '1.4.0'; + + /*** Organization preferences ***/ + /** + * Organization's name + * @global string $org_name + */ + $org_name = "SquirrelMail"; + + /** + * Organization's logo picture (blank if none) + * @global string $org_logo + */ + $org_logo = SM_PATH . 'images/sm_logo.png'; + + /** + * The width of the logo (0 for default) + * @global string $org_logo_width + */ + $org_logo_width = '308'; + + /** + * The height of the logo (0 for default) + * @global string $org_logo_height + */ + $org_logo_height = '111'; + + /** + * Webmail Title + * + * This is the web page title that appears at the top of the browser window. + * @global string $org_title + */ + $org_title = "SquirrelMail $version"; + + /** + * Signout page + * + * Rather than going to the signout.php page (which only allows you + * to sign back in), setting signout_page allows you to sign the user + * out and then redirect to whatever page you want. For instance, + * the following would return the user to your home page: + * $signout_page = '/'; + * Set to the empty string to continue to use the default signout page. + * @global string $signout_page + */ + $signout_page = ''; + + /** + * Top frame + * + * By default SquirrelMail takes up the whole browser window, + * this allows you to embed it within sites using frames. Set + * this to the frame you want it to stay in. + * @global string $frame_top + */ + $frame_top = '_top'; + + /** + * Provider name + * + * Here you can set name of the link displayed on the right side of main page. + * + * Link will be displayed only if you have $hide_sm_attributions + * option set to true. + * @global string $provider_name + */ + $provider_name = 'SquirrelMail'; + + /** + * Provider URI + * + * Here you can set URL of the link displayed on the right side of main page. + * + * Link will be displayed only if you have $hide_sm_attributions + * option set to true. + * @global string $provider_uri + */ + $provider_uri = 'http://squirrelmail.org/'; + + /*** Server Settings ***/ + /** + * Default Domain + * + * The domain part of local email addresses. + * This is for all messages sent out from this server. + * Reply address is generated by $username@$domain + * Example: In b...@example.com, example.com is the domain. + * @global string $domain + */ + $domain = 'example.com'; + + /** + * Time offset inversion + * + * If you are running on a machine that doesn't have the tm_gmtoff + * value in your time structure and if you are in a time zone that + * has a negative offset, you need to set this value to 1. This is + * typically people in the US that are running Solaris 7. + * @global bool $invert_time + */ + $invert_time = false; + + /** + * Default send transport + * + * What should be used when sending email. + * If it is set to false, SquirrelMail will use SMTP server settings. + * If it is set to true, SquirrelMail will use program defined in + * $sendmail_path + * @global bool $useSendmail + */ + $useSendmail = false; + + /** + * Your SMTP server (usually the same as the IMAP server). + * @global string $smtpServerAddress + */ + $smtpServerAddress = 'localhost'; + /** + * Your SMTP port number (usually 25). + * @global integer $smtpPort + */ + $smtpPort = 25; + + /** + * SquirrelMail header encryption + * + * Encryption key allows to hide SquirrelMail Received: headers + * in outbound messages. Interface uses encryption key to encode + * username, remote address and proxied address, then stores encoded + * information in X-Squirrel-* headers. + * + * Warning: used encryption function is not bulletproof. When used + * with static encryption keys, it provides only minimal security + * measures and information can be decoded quickly. + * + * Encoded information can be decoded with decrypt_headers.php script + * from SquirrelMail contrib/ directory. + * @global string $encode_header_key + * @since 1.5.1 and 1.4.5 + */ + $encode_header_key = ''; + + /** + * Path to Sendmail + * + * Program that should be used when sending email. SquirrelMail expects that + * this program will follow options used by original sendmail + * (http://www.sendmail.org). + * @global string $sendmail_path + */ + $sendmail_path = '/usr/sbin/sendmail'; + + /** + * Extra sendmail command arguments. + * + * Sets additional sendmail command arguments. Make sure that arguments are + * supported by your sendmail program. -f argument is added automatically by + * SquirrelMail scripts. Variable defaults to standard /usr/sbin/sendmail + * arguments. If you use qmail-inject, nbsmtp or any other sendmail wrapper, + * which does not support -t and -i arguments, set variable to empty string + * or use arguments suitable for your mailer. + * @global string $sendmail_args + * @since 1.5.1 and 1.4.8 + */ + $sendmail_args = '-i -t'; + + /** + * IMAP server address + * + * The dns name (or IP address) for your imap server. + * @global string $imapServerAddress + */ + $imapServerAddress = 'localhost'; + + /** + * IMAP server port + * + * Port used by your imap server. (Usually 143) + * @global integer $imapPort + */ + $imapPort = 143; + + /** + * IMAP server type + * + * The type of IMAP server you are running. + * Valid type are the following (case is important): + * courier + * cyrus + * exchange + * uw + * macosx + * hmailserver + * other + * + * Please note that this changes only some of server settings. + * + * In order to set everything correctly, you need to adjust several + * squirrelmail options. These options are listed in doc/presets.txt + * @global string $imap_server_type + */ + $imap_server_type = 'other'; + + /** + * Advanced IMAP authentication options control + * + * CRAM-MD5, DIGEST-MD5, Plain, and TLS + * Set reasonable defaults - you'd never know this was there unless you ask for it + * @global bool $use_imap_tls + */ + $use_imap_tls = false; + + /** + * Advanced SMTP authentication options control + * + * CRAM-MD5, DIGEST-MD5, Plain, and TLS + * Set reasonable defaults - you'd never know this was there unless you ask for it + * @global bool $use_smtp_tls + */ + $use_smtp_tls = false; + + /** + * SMTP authentication mechanism + * + * auth_mech can be either 'none', 'login','plain', 'cram-md5', or 'digest-md5' + * @global string $smtp_auth_mech + */ + $smtp_auth_mech = 'none'; + + /** + * Custom SMTP Authentication Username + * + * IMAP username is used if variable is set to an empty string. Variable is included in + * the main configuration file only in 1.4.11+ and 1.5.2+. + * @global string $smtp_sitewide_user + * @since 1.4.11 + */ + $smtp_sitewide_user = ''; + + /** + * Custom SMTP Authentication Password + * + * IMAP password is used if variable is set to an empty string. Variable is included in + * the main configuration file in 1.4.11+ and 1.5.2+ + * @global string $smtp_sitewide_pass + * @since 1.4.11 + */ + $smtp_sitewide_pass = ''; + + /** + * IMAP authentication mechanism + * + * auth_mech can be either 'login','plain', 'cram-md5', or 'digest-md5' + * @global string $imap_auth_mech + */ + $imap_auth_mech = 'login'; + + /** + * IMAP folder delimiter + * + * This is the delimiter that your IMAP server uses to distinguish between + * folders. For example, Cyrus uses '.' as the delimiter and a complete + * folder would look like 'INBOX.Friends.Bob', while UW uses '/' and would + * look like 'INBOX/Friends/Bob'. Normally this should be left at 'detect' + * but if you are sure you know what delimiter your server uses, you can + * specify it here. + * + * To have it autodetect the delimiter, set it to 'detect'. + * @global string $optional_delimiter + */ + $optional_delimiter = 'detect'; + + /** + * POP before SMTP setting + * + * Do you wish to use POP3 before SMTP? Your server must + * support this in order for SquirrelMail to work with it. + * @global bool $pop_before_smtp + */ + $pop_before_smtp = false; + + + /** + * POP before SMTP server address + * + * When using POP3 before SMTP, if the POP server address is + * not the same as the SMTP server address, specify it here. + * If this is left empty, the SMTP server address will be + * used by default. + * @global bool $pop_before_smtp_host + */ + $pop_before_smtp_host = ''; + + + /*** Folder Settings ***/ + /** + * Default IMAP folder prefix + * + * Many servers store mail in your home directory. With this, they + * store them in a subdirectory: mail/ or Mail/, etc. If your server + * does this, please set this to what the default mail folder should + * be. This is still a user preference, so they can change it if it + * is different for each user. + * + * Example: + * $default_folder_prefix = 'mail/'; + * -- or -- + * $default_folder_prefix = 'Mail/folders/'; + * + * If you do not use this, set it to the empty string. + * @global string $default_folder_prefix + */ + $default_folder_prefix = ''; + + /** + * User level prefix control + * + * If you do not wish to give them the option to change this, set it + * to false. Otherwise, if it is true, they can change the folder prefix + * to be anything. + * @global bool $show_prefix_option + */ + $show_prefix_option = false; + + /** + * The following are related to deleting messages. + * $default_move_to_trash + * If this is set to 'true', when 'delete' is pressed, it + * will attempt to move the selected messages to the folder + * named $trash_folder. If it's set to 'false', we won't even + * attempt to move the messages, just delete them. + * $default_move_to_sent + * If this is set to 'true', sent messages will be stored in + * $sent_folder by default. + * $default_save_as_draft + * If this is set to 'true', users are able to use $draft_folder + * to store their unfinished messages. + * $trash_folder + * This is the path to the default trash folder. For Cyrus + * IMAP, it would be 'INBOX.Trash', but for UW it would be + * 'Trash'. We need the full path name here. + * $draft_folder + * This is the patch to where Draft messages will be stored. + * $auto_expunge + * If this is true, when a message is moved or copied, the + * source mailbox will get expunged, removing all messages + * marked 'Deleted'. + * $sent_folder + * This is the path to where Sent messages will be stored. + * $delete_folder + * If this is true, when a folder is deleted then it will + * not get moved into the Trash folder. + * @global bool $default_move_to_trash + * @global bool $default_move_to_sent + * @global bool $default_save_as_draft + * @global string $trash_folder + * @global string $sent_folder + * @global string $draft_folder + * @global bool $auto_expunge + * @global bool $delete_folder + */ + $default_move_to_trash = true; + $default_move_to_sent = true; + $default_save_as_draft = true; + $trash_folder = 'INBOX.Trash'; + $sent_folder = 'INBOX.Sent'; + $draft_folder = 'INBOX.Drafts'; + $auto_expunge = true; + $delete_folder = false; + + /** + * Special Folder Color Control + * + * Whether or not to use a special color for special folders. If not, + * special folders will be the same color as the other folders. + * @global bool $use_special_folder_color + */ + $use_special_folder_color = true; + + /** + * Create Special Folders Control + * + * Should I create the Sent and Trash folders automatically for + * a new user that doesn't already have them created? + * @global bool $auto_create_special + */ + $auto_create_special = true; + + /** + * List Special Folders First Control + * + * Whether or not to list the special folders first (true/false). + * @global bool $list_special_folders_first + */ + $list_special_folders_first = true; + + /** + * Subfolder Layout Control + * + * Are all your folders subfolders of INBOX (i.e. cyrus IMAP server). + * If you are unsure, set it to false. + * @global bool $default_sub_of_inbox + */ + $default_sub_of_inbox = true; + + /** + * Subfolder Format Control + * + * Some IMAP daemons (UW) handle folders weird. They only allow a + * folder to contain either messages or other folders, not both at + * the same time. This option controls whether or not to display an + * option during folder creation. The option toggles which type of + * folder it should be. + * + * If this option confuses you, just set it to 'true'. You can not hurt + * anything if it's true, but some servers will respond weird if it's + * false. (Cyrus works fine whether it's true OR false). + * @global bool $show_contain_subfolders_option + */ + $show_contain_subfolders_option = false; + + /** + * These next two options set the defaults for the way that the + * users see their folder list. + * $default_unseen_notify + * Specifies whether or not the users will see the number of + * unseen in each folder by default and also which folders to + * do this to. Valid values are: 1=none, 2=inbox, 3=all. + * $default_unseen_type + * Specifies the type of notification to give the users by + * default. Valid choice are: 1=(4), 2=(4,25). + * @global integer $default_unseen_notify + * @global integer $default_unseen_type + */ + $default_unseen_notify = 2; + $default_unseen_type = 1; + + /** + * NoSelect Fix Control + * + * This enables the no select fix for Cyrus when subfolders + * exist but parent folders do not + * @global bool $noselect_fix_enable + */ + $noselect_fix_enable = false; + + /*** General options ***/ + /** + * Path to the data/ directory + * + * It is a possible security hole to have a writable directory + * under the web server's root directory (ex: /home/httpd/html). + * It is possible to put the data directory anywhere you would like; + * it is strongly advised that it is NOT directly web-accessible. + * + * The path name can be absolute or relative (to the config directory). + * If it is relative, it must use the SM_PATH constant. + * Here are two examples: + * + * Absolute: + * $data_dir = '/var/local/squirrelmail/data/'; + * + * Relative (to main SM directory): + * $data_dir = SM_PATH . 'data/'; + * (NOT recommended: you need to secure apache to make sure these + * files are not world readable) + * + * @global string $data_dir + */ + $data_dir = '/var/local/squirrelmail/data/'; + + /** + * Attachments directory + * + * Path to directory used for storing attachments while a mail is + * being sent. There are a few security considerations regarding + * this directory: + * + It should have the permission 733 (rwx-wx-wx) to make it + * impossible for a random person with access to the webserver to + * list files in this directory. Confidential data might be laying + * around there. + * + Since the webserver is not able to list the files in the content + * is also impossible for the webserver to delete files lying around + * there for too long. + * + It should probably be another directory than data_dir. + * @global string $attachment_dir + */ + $attachment_dir = '/var/local/squirrelmail/attach/'; + + /** + * Hash level used for data directory. + * + * This option allows spliting file based squirrelmail user + * data storage directory into several subfolders. Number from + * 0 to 4 allows allows having up to four subfolder levels. + * + * Hashing should speed up directory access if you have big number + * of users (500 and more). + * @global integer $dir_hash_level + */ + $dir_hash_level = 0; + + /** + * Default Size of Folder List + * + * This is the default size of the folder list. Default + * is 150, but you can set it to whatever you wish. + * @global string $default_left_size + */ + $default_left_size = '150'; + + /** + * Username Case Control + * + * Some IMAP servers allow a username (like 'bob') to log in if they use + * uppercase in their name (like 'Bob' or 'BOB'). This creates extra + * preference files. Toggling this option to true will transparently + * change all usernames to lowercase. + * @global bool $force_username_lowercase + */ + $force_username_lowercase = false; + + /** + * Email Priority Control + * + * This option enables use of email priority flags by end users. + * @global bool $default_use_priority + */ + $default_use_priority = true; + + /** + * SquirrelMail Attributions Control + * + * This option disables display of "created by squirrelmail developers" + * strings and provider link + * @global bool $hide_sm_attributions + */ + $hide_sm_attributions = false; + + /** + * Delivery Receipts Control + * + * This option enables use of read/delivery receipts by end users. + * @global bool $default_use_mdn + */ + $default_use_mdn = true; + + /** + * Identity Controls + * + * If you don't want to allow users to change their email address + * then you can set $edit_identity to false, if you want them to + * not be able to change their full name too then set $edit_name + * to false as well. $edit_name has no effect unless $edit_identity + * is false; + * @global bool $edit_identity + * @global bool $edit_name + */ + $edit_identity = true; + $edit_name = true; + + /** + * SquirrelMail adds username information to every sent email. + * It is done in order to prevent possible sender forging when + * end users are allowed to change their email and name + * information. + * + * You can disable this header, if you think that it violates + * user's privacy or security. Please note, that setting will + * work only when users are not allowed to change their identity. + * + * See SquirrelMail bug tracker #847107 for more details about it. + * @global bool $hide_auth_header + * @since 1.5.1 and 1.4.5 + */ + $hide_auth_header = false; + + /** + * Server Side Threading Control + * + * If you want to enable server side thread sorting options + * Your IMAP server must support the THREAD extension for + * this to work. + * @global bool $allow_thread_sort + */ + $allow_thread_sort = false; + + /** + * Server Side Sorting Control + * + * to use server-side sorting instead of SM client side. + * Your IMAP server must support the SORT extension for this + * to work. + * @global bool $allow_server_sort + */ + $allow_server_sort = false; + + /** + * IMAP Charset Use Control + * + * This option allows you to choose if SM uses charset search + * Your imap server should support SEARCH CHARSET command for + * this to work. + * @global bool $allow_charset_search + */ + $allow_charset_search = true; + + /** + * IMAP UID control + * + * This option allows you to enable unique identifier (UID) support. + * @global bool $uid_support + */ + $uid_support = true; + + /** + * PHP session name. + * + * Leave this alone unless you know what you are doing. + * @global string $session_name + */ + $session_name = 'SQMSESSID'; + + + /** + * Location base + * + * This is used to build the URL to the SquirrelMail location. + * It should contain only the protocol and hostname/port parts + * of the URL; the full path will be appended automatically. + * + * If not specified or empty, it will be autodetected. + * + * Examples: + * http://webmail.example.org + * http://webmail.example.com:8080 + * https://webmail.example.com:6691 + * + * To be clear: do not include any of the path elements, so if + * SquirrelMail is at http://example.net/web/mail/src/login.php, you + * write: http://example.net + * + * @global string $config_location_base + * @since 1.4.8 + */ + $config_location_base = ''; + + + + /** + * Themes + * You can define your own theme and put it in this directory. + * You must call it as the example below. You can name the theme + * whatever you want. For an example of a theme, see the ones + * included in the config directory. + * + * To add a new theme to the options that users can choose from, just + * add a new number to the array at the bottom, and follow the pattern. + * + * $theme_default sets theme that will be used by default + * $theme_css sets stylesheet (from theme/css directory) that will be + * used by default. + * @global integer $theme_default + * @global string $theme_css + */ + $theme_default = 0; + $theme_css = ''; + + /** + * Listing of installed themes + * @global array $theme + */ + $theme[0]['PATH'] = SM_PATH . 'themes/default_theme.php'; + $theme[0]['NAME'] = 'Default'; + + $theme[1]['PATH'] = SM_PATH . 'themes/plain_blue_theme.php'; + $theme[1]['NAME'] = 'Plain Blue'; + + $theme[2]['PATH'] = SM_PATH . 'themes/sandstorm_theme.php'; + $theme[2]['NAME'] = 'Sand Storm'; + + $theme[3]['PATH'] = SM_PATH . 'themes/deepocean_theme.php'; + $theme[3]['NAME'] = 'Deep Ocean'; + + $theme[4]['PATH'] = SM_PATH . 'themes/slashdot_theme.php'; + $theme[4]['NAME'] = 'Slashdot'; + + $theme[5]['PATH'] = SM_PATH . 'themes/purple_theme.php'; + $theme[5]['NAME'] = 'Purple'; + + $theme[6]['PATH'] = SM_PATH . 'themes/forest_theme.php'; + $theme[6]['NAME'] = 'Forest'; + + $theme[7]['PATH'] = SM_PATH . 'themes/ice_theme.php'; + $theme[7]['NAME'] = 'Ice'; + + $theme[8]['PATH'] = SM_PATH . 'themes/seaspray_theme.php'; + $theme[8]['NAME'] = 'Sea Spray'; + + $theme[9]['PATH'] = SM_PATH . 'themes/bluesteel_theme.php'; + $theme[9]['NAME'] = 'Blue Steel'; + + $theme[10]['PATH'] = SM_PATH . 'themes/dark_grey_theme.php'; + $theme[10]['NAME'] = 'Dark Grey'; + + $theme[11]['PATH'] = SM_PATH . 'themes/high_contrast_theme.php'; + $theme[11]['NAME'] = 'High Contrast'; + + $theme[12]['PATH'] = SM_PATH . 'themes/black_bean_burrito_theme.php'; + $theme[12]['NAME'] = 'Black Bean Burrito'; + + $theme[13]['PATH'] = SM_PATH . 'themes/servery_theme.php'; + $theme[13]['NAME'] = 'Servery'; + + $theme[14]['PATH'] = SM_PATH . 'themes/maize_theme.php'; + $theme[14]['NAME'] = 'Maize'; + + $theme[15]['PATH'] = SM_PATH . 'themes/bluesnews_theme.php'; + $theme[15]['NAME'] = 'BluesNews'; + + $theme[16]['PATH'] = SM_PATH . 'themes/deepocean2_theme.php'; + $theme[16]['NAME'] = 'Deep Ocean 2'; + + $theme[17]['PATH'] = SM_PATH . 'themes/blue_grey_theme.php'; + $theme[17]['NAME'] = 'Blue Grey'; + + $theme[18]['PATH'] = SM_PATH . 'themes/dompie_theme.php'; + $theme[18]['NAME'] = 'Dompie'; + + $theme[19]['PATH'] = SM_PATH . 'themes/methodical_theme.php'; + $theme[19]['NAME'] = 'Methodical'; + + $theme[20]['PATH'] = SM_PATH . 'themes/greenhouse_effect.php'; + $theme[20]['NAME'] = 'Greenhouse Effect (Changes)'; + + $theme[21]['PATH'] = SM_PATH . 'themes/in_the_pink.php'; + $theme[21]['NAME'] = 'In The Pink (Changes)'; + + $theme[22]['PATH'] = SM_PATH . 'themes/kind_of_blue.php'; + $theme[22]['NAME'] = 'Kind of Blue (Changes)'; + + $theme[23]['PATH'] = SM_PATH . 'themes/monostochastic.php'; + $theme[23]['NAME'] = 'Monostochastic (Changes)'; + + $theme[24]['PATH'] = SM_PATH . 'themes/shades_of_grey.php'; + $theme[24]['NAME'] = 'Shades of Grey (Changes)'; + + $theme[25]['PATH'] = SM_PATH . 'themes/spice_of_life.php'; + $theme[25]['NAME'] = 'Spice of Life (Changes)'; + + $theme[26]['PATH'] = SM_PATH . 'themes/spice_of_life_lite.php'; + $theme[26]['NAME'] = 'Spice of Life - Lite (Changes)'; + + $theme[27]['PATH'] = SM_PATH . 'themes/spice_of_life_dark.php'; + $theme[27]['NAME'] = 'Spice of Life - Dark (Changes)'; + + $theme[28]['PATH'] = SM_PATH . 'themes/christmas.php'; + $theme[28]['NAME'] = 'Holiday - Christmas'; + + $theme[29]['PATH'] = SM_PATH . 'themes/darkness.php'; + $theme[29]['NAME'] = 'Darkness (Changes)'; + + $theme[30]['PATH'] = SM_PATH . 'themes/random.php'; + $theme[30]['NAME'] = 'Random (Changes every login)'; + + $theme[31]['PATH'] = SM_PATH . 'themes/midnight.php'; + $theme[31]['NAME'] = 'Midnight'; + + $theme[32]['PATH'] = SM_PATH . 'themes/alien_glow.php'; + $theme[32]['NAME'] = 'Alien Glow'; + + $theme[33]['PATH'] = SM_PATH . 'themes/dark_green.php'; + $theme[33]['NAME'] = 'Dark Green'; + + $theme[34]['PATH'] = SM_PATH . 'themes/penguin.php'; + $theme[34]['NAME'] = 'Penguin'; + + $theme[35]['PATH'] = SM_PATH . 'themes/minimal_bw.php'; + $theme[35]['NAME'] = 'Minimal BW'; + + $theme[36]['PATH'] = SM_PATH . 'themes/redmond.php'; + $theme[36]['NAME'] = 'Redmond'; + + $theme[37]['PATH'] = SM_PATH . 'themes/netstyle_theme.php'; + $theme[37]['NAME'] = 'Net Style'; + + $theme[38]['PATH'] = SM_PATH . 'themes/silver_steel_theme.php'; + $theme[38]['NAME'] = 'Silver Steel'; + + $theme[39]['PATH'] = SM_PATH . 'themes/simple_green_theme.php'; + $theme[39]['NAME'] = 'Simple Green'; + + $theme[40]['PATH'] = SM_PATH . 'themes/wood_theme.php'; + $theme[40]['NAME'] = 'Wood'; + + $theme[41]['PATH'] = SM_PATH . 'themes/bluesome.php'; + $theme[41]['NAME'] = 'Bluesome'; + + $theme[42]['PATH'] = SM_PATH . 'themes/simple_green2.php'; + $theme[42]['NAME'] = 'Simple Green 2'; + + $theme[43]['PATH'] = SM_PATH . 'themes/simple_purple.php'; + $theme[43]['NAME'] = 'Simple Purple'; + + $theme[44]['PATH'] = SM_PATH . 'themes/autumn.php'; + $theme[44]['NAME'] = 'Autumn'; + + $theme[45]['PATH'] = SM_PATH . 'themes/autumn2.php'; + $theme[45]['NAME'] = 'Autumn 2'; + + $theme[46]['PATH'] = SM_PATH . 'themes/blue_on_blue.php'; + $theme[46]['NAME'] = 'Blue on Blue'; + + $theme[47]['PATH'] = SM_PATH . 'themes/classic_blue.php'; + $theme[47]['NAME'] = 'Classic Blue'; + + $theme[48]['PATH'] = SM_PATH . 'themes/classic_blue2.php'; + $theme[48]['NAME'] = 'Classic Blue 2'; + + $theme[49]['PATH'] = SM_PATH . 'themes/powder_blue.php'; + $theme[49]['NAME'] = 'Powder Blue'; + + $theme[50]['PATH'] = SM_PATH . 'themes/techno_blue.php'; + $theme[50]['NAME'] = 'Techno Blue'; + + $theme[51]['PATH'] = SM_PATH . 'themes/turquoise.php'; + $theme[51]['NAME'] = 'Turquoise'; + + /** + * LDAP server(s) + * Array of arrays with LDAP server parameters. See + * functions/abook_ldap_server.php for a list of possible + * parameters + * + * EXAMPLE: + * $ldap_server[0] = Array( + * 'host' => 'memberdir.netscape.com', + * 'name' => 'Netcenter Member Directory', + * 'base' => 'ou=member_directory,o=netcenter.com' + * ); + * + * NOTE: please see security note at the top of this file when + * entering a password. + */ + // Add your ldap server options here + + /** + * Javascript in Addressbook Control + * + * Users may search their addressbook via either a plain HTML or Javascript + * enhanced user interface. This option allows you to set the default choice. + * Set this default choice as either: + * true = javascript + * false = html + * @global bool $default_use_javascript_addr_book + */ + $default_use_javascript_addr_book = false; + + /** + * Shared filebased address book + * @global string $abook_global_file + * @since 1.5.1 and 1.4.4 + */ + $abook_global_file = ''; + + /** + * Writing into shared address book control + * @global bool $abook_global_file_writeable + * @since 1.5.1 and 1.4.4 + */ + $abook_global_file_writeable = false; + + /** + * Listing of shared address book control + * @global bool $abook_global_file_listing + * @since 1.5.1 and 1.4.9 + */ + $abook_global_file_listing = true; + + /** + * Controls file based address book entry size + * + * This setting controls space allocated to file based address book records. + * End users will be unable to save address book entry, if total entry size + * (quoted address book fields + 4 delimiters + linefeed) exceeds allowed + * address book length size. + * + * Same setting is applied to personal and global file based address books. + * + * It is strongly recommended to keep default setting value. Change it only + * if you really want to store address book entries that are bigger than two + * kilobytes (2048). + * @global integer $abook_file_line_length + * @since 1.5.2 and 1.4.9 + */ + $abook_file_line_length = 2048; + + /** + * MOTD + * + * This is a message that is displayed immediately after a user logs in. + * @global string $motd + */ + $motd = ""; + + + /** + * To install plugins, just add elements to this array that have + * the plugin directory name relative to the /plugins/ directory. + * For instance, for the 'squirrelspell' plugin, you'd put a line like + * the following. + * $plugins[0] = 'squirrelspell'; + * $plugins[1] = 'listcommands'; + */ + // Add list of enabled plugins here + + + /*** Database ***/ + /** + * Read the administrator's manual in order to get more information + * about these settings. + */ + /** + * Database-driven private addressbooks + * DSN (Data Source Name) for a database where the private + * addressbooks are stored. See the administrator's manual for more info. + * If it is not set, the addressbooks are stored in files + * in the data dir. + * The DSN is in the format: mysql://user:pass@hostname/dbname + * The table is the name of the table to use within the + * specified database. + * + * NOTE: please see security note at the top of this file when + * entering a password. + */ + $addrbook_dsn = ''; + $addrbook_table = 'address'; + /** + * Database used to store user data + */ + $prefs_dsn = ''; + $prefs_table = 'userprefs'; + $prefs_key_field = 'prefkey'; + $prefs_user_field = 'user'; + $prefs_val_field = 'prefval'; + + /*** Global sql database options ***/ + /** + * DSN of global address book database + * @global string $addrbook_global_dsn + * @since 1.5.1 and 1.4.4 + */ + $addrbook_global_dsn = ''; + /** + * Table used for global database address book + * @global string $addrbook_global_table + * @since 1.5.1 and 1.4.4 + */ + $addrbook_global_table = 'global_abook'; + /** + * Control writing into global database address book + * @global boolean $addrbook_global_writeable + * @since 1.5.1 and 1.4.4 + */ + $addrbook_global_writeable = false; + /** + * Control listing of global database address book + * @global boolean $addrbook_global_listing + * @since 1.5.1 and 1.4.4 + */ + $addrbook_global_listing = false; + + /*** Language settings ***/ + /** + * Default language + * + * This is the default language. It is used as a last resort + * if SquirrelMail can't figure out which language to display. + * Language names usually consist of language code, undercore + * symbol and country code + * @global string $squirrelmail_default_language + */ + $squirrelmail_default_language = 'en_US'; + + /** + * Default Charset + * + * This option controls what character set is used when sending mail + * and when sending HTML to the browser. Do not set this to US-ASCII, + * use ISO-8859-1 instead. + * + * This option is active only when default language is en_US. In other + * cases SquirrelMail uses charset that depends on default language. + * See $squirrelmail_default_language + * + * @global string $default_charset + */ + $default_charset = 'iso-8859-1'; + + /** + * Lossy Encoding Control + * + * This option allows charset conversions when output charset does not support + * all symbols used in original charset. Symbols unsupported by output charset + * will be replaced with question marks. + * @global bool $lossy_encoding + * @since 1.4.4 and 1.5.1 + */ + $lossy_encoding = false; + + /** + * Subscribe Listing Control + * + * this disables listing all of the folders on the IMAP Server to + * generate the folder subscribe listbox (this can take a long time + * when you have a lot of folders). Instead, a textbox will be + * displayed allowing users to enter a specific folder name to subscribe to + * + * This option can't be changed by conf.pl + * @global bool $no_list_for_subscribe + */ + $no_list_for_subscribe = false; + + /** + * Color in config control + * + * This option is used only by conf.pl script to generate configuration + * menu with some colors and is provided here only as reference. + * @global integer $config_use_color + */ + $config_use_color = 2; + + /** + * This option includes special configuration options + */ + @include SM_PATH . 'config/config_local.php'; +""" + + return false; + } + +} diff --git a/src/com/mostc/pftt/scenario/SquirrelMailScenario.java b/src/com/mostc/pftt/scenario/SquirrelMailScenario.java deleted file mode 100644 index 5c577bd..0000000 --- a/src/com/mostc/pftt/scenario/SquirrelMailScenario.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.mostc.pftt.scenario; - -import com.mostc.pftt.host.Host; -import com.mostc.pftt.model.phpt.PhpBuild; -import com.mostc.pftt.results.ConsoleManager; - -/** SquirrelMail is an Open Source project that provides both a web-based email application and - * an IMAP proxy server. - * - * @see http://squirrelmail.org/ - * - */ - -public class SquirrelMailScenario extends ZipDbApplication { - - @Override - public String getName() { - return "SquirrelMail"; - } - - @Override - public boolean isImplemented() { - return false; - } - - @Override - protected String getZipAppFileName() { - return "squirrelmail-webmail-1.4.22.zip"; - } - - @Override - protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/src/com/mostc/pftt/scenario/WordpressScenario.groovy b/src/com/mostc/pftt/scenario/WordpressScenario.groovy new file mode 100644 index 0000000..d7d059a --- /dev/null +++ b/src/com/mostc/pftt/scenario/WordpressScenario.groovy @@ -0,0 +1,133 @@ +package com.mostc.pftt.scenario; + +import com.mostc.pftt.host.Host; +import com.mostc.pftt.model.phpt.PhpBuild; +import com.mostc.pftt.results.ConsoleManager; + +/** WordPress is a free and open source blogging tool and a content management system (CMS) + * based on PHP and MySQL. It has many features including a plug-in architecture and a + * template system. + * + * @see http://wordpress.org/ + * + */ + +public class WordpressScenario extends ZipDbApplication { + + @Override + public String getName() { + return "Wordpress"; + } + + @Override + public boolean isImplemented() { + return false; + } + + @Override + protected String getZipAppFileName() { + return "wordpress-3.5.zip"; + } + + @Override + protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { + // TODO Auto-generated method stub + host.open("wordpress/wp-config.php"); + + def php = """ + <?php + /** + * The base configurations of the WordPress. + * + * This file has the following configurations: MySQL settings, Table Prefix, + * Secret Keys, WordPress Language, and ABSPATH. You can find more information + * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing + * wp-config.php} Codex page. You can get the MySQL settings from your web host. + * + * This file is used by the wp-config.php creation script during the + * installation. You don't have to use the web site, you can just copy this file + * to "wp-config.php" and fill in the values. + * + * @package WordPress + */ + + // ** MySQL settings - You can get this info from your web host ** // + /** The name of the database for WordPress */ + define('DB_NAME', 'database_name_here'); + + /** MySQL database username */ + define('DB_USER', 'username_here'); + + /** MySQL database password */ + define('DB_PASSWORD', 'password_here'); + + /** MySQL hostname */ + define('DB_HOST', 'localhost'); + + /** Database Charset to use in creating database tables. */ + define('DB_CHARSET', 'utf8'); + + /** The Database Collate type. Don't change this if in doubt. */ + define('DB_COLLATE', ''); + + /**#@+ + * Authentication Unique Keys and Salts. + * + * Change these to different unique phrases! + * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} + * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. + * + * @since 2.6.0 + */ + define('AUTH_KEY', 'put your unique phrase here'); + define('SECURE_AUTH_KEY', 'put your unique phrase here'); + define('LOGGED_IN_KEY', 'put your unique phrase here'); + define('NONCE_KEY', 'put your unique phrase here'); + define('AUTH_SALT', 'put your unique phrase here'); + define('SECURE_AUTH_SALT', 'put your unique phrase here'); + define('LOGGED_IN_SALT', 'put your unique phrase here'); + define('NONCE_SALT', 'put your unique phrase here'); + + /**#@-*/ + + /** + * WordPress Database Table prefix. + * + * You can have multiple installations in one database if you give each a unique + * prefix. Only numbers, letters, and underscores please! + */ + $table_prefix = 'wp_'; + + /** + * WordPress Localized Language, defaults to English. + * + * Change this to localize WordPress. A corresponding MO file for the chosen + * language must be installed to wp-content/languages. For example, install + * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German + * language support. + */ + define('WPLANG', ''); + + /** + * For developers: WordPress debugging mode. + * + * Change this to true to enable the display of notices during development. + * It is strongly recommended that plugin and theme developers use WP_DEBUG + * in their development environments. + */ + define('WP_DEBUG', false); + + /* That's all, stop editing! Happy blogging. */ + + /** Absolute path to the WordPress directory. */ + if ( !defined('ABSPATH') ) + define('ABSPATH', dirname(__FILE__) . '/'); + + /** Sets up WordPress vars and included files. */ + require_once(ABSPATH . 'wp-settings.php'); + """ + + return false; + } + +} diff --git a/src/com/mostc/pftt/scenario/WordpressScenario.java b/src/com/mostc/pftt/scenario/WordpressScenario.java deleted file mode 100644 index 7691671..0000000 --- a/src/com/mostc/pftt/scenario/WordpressScenario.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.mostc.pftt.scenario; - -import com.mostc.pftt.host.Host; -import com.mostc.pftt.model.phpt.PhpBuild; -import com.mostc.pftt.results.ConsoleManager; - -/** WordPress is a free and open source blogging tool and a content management system (CMS) - * based on PHP and MySQL. It has many features including a plug-in architecture and a - * template system. - * - * @see http://wordpress.org/ - * - */ - -public class WordpressScenario extends ZipDbApplication { - - @Override - public String getName() { - return "Wordpress"; - } - - @Override - public boolean isImplemented() { - return false; - } - - @Override - protected String getZipAppFileName() { - return "wordpress-3.5.zip"; - } - - @Override - protected boolean configure(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set, String app_dir) { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/src/com/mostc/pftt/scenario/ZipApplication.java b/src/com/mostc/pftt/scenario/ZipApplication.java index d367d15..348f839 100644 --- a/src/com/mostc/pftt/scenario/ZipApplication.java +++ b/src/com/mostc/pftt/scenario/ZipApplication.java @@ -8,15 +8,14 @@ public abstract class ZipApplication extends ApplicationScenario { @Override public boolean setup(ConsoleManager cm, Host host, PhpBuild build, ScenarioSet scenario_set) { - if (!scenario_set.contains(AbstractWebServerScenario.class)) { + AbstractWebServerScenario web = AbstractWebServerScenario.getWebServerScenario(scenario_set); + if (web == null) { cm.println(getClass(), "add a web server (ex: apache) to -config console option and try again"); return false; } String zip_file = getZipAppFileName(); - AbstractWebServerScenario web; - String app_dir = host.joinIntoOnePath(web.getDefaultDocroot(host, build), Host.removeFileExt(Host.basename(zip_file))); if (!host.exists(app_dir)) { diff --git a/src/com/mostc/pftt/util/DebuggerManager.java b/src/com/mostc/pftt/util/DebuggerManager.java index 5dde96c..99092d6 100644 --- a/src/com/mostc/pftt/util/DebuggerManager.java +++ b/src/com/mostc/pftt/util/DebuggerManager.java @@ -60,13 +60,13 @@ public abstract class DebuggerManager { if (!host.isWindows()) { // only PHP on Windows has standard conventions for naming/locating source and debug packs this.src_path = cm.getSourcePack(); - this.debug_path = cm.getDebugPack(); + this.debug_path = cm.getDebugPack().getPath(); return; } // use any source and debug packs given on command line String def_source_path = cm.getSourcePack(); - String def_debug_path = cm.getDebugPack(); + String def_debug_path = cm.getDebugPack().getPath(); // (in addition to )guessing the source pack and debug pack from the build (PHP-on-Windows follows conventions that allow this) try { diff --git a/src/com/mostc/pftt/util/WindowsSnapshotDownloadUtil.groovy b/src/com/mostc/pftt/util/WindowsSnapshotDownloadUtil.groovy index e229352..cdf81aa 100644 --- a/src/com/mostc/pftt/util/WindowsSnapshotDownloadUtil.groovy +++ b/src/com/mostc/pftt/util/WindowsSnapshotDownloadUtil.groovy @@ -47,6 +47,8 @@ final class WindowsSnapshotDownloadUtil { if (local_path==null) { // fallback: store in directory named after URL: php-sdk/<url>/<build> local_path = url.getHost()+"_"+url.getPath().replaceAll("/", "_"); + } else if (local_path.toLowerCase().endsWith(".zip")) { + local_path = local_path.substring(0, local_path.length()-".zip".length()); } return new File(host.getPhpSdkDir()+"/"+local_path); } @@ -84,15 +86,15 @@ final class WindowsSnapshotDownloadUtil { String xml_str = new SimpleXmlSerializer(cleaner.getProperties()).getXmlAsString(node); def root = new XmlSlurper(false, false).parseText(xml_str); - def build_url = null, test_pack_url = null; + def build_url = null, test_pack_url = null, debug_pack_url = null; root.depthFirst().findAll { if (it.name() == 'a') { if (it.text().endsWith(".zip")&&it.text().toLowerCase().contains("-test-")) { test_pack_url = it['@href'] + } else if (it.text().endsWith(".zip")&&it.text().toLowerCase().contains("-"+build_type.toString().toLowerCase()+"-")&&it.text().toLowerCase().contains("-debug-")) { + debug_pack_url = it['@href'] } else if (it.text().toLowerCase().contains("-devel-")) { // ignore - } else if (it.text().toLowerCase().contains("-debug-")) { - // ignore } else if (it.text().endsWith(".zip")&&it.text().toLowerCase().contains("-"+build_type.toString().toLowerCase()+"-")) { build_url = it['@href']; } @@ -106,11 +108,13 @@ final class WindowsSnapshotDownloadUtil { pair.build = new URL("http://"+snap_url.getHost()+"/"+build_url); if (test_pack_url!=null) pair.test_pack = new URL("http://"+snap_url.getHost()+"/"+test_pack_url); + if (test_pack_url!=null) + pair.debug_pack = new URL("http://"+snap_url.getHost()+"/"+debug_pack_url); return pair; } static class FindBuildTestPackPair { - URL build, test_pack; + URL build, test_pack, debug_pack; EBuildType build_type; EBuildBranch branch; }