dependabot-linguist 0.0.1 → 0.212.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +25 -3
- data/Gemfile +0 -9
- data/Gemfile.lock +162 -5
- data/LICENSE +674 -1
- data/{LICENSE.Nonstandard → LICENSE.dependabot-core} +0 -0
- data/Makefile +8 -1
- data/README.md +39 -5
- data/demo_script.rb +50 -0
- data/dependabot-linguist.gemspec +16 -5
- data/devlog.md +186 -0
- data/exe/dependabot-linguist +145 -0
- data/lib/dependabot/linguist/dependabot_file_validator.rb +190 -0
- data/lib/dependabot/linguist/dependabot_patch.rb +8 -0
- data/lib/dependabot/linguist/file_fetchers/base.rb +48 -0
- data/lib/dependabot/linguist/file_fetchers/git_submodules.rb +63 -0
- data/lib/dependabot/linguist/file_fetchers/go_modules.rb +41 -0
- data/lib/dependabot/linguist/language.rb +62 -0
- data/lib/dependabot/linguist/languages_to_ecosystems/contexts.rb +234 -0
- data/lib/dependabot/linguist/languages_to_ecosystems/contexts_applied.rb +36 -0
- data/lib/dependabot/linguist/languages_to_ecosystems/languages.yaml +7950 -0
- data/lib/dependabot/linguist/languages_to_ecosystems/main.rb +55 -0
- data/lib/dependabot/linguist/languages_to_ecosystems/manager_ecosystem_maps.rb +154 -0
- data/lib/dependabot/linguist/languages_to_patch.txt +37 -0
- data/lib/dependabot/linguist/linguist_patch.rb +6 -0
- data/lib/dependabot/linguist/repository.rb +232 -0
- data/lib/dependabot/linguist/version.rb +1 -1
- data/lib/dependabot/linguist.rb +5 -2
- data/smoke-test/README.md +58 -0
- data/smoke-test/bundler/Gemfile +9 -0
- data/smoke-test/bundler/Gemfile.lock +47 -0
- data/smoke-test/bundler/dependabot-all-updates-test-staging.gemspec +10 -0
- data/smoke-test/cargo/Cargo.lock +90 -0
- data/smoke-test/cargo/Cargo.toml +8 -0
- data/smoke-test/composer/composer.json +5 -0
- data/smoke-test/composer/composer.lock +72 -0
- data/smoke-test/composer/vendor/autoload.php +7 -0
- data/smoke-test/composer/vendor/composer/ClassLoader.php +445 -0
- data/smoke-test/composer/vendor/composer/LICENSE +21 -0
- data/smoke-test/composer/vendor/composer/autoload_classmap.php +13 -0
- data/smoke-test/composer/vendor/composer/autoload_namespaces.php +9 -0
- data/smoke-test/composer/vendor/composer/autoload_psr4.php +9 -0
- data/smoke-test/composer/vendor/composer/autoload_real.php +55 -0
- data/smoke-test/composer/vendor/composer/autoload_static.php +23 -0
- data/smoke-test/composer/vendor/composer/installed.json +57 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/.gitignore +3 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/LICENSE +504 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/README.md +112 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/changelog.md +530 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/class.phpmailer.php +2758 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/class.pop3.php +417 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/class.smtp.php +1075 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/composer.json +32 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/Callback_function_notes.txt +17 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/DomainKeys_notes.txt +55 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/Note_for_SMTP_debugging.txt +23 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/extending.html +148 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/faq.html +67 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/generatedocs.sh +4 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/pop3_article.txt +39 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/use_gmail.txt +44 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/contents.html +20 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/images/phpmailer.gif +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.gif +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/index.html +50 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_db_smtp_basic.php +58 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_mail_advanced.php +30 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_mail_basic.php +41 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_pop_before_smtp_advanced.php +39 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_pop_before_smtp_basic.php +49 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_sendmail_advanced.php +33 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_sendmail_basic.php +43 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_smtp_advanced.php +42 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_smtp_advanced_no_auth.php +36 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_smtp_basic.php +58 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_smtp_basic_no_auth.php +53 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_smtp_gmail_advanced.php +42 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_smtp_gmail_basic.php +59 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/extras/class.html2text.inc +489 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/extras/htmlfilter.php +861 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/extras/ntlm_sasl_client.php +185 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php +26 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-br.php +25 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php +25 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php +25 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-cz.php +24 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php +24 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-dk.php +25 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php +25 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php +25 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php +26 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php +26 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +24 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php +24 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php +26 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +25 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php +24 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-no.php +24 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php +24 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php +26 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php +24 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-se.php +25 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php +25 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +26 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php +25 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php +25 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test/contents.html +10 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test/phpmailerTest.php +1084 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test/test.png +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test/test_callback.php +84 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test/testemail.php +48 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/LGPLv3.txt +165 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/contents.html +14 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/images/aikido.gif +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/images/bkgrnd.gif +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/images/phpmailer.gif +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/index.php +427 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/clipboard.swf +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushBash.js +59 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushCSharp.js +64 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushCpp.js +99 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushCss.js +93 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushDelphi.js +57 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushDiff.js +43 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushGroovy.js +69 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushJScript.js +51 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushJava.js +55 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushPerl.js +74 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushPhp.js +91 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushPlain.js +35 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushPython.js +56 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushRuby.js +57 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushScala.js +53 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushSql.js +68 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushVb.js +58 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushXml.js +71 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shCore.js +30 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shLegacy.js +30 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/src/shCore.js +1949 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/src/shLegacy.js +172 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/help.png +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/magnifier.png +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/page_white_code.png +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/page_white_copy.png +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/printer.png +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shCore.css +321 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shThemeDefault.css +191 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shThemeDjango.css +193 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shThemeEmacs.css +192 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shThemeFadeToGrey.css +193 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shThemeMidnight.css +192 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shThemeRDark.css +192 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/wrapping.png +0 -0
- data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/test.html +46 -0
- data/smoke-test/dependabot-file/no-config/.github/TARGET.yaml +14 -0
- data/smoke-test/dependabot-file/no-config/bundler/Gemfile +9 -0
- data/smoke-test/dependabot-file/no-config/bundler/Gemfile.lock +47 -0
- data/smoke-test/dependabot-file/no-config/bundler/dependabot-all-updates-test-staging.gemspec +10 -0
- data/smoke-test/dependabot-file/no-config/cargo/Cargo.lock +90 -0
- data/smoke-test/dependabot-file/no-config/cargo/Cargo.toml +8 -0
- data/smoke-test/dependabot-file/no-config/composer/composer.json +5 -0
- data/smoke-test/dependabot-file/no-config/composer/composer.lock +72 -0
- data/smoke-test/dependabot-file/over-config/.github/TARGET.yaml +17 -0
- data/smoke-test/dependabot-file/over-config/.github/dependabot.yaml +12 -0
- data/smoke-test/dependabot-file/over-config/bundler/Gemfile +9 -0
- data/smoke-test/dependabot-file/over-config/bundler/Gemfile.lock +47 -0
- data/smoke-test/dependabot-file/over-config/bundler/dependabot-all-updates-test-staging.gemspec +10 -0
- data/smoke-test/dependabot-file/over-config/cargo/Cargo.lock +90 -0
- data/smoke-test/dependabot-file/over-config/cargo/Cargo.toml +8 -0
- data/smoke-test/dependabot-file/over-config/composer/composer.json +5 -0
- data/smoke-test/dependabot-file/over-config/composer/composer.lock +72 -0
- data/smoke-test/dependabot-file/overer-config/.github/TARGET.yaml +19 -0
- data/smoke-test/dependabot-file/overer-config/.github/dependabot.yaml +12 -0
- data/smoke-test/dependabot-file/overer-config/bundler/Gemfile +9 -0
- data/smoke-test/dependabot-file/overer-config/bundler/Gemfile.lock +47 -0
- data/smoke-test/dependabot-file/overer-config/bundler/dependabot-all-updates-test-staging.gemspec +10 -0
- data/smoke-test/dependabot-file/overer-config/cargo/Cargo.lock +90 -0
- data/smoke-test/dependabot-file/overer-config/cargo/Cargo.toml +8 -0
- data/smoke-test/dependabot-file/overer-config/composer/composer.json +5 -0
- data/smoke-test/dependabot-file/overer-config/composer/composer.lock +72 -0
- data/smoke-test/dependabot-file/partial-config/.github/TARGET.yaml +17 -0
- data/smoke-test/dependabot-file/partial-config/.github/dependabot.yaml +7 -0
- data/smoke-test/dependabot-file/partial-config/bundler/Gemfile +9 -0
- data/smoke-test/dependabot-file/partial-config/bundler/Gemfile.lock +47 -0
- data/smoke-test/dependabot-file/partial-config/bundler/dependabot-all-updates-test-staging.gemspec +10 -0
- data/smoke-test/dependabot-file/partial-config/cargo/Cargo.lock +90 -0
- data/smoke-test/dependabot-file/partial-config/cargo/Cargo.toml +8 -0
- data/smoke-test/dependabot-file/partial-config/composer/composer.json +5 -0
- data/smoke-test/dependabot-file/partial-config/composer/composer.lock +72 -0
- data/smoke-test/docker/Dockerfile +19 -0
- data/smoke-test/elm/elm-package.json +15 -0
- data/smoke-test/elm/elm.json +31 -0
- data/smoke-test/github-actions/both/.github/workflows/this.yaml +11 -0
- data/smoke-test/github-actions/both/yaml/action.yml +13 -0
- data/smoke-test/github-actions/invalid/invalid_file.yaml +0 -0
- data/smoke-test/github-actions/workflow/.github/workflows/this.yaml +11 -0
- data/smoke-test/github-actions/yaml/action.yml +13 -0
- data/smoke-test/gitsubmodule/.gitmodules +4 -0
- data/smoke-test/gomod/go.mod +16 -0
- data/smoke-test/gomod/go.sum +18 -0
- data/smoke-test/gomod/gomain.go +14 -0
- data/smoke-test/gradle/.gitignore +1 -0
- data/smoke-test/gradle/build.gradle +65 -0
- data/smoke-test/maven/pom.xml +65 -0
- data/smoke-test/mix/mix.exs +24 -0
- data/smoke-test/mix/mix.lock +5 -0
- data/smoke-test/npm/package-lock.json +166 -0
- data/smoke-test/npm/package.json +22 -0
- data/smoke-test/npm/removed/package-lock.json +44 -0
- data/smoke-test/npm/removed/package.json +15 -0
- data/smoke-test/nuget/project.csproj +14 -0
- data/smoke-test/pip/pip/requirements.txt +5 -0
- data/smoke-test/pip/pip-compile/requirements.in +2 -0
- data/smoke-test/pip/pip-compile/requirements.txt +16 -0
- data/smoke-test/pip/pipenv/Pipfile +13 -0
- data/smoke-test/pip/pipenv/Pipfile.lock +86 -0
- data/smoke-test/pip/poetry/poetry.lock +33 -0
- data/smoke-test/pip/poetry/pyproject.toml +18 -0
- data/smoke-test/pub/pubspec.lock +40 -0
- data/smoke-test/pub/pubspec.yaml +10 -0
- data/smoke-test/terraform/main.tf +143 -0
- metadata +314 -6
- data/LICENSE.GPL-3.0-only +0 -674
@@ -0,0 +1,427 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
5
|
+
<title>PHPMailer Test Page</title>
|
6
|
+
<script type="text/javascript" src="scripts/shCore.js"></script>
|
7
|
+
<script type="text/javascript" src="scripts/shBrushPhp.js"></script>
|
8
|
+
<link type="text/css" rel="stylesheet" href="styles/shCore.css"/>
|
9
|
+
<link type="text/css" rel="stylesheet" href="styles/shThemeDefault.css"/>
|
10
|
+
<script type="text/javascript">
|
11
|
+
SyntaxHighlighter.config.clipboardSwf = 'scripts/clipboard.swf';
|
12
|
+
SyntaxHighlighter.all();
|
13
|
+
</script>
|
14
|
+
</head>
|
15
|
+
<body >
|
16
|
+
<?php
|
17
|
+
|
18
|
+
echo 'Current PHP version: ' . phpversion() . "<br />";
|
19
|
+
|
20
|
+
if ( substr(phpversion(),0,1) < 5 ) { echo exit("ERROR: Wrong PHP version"); }
|
21
|
+
|
22
|
+
$CFG['smtp_debug'] = 1;
|
23
|
+
$CFG['smtp_server'] = 'mail.yourserver.com';
|
24
|
+
$CFG['smtp_port'] = '25';
|
25
|
+
$CFG['smtp_authenticate'] = 'true';
|
26
|
+
$CFG['smtp_username'] = 'name@yourserver.com';
|
27
|
+
$CFG['smtp_password'] = 'yourpassword';
|
28
|
+
|
29
|
+
if ( $_POST['submit'] == "Submit" ) {
|
30
|
+
|
31
|
+
class phpmailerAppException extends Exception {
|
32
|
+
public function errorMessage() {
|
33
|
+
$errorMsg = '<strong>' . $this->getMessage() . "</strong><br />";
|
34
|
+
return $errorMsg;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
try {
|
39
|
+
$to = $_POST['To_Email'];
|
40
|
+
if(filter_var($to, FILTER_VALIDATE_EMAIL) === FALSE) {
|
41
|
+
throw new phpmailerAppException("Email address " . $to . " is invalid -- aborting!<br />");
|
42
|
+
}
|
43
|
+
} catch (phpmailerAppException $e) {
|
44
|
+
echo $e->errorMessage();
|
45
|
+
return false;
|
46
|
+
}
|
47
|
+
|
48
|
+
require_once("../class.phpmailer.php");
|
49
|
+
|
50
|
+
$mail = new PHPMailer();
|
51
|
+
|
52
|
+
if ( $_POST['Message'] == '' ) {
|
53
|
+
$body = file_get_contents('contents.html');
|
54
|
+
} else {
|
55
|
+
$body = $_POST['Message'];
|
56
|
+
}
|
57
|
+
|
58
|
+
if ( $_POST['test_type'] == "smtp" ) {
|
59
|
+
$mail->IsSMTP(); // telling the class to use SMTP
|
60
|
+
$mail->SMTPDebug = $_POST['smtp_debug'];
|
61
|
+
$mail->SMTPAuth = $_POST['smtp_authenticate']; // enable SMTP authentication
|
62
|
+
$mail->Port = $_POST['smtp_port']; // set the SMTP port
|
63
|
+
$mail->Host = $_POST['smtp_server']; // SMTP server
|
64
|
+
$mail->Username = $_POST['authenticate_username']; // SMTP account username
|
65
|
+
$mail->Password = $_POST['authenticate_password']; // SMTP account password
|
66
|
+
} elseif ( $_POST['test_type'] == "mail" ) {
|
67
|
+
$mail->IsMail(); // telling the class to use PHP's Mail()
|
68
|
+
} elseif ( $_POST['test_type'] == "sendmail" ) {
|
69
|
+
$mail->IsSendmail(); // telling the class to use Sendmail
|
70
|
+
} elseif ( $_POST['test_type'] == "qmail" ) {
|
71
|
+
$mail->IsQmail(); // telling the class to use Qmail
|
72
|
+
}
|
73
|
+
|
74
|
+
if ( $_POST['From_Name'] != '' ) {
|
75
|
+
$mail->AddReplyTo($_POST['From_Email'],$_POST['From_Name']);
|
76
|
+
$mail->From = $_POST['From_Email'];
|
77
|
+
$mail->FromName = $_POST['From_Name'];
|
78
|
+
} else {
|
79
|
+
$mail->AddReplyTo($_POST['From_Email']);
|
80
|
+
$mail->From = $_POST['From_Email'];
|
81
|
+
$mail->FromName = $_POST['From_Email'];
|
82
|
+
}
|
83
|
+
|
84
|
+
if ( $_POST['To_Name'] != '' ) {
|
85
|
+
$mail->AddAddress($to,$_POST['To_Name']);
|
86
|
+
} else {
|
87
|
+
$mail->AddAddress($to);
|
88
|
+
}
|
89
|
+
|
90
|
+
if ( $_POST['bcc_Email'] != '' ) {
|
91
|
+
$indiBCC = explode(" ", $_POST['bcc_Email']);
|
92
|
+
foreach ($indiBCC as $key => $value) {
|
93
|
+
$mail->AddBCC($value);
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
if ( $_POST['cc_Email'] != '' ) {
|
98
|
+
$indiCC = explode(" ", $_POST['cc_Email']);
|
99
|
+
foreach ($indiCC as $key => $value) {
|
100
|
+
$mail->AddCC($value);
|
101
|
+
}
|
102
|
+
}
|
103
|
+
|
104
|
+
$mail->Subject = $_POST['Subject'] . ' (PHPMailer test using ' . strtoupper($_POST['test_type']) . ')';
|
105
|
+
|
106
|
+
// below can be found at http://www.chuggnutt.com/html2text
|
107
|
+
// bundled in ./extras/
|
108
|
+
require_once('../class.html2text.inc');
|
109
|
+
$h2t =& new html2text($body);
|
110
|
+
$mail->AltBody = $h2t->get_text();
|
111
|
+
//$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
|
112
|
+
$mail->WordWrap = 80; // set word wrap
|
113
|
+
|
114
|
+
$mail->MsgHTML($body);
|
115
|
+
|
116
|
+
// $mail->IsHTML(true); // send as HTML
|
117
|
+
|
118
|
+
$mail->AddAttachment("images/aikido.gif", "aikido.gif"); // optional name
|
119
|
+
$mail->AddAttachment("images/phpmailer.gif", "phpmailer.gif"); // optional name
|
120
|
+
|
121
|
+
try {
|
122
|
+
if ( !$mail->Send() ) {
|
123
|
+
$error = "Unable to send to: " . $to . "<br />";
|
124
|
+
throw new phpmailerAppException($error);
|
125
|
+
} else {
|
126
|
+
echo 'Message has been sent using ' . strtoupper($_POST['test_type']) . "<br /><br />";
|
127
|
+
}
|
128
|
+
}
|
129
|
+
catch (phpmailerAppException $e) {
|
130
|
+
$errorMsg[] = $e->errorMessage();
|
131
|
+
}
|
132
|
+
|
133
|
+
if ( count($errorMsg) > 0 ) {
|
134
|
+
foreach ($errorMsg as $key => $value) {
|
135
|
+
$thisError = $key + 1;
|
136
|
+
echo $thisError . ': ' . $value;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
?>
|
140
|
+
<form method="POST" enctype="multipart/form-data">
|
141
|
+
<?php $value = ( $_POST['From_Name'] != '' ) ? $_POST['From_Name'] : ''; ?>
|
142
|
+
<input type="hidden" name="From_Name" value="<?php echo $value; ?>">
|
143
|
+
<?php $value = ( $_POST['From_Email'] != '' ) ? $_POST['From_Email'] : ''; ?>
|
144
|
+
<input type="hidden" name="From_Email" value="<?php echo $value; ?>">
|
145
|
+
<?php $value = ( $_POST['To_Name'] != '' ) ? $_POST['To_Name'] : ''; ?>
|
146
|
+
<input type="hidden" name="To_Name" value="<?php echo $value; ?>">
|
147
|
+
<?php $value = ( $_POST['To_Email'] != '' ) ? $_POST['To_Email'] : ''; ?>
|
148
|
+
<input type="hidden" name="To_Email" value="<?php echo $value; ?>">
|
149
|
+
<?php $value = ( $_POST['cc_Email'] != '' ) ? $_POST['cc_Email'] : ''; ?>
|
150
|
+
<input type="hidden" name="cc_Email" value="<?php echo $value; ?>">
|
151
|
+
<?php $value = ( $_POST['bcc_Email'] != '' ) ? $_POST['bcc_Email'] : ''; ?>
|
152
|
+
<input type="hidden" name="bcc_Email" value="<?php echo $value; ?>">
|
153
|
+
<?php $value = ( $_POST['Subject'] != '' ) ? $_POST['Subject'] : ''; ?>
|
154
|
+
<input type="hidden" name="Subject" value="<?php echo $value; ?>">
|
155
|
+
<?php $value = ( $_POST['Message'] != '' ) ? $_POST['Message'] : ''; ?>
|
156
|
+
<input type="hidden" name="Message" value="<?php echo $value; ?>">
|
157
|
+
<?php $value = ( $_POST['test_type'] != '' ) ? $_POST['test_type'] : 'mail'; ?>
|
158
|
+
<input type="hidden" name="test_type" value="<?php echo $value; ?>">
|
159
|
+
<?php $value = ( $_POST['smtp_debug'] != '' ) ? $_POST['smtp_debug'] : $CFG['smtp_debug']; ?>
|
160
|
+
<input type="hidden" name="smtp_debug" value="<?php echo $value; ?>">
|
161
|
+
<?php $value = ( $_POST['smtp_server'] != '' ) ? $_POST['smtp_server'] : $CFG['smtp_server']; ?>
|
162
|
+
<input type="hidden" name="smtp_server" value="<?php echo $value; ?>">
|
163
|
+
<?php $value = ( $_POST['smtp_port'] != '' ) ? $_POST['smtp_port'] : $CFG['smtp_port']; ?>
|
164
|
+
<input type="hidden" name="smtp_port" value="<?php echo $value; ?>">
|
165
|
+
<?php $value = ( $_POST['smtp_authenticate'] != '' ) ? $_POST['smtp_authenticate'] : $CFG['smtp_authenticate']; ?>
|
166
|
+
<input type="hidden" name="smtp_authenticate" value="<?php echo $value; ?>">
|
167
|
+
<?php $value = ( $_POST['authenticate_username'] != '' ) ? $_POST['authenticate_username'] : $CFG['smtp_username']; ?>
|
168
|
+
<input type="hidden" name="authenticate_username" value="<?php echo $value; ?>">
|
169
|
+
<?php $value = ( $_POST['authenticate_password'] != '' ) ? $_POST['authenticate_password'] : $CFG['smtp_password']; ?>
|
170
|
+
<input type="hidden" name="authenticate_password" value="<?php echo $value; ?>">
|
171
|
+
<input type="submit" value="Start Over" name="submit">
|
172
|
+
</form><br />
|
173
|
+
<br />
|
174
|
+
Script:<br />
|
175
|
+
<pre class="brush: php;">
|
176
|
+
class phpmailerAppException extends Exception {
|
177
|
+
public function errorMessage() {
|
178
|
+
$errorMsg = '<strong>' . $this->getMessage() . "</strong><br />";
|
179
|
+
return $errorMsg;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
try {
|
184
|
+
$to = <?php echo $_POST['To_Email']; ?>;
|
185
|
+
if(filter_var($to, FILTER_VALIDATE_EMAIL) === FALSE) {
|
186
|
+
throw new phpmailerAppException("Email address " . $to . " is invalid -- aborting!<br />");
|
187
|
+
}
|
188
|
+
} catch (phpmailerAppException $e) {
|
189
|
+
echo $e->errorMessage();
|
190
|
+
return false;
|
191
|
+
}
|
192
|
+
|
193
|
+
require_once("../class.phpmailer.php");
|
194
|
+
|
195
|
+
$mail = new PHPMailer();
|
196
|
+
|
197
|
+
<?php
|
198
|
+
if ( $_POST['Message'] == '' ) {
|
199
|
+
echo '$body = file_get_contents(\'contents.html\');' . "\n";
|
200
|
+
} else {
|
201
|
+
echo '$body = ' . $_POST['Message'] . "\n";
|
202
|
+
}
|
203
|
+
|
204
|
+
echo "\n";
|
205
|
+
|
206
|
+
if ( $_POST['test_type'] == "smtp" ) {
|
207
|
+
echo '$mail->IsSMTP(); // telling the class to use SMTP' . "\n";
|
208
|
+
echo '$mail->SMTPDebug = ' . $_POST['smtp_debug'] . "\n";
|
209
|
+
echo '$mail->SMTPAuth = ' . $_POST['smtp_authenticate']; // enable SMTP authentication' . "\n";
|
210
|
+
echo '$mail->Port = ' . $_POST['smtp_port']; // set the SMTP port' . "\n";
|
211
|
+
echo '$mail->Host = ' . $_POST['smtp_server']; // SMTP server' . "\n";
|
212
|
+
echo '$mail->Username = ' . $_POST['authenticate_username']; // SMTP account username' . "\n";
|
213
|
+
echo '$mail->Password = ' . $_POST['authenticate_password']; // SMTP account password' . "\n";
|
214
|
+
} elseif ( $_POST['test_type'] == "mail" ) {
|
215
|
+
echo '$mail->IsMail(); // telling the class to use PHP\'s Mail()' . "\n";
|
216
|
+
} elseif ( $_POST['test_type'] == "sendmail" ) {
|
217
|
+
echo '$mail->IsSendmail(); // telling the class to use Sendmail' . "\n";
|
218
|
+
} elseif ( $_POST['test_type'] == "qmail" ) {
|
219
|
+
echo '$mail->IsQmail(); // telling the class to use Qmail' . "\n";
|
220
|
+
}
|
221
|
+
?>
|
222
|
+
|
223
|
+
$mail->AddReplyTo('<?php echo $_POST['From_Email']; ?>','<?php echo $_POST['From_Name']; ?>');
|
224
|
+
|
225
|
+
$mail->From = '<?php echo $_POST['From_Email']; ?>';
|
226
|
+
$mail->FromName = '<?php echo $_POST['From_Name']; ?>';
|
227
|
+
|
228
|
+
<?php
|
229
|
+
if ( $_POST['To_Name'] != '' ) {
|
230
|
+
?>
|
231
|
+
$mail->AddAddress('<?php echo $to; ?>','<?php echo $_POST['To_Name']; ?>');
|
232
|
+
<?php
|
233
|
+
} else {
|
234
|
+
?>
|
235
|
+
$mail->AddAddress('<?php echo $to; ?>');
|
236
|
+
<?php
|
237
|
+
}
|
238
|
+
if ( $_POST['bcc_Email'] != '' ) {
|
239
|
+
$indiBCC = explode(" ", $_POST['bcc_Email']);
|
240
|
+
foreach ($indiBCC as $key => $value) {
|
241
|
+
echo '$mail->AddBCC(\'' . $value . '\');<br />';
|
242
|
+
}
|
243
|
+
}
|
244
|
+
|
245
|
+
if ( $_POST['cc_Email'] != '' ) {
|
246
|
+
$indiCC = explode(" ", $_POST['cc_Email']);
|
247
|
+
foreach ($indiCC as $key => $value) {
|
248
|
+
echo '$mail->AddCC(\'' . $value . '\');<br />';
|
249
|
+
}
|
250
|
+
}
|
251
|
+
?>
|
252
|
+
|
253
|
+
$mail->Subject = <?php echo $_POST['Subject']; ?> (PHPMailer test using <?php echo strtoupper($_POST['test_type']); ?>)
|
254
|
+
|
255
|
+
require_once('../class.html2text.inc');
|
256
|
+
$h2t =& new html2text($body);
|
257
|
+
$mail->AltBody = $h2t->get_text();
|
258
|
+
$mail->WordWrap = 80; // set word wrap
|
259
|
+
|
260
|
+
$mail->MsgHTML($body);
|
261
|
+
|
262
|
+
$mail->AddAttachment("images/aikido.gif", "aikido.gif"); // optional name
|
263
|
+
$mail->AddAttachment("images/phpmailer.gif", "phpmailer.gif"); // optional name
|
264
|
+
|
265
|
+
try {
|
266
|
+
if ( !$mail->Send() ) {
|
267
|
+
$error = "Unable to send to: " . $to . "<br />";
|
268
|
+
throw new phpmailerAppException($error);
|
269
|
+
} else {
|
270
|
+
echo 'Message has been sent using <?php echo strtoupper($_POST['test_type']); ?><br /><br />';
|
271
|
+
}
|
272
|
+
} catch (phpmailerAppException $e) {
|
273
|
+
$errorMsg[] = $e->errorMessage();
|
274
|
+
}
|
275
|
+
|
276
|
+
if ( count($errorMsg) > 0 ) {
|
277
|
+
foreach ($errorMsg as $key => $value) {
|
278
|
+
$thisError = $key + 1;
|
279
|
+
echo $thisError . ': ' . $value;
|
280
|
+
}
|
281
|
+
}
|
282
|
+
</pre>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
<?php
|
287
|
+
} else {
|
288
|
+
?>
|
289
|
+
<style>
|
290
|
+
body {
|
291
|
+
font-family: Arial, Helvetica, Sans-Serif;
|
292
|
+
font-size: 11px;
|
293
|
+
}
|
294
|
+
td {
|
295
|
+
font-size: 11px;
|
296
|
+
}
|
297
|
+
td.colleft {
|
298
|
+
align: right;
|
299
|
+
text-align: right;
|
300
|
+
width: 30%;
|
301
|
+
}
|
302
|
+
td.colrite {
|
303
|
+
text-align: left;
|
304
|
+
width: 70%;
|
305
|
+
}
|
306
|
+
</style>
|
307
|
+
<form method="POST" enctype="multipart/form-data">
|
308
|
+
<table border="1" width="900" cellspacing="0" cellpadding="5" style="border-collapse: collapse" bgcolor="#C0C0C0">
|
309
|
+
<tr>
|
310
|
+
<td valign="top";><strong>Message</strong><br /><br />
|
311
|
+
<table border="1" width="450" cellspacing="0" cellpadding="5" style="border-collapse: collapse;" bgcolor="#FFFFFF">
|
312
|
+
<tr>
|
313
|
+
<td class="colleft">From Name</td>
|
314
|
+
<?php $value = ( $_POST['From_Name'] != '' ) ? $_POST['From_Name'] : ''; ?>
|
315
|
+
<td class="colrite"><input type="text" name="From_Name" value="<?php echo $value; ?>" style="width:99%;"></td>
|
316
|
+
</tr>
|
317
|
+
<tr>
|
318
|
+
<td class="colleft">From Email Address</td>
|
319
|
+
<?php $value = ( $_POST['From_Email'] != '' ) ? $_POST['From_Email'] : ''; ?>
|
320
|
+
<td class="colrite"><input type="text" name="From_Email" value="<?php echo $value; ?>" style="width:99%;"></td>
|
321
|
+
</tr>
|
322
|
+
<tr>
|
323
|
+
<td class="colleft">To Name</td>
|
324
|
+
<?php $value = ( $_POST['To_Name'] != '' ) ? $_POST['To_Name'] : ''; ?>
|
325
|
+
<td class="colrite"><input type="text" name="To_Name" value="<?php echo $value; ?>" style="width:99%;"></td>
|
326
|
+
</tr>
|
327
|
+
<tr>
|
328
|
+
<td class="colleft">To Email Address</td>
|
329
|
+
<?php $value = ( $_POST['To_Email'] != '' ) ? $_POST['To_Email'] : ''; ?>
|
330
|
+
<td class="colrite"><input type="text" name="To_Email" value="<?php echo $value; ?>" style="width:99%;"></td>
|
331
|
+
</tr>
|
332
|
+
<tr>
|
333
|
+
<td class="colleft">cc Email Addresses <small>(separate with commas)</small></td>
|
334
|
+
<?php $value = ( $_POST['cc_Email'] != '' ) ? $_POST['cc_Email'] : ''; ?>
|
335
|
+
<td class="colrite"><input type="text" name="cc_Email" value="<?php echo $value; ?>" style="width:99%;"></td>
|
336
|
+
</tr>
|
337
|
+
<tr>
|
338
|
+
<td class="colleft">bcc Email Addresses <small>(separate with commas)</small></td>
|
339
|
+
<?php $value = ( $_POST['bcc_Email'] != '' ) ? $_POST['bcc_Email'] : ''; ?>
|
340
|
+
<td class="colrite"><input type="text" name="bcc_Email" value="<?php echo $value; ?>" style="width:99%;"></td>
|
341
|
+
</tr>
|
342
|
+
<tr>
|
343
|
+
<td class="colleft">Subject</td>
|
344
|
+
<?php $value = ( $_POST['Subject'] != '' ) ? $_POST['Subject'] : ''; ?>
|
345
|
+
<td class="colrite"><input type="text" name="Subject" value="<?php echo $value; ?>" style="width:99%;"></td>
|
346
|
+
</tr>
|
347
|
+
<tr>
|
348
|
+
<td class="colleft">Message<br /><small>If blank, will use content.html</small></td>
|
349
|
+
<?php $value = ( $_POST['Message'] != '' ) ? $_POST['Message'] : ''; ?>
|
350
|
+
<td class="colrite"><textarea name="Message" style="width:99%;height:50px;"><?php echo $value; ?></textarea></td>
|
351
|
+
</tr>
|
352
|
+
</table>
|
353
|
+
</td>
|
354
|
+
<td valign="top"><strong>Mail Test Specs</strong><br /><br />
|
355
|
+
<table border="1" width="450" cellspacing="0" cellpadding="5" style="border-collapse: collapse;" bgcolor="#FFFFFF">
|
356
|
+
<tr>
|
357
|
+
<td class="colleft">Test Type</td>
|
358
|
+
<td class="colrite"><table>
|
359
|
+
<tr>
|
360
|
+
<td><input type="radio" name="test_type" value="mail" <?php echo ( $_POST['test_type'] == 'mail') ? 'checked' : ''; ?>></td>
|
361
|
+
<td>Mail()</td>
|
362
|
+
</tr>
|
363
|
+
<tr>
|
364
|
+
<td><input type="radio" name="test_type" value="sendmail" <?php echo ( $_POST['test_type'] == 'sendmail') ? 'checked' : ''; ?>></td>
|
365
|
+
<td>Sendmail</td>
|
366
|
+
</tr>
|
367
|
+
<tr>
|
368
|
+
<td><input type="radio" name="test_type" value="qmail" <?php echo ( $_POST['test_type'] == 'qmail') ? 'checked' : ''; ?>></td>
|
369
|
+
<td>Qmail</td>
|
370
|
+
</tr>
|
371
|
+
<tr>
|
372
|
+
<td><input type="radio" name="test_type" value="smtp" <?php echo ( $_POST['test_type'] == 'smtp') ? 'checked' : ''; ?>></td>
|
373
|
+
<td>SMTP</td>
|
374
|
+
</tr>
|
375
|
+
</table>
|
376
|
+
</td>
|
377
|
+
</tr>
|
378
|
+
</table>
|
379
|
+
If SMTP test:<br />
|
380
|
+
<table border="1" width="450" cellspacing="0" cellpadding="5" style="border-collapse: collapse;" bgcolor="#FFFFFF">
|
381
|
+
<tr>
|
382
|
+
<td class="colleft">SMTP Debug ?</td>
|
383
|
+
<?php $value = ( $_POST['smtp_debug'] != '' ) ? $_POST['smtp_debug'] : $CFG['smtp_debug']; ?>
|
384
|
+
<td class="colrite"><select size="1" name="smtp_debug">
|
385
|
+
<option <?php echo ( $value == '0') ? 'selected' : ''; ?> value="0">0 - Disabled</option>
|
386
|
+
<option <?php echo ( $value == '1') ? 'selected' : ''; ?> value="1">1 - Errors and Messages</option>
|
387
|
+
<option <?php echo ( $value == '2') ? 'selected' : ''; ?> value="2">2 - Messages only</option>
|
388
|
+
</select></td>
|
389
|
+
</tr>
|
390
|
+
<tr>
|
391
|
+
<td class="colleft">SMTP Server</td>
|
392
|
+
<?php $value = ( $_POST['smtp_server'] != '' ) ? $_POST['smtp_server'] : $CFG['smtp_server']; ?>
|
393
|
+
<td class="colrite"><input type="text" name="smtp_server" value="<?php echo $value; ?>" style="width:99%;"></td>
|
394
|
+
</tr>
|
395
|
+
<tr>
|
396
|
+
<td class="colleft">SMTP Port</td>
|
397
|
+
<?php $value = ( $_POST['smtp_port'] != '' ) ? $_POST['smtp_port'] : $CFG['smtp_port']; ?>
|
398
|
+
<td class="colrite"><input type="text" name="smtp_port" value="<?php echo $value; ?>" style="width:99%;"></td>
|
399
|
+
</tr>
|
400
|
+
<tr>
|
401
|
+
<td class="colleft">SMTP Authenticate ?</td>
|
402
|
+
<?php $value = ( $_POST['smtp_authenticate'] != '' ) ? $_POST['smtp_authenticate'] : $CFG['smtp_authenticate']; ?>
|
403
|
+
<td class="colrite"><input type="checkbox" name="smtp_authenticate" <?php if ($value!=''){ echo "checked";} ?> value="<?php echo $value; ?>"></td>
|
404
|
+
</tr>
|
405
|
+
<tr>
|
406
|
+
<td class="colleft">Authenticate Username</td>
|
407
|
+
<?php $value = ( $_POST['authenticate_username'] != '' ) ? $_POST['authenticate_username'] : $CFG['smtp_username']; ?>
|
408
|
+
<td class="colrite"><input type="text" name="authenticate_username" value="<?php echo $value; ?>" style="width:99%;"></td>
|
409
|
+
</tr>
|
410
|
+
<tr>
|
411
|
+
<td class="colleft">Authenticate Password</td>
|
412
|
+
<?php $value = ( $_POST['authenticate_password'] != '' ) ? $_POST['authenticate_password'] : $CFG['smtp_password']; ?>
|
413
|
+
<td class="colrite"><input type="password" name="authenticate_password" value="<?php echo $value; ?>" style="width:99%;"></td>
|
414
|
+
</tr>
|
415
|
+
</table>
|
416
|
+
</td>
|
417
|
+
</tr>
|
418
|
+
</table>
|
419
|
+
<br />
|
420
|
+
Test will include two attachments, plus one of the attachments is used as an inline graphic in the message body.<br />
|
421
|
+
<br />
|
422
|
+
<input type="submit" value="Submit" name="submit">
|
423
|
+
</form>
|
424
|
+
<?php
|
425
|
+
}
|
426
|
+
|
427
|
+
?>
|
Binary file
|
@@ -0,0 +1,59 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 2.0.296 (March 01 2009)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* This file is part of SyntaxHighlighter.
|
16
|
+
*
|
17
|
+
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
18
|
+
* it under the terms of the GNU General Public License as published by
|
19
|
+
* the Free Software Foundation, either version 3 of the License, or
|
20
|
+
* (at your option) any later version.
|
21
|
+
*
|
22
|
+
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
23
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
24
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
25
|
+
* GNU General Public License for more details.
|
26
|
+
*
|
27
|
+
* You should have received a copy of the GNU General Public License
|
28
|
+
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/licenses/>.
|
29
|
+
*/
|
30
|
+
SyntaxHighlighter.brushes.Bash = function()
|
31
|
+
{
|
32
|
+
var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne gt lt ge le';
|
33
|
+
var commands = 'alias apropos awk bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
|
34
|
+
'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' +
|
35
|
+
'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
|
36
|
+
'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
|
37
|
+
'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' +
|
38
|
+
'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
|
39
|
+
'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
|
40
|
+
'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' +
|
41
|
+
'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
|
42
|
+
'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
|
43
|
+
'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' +
|
44
|
+
'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
|
45
|
+
'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
|
46
|
+
'vi watch wc whereis which who whoami Wget xargs yes'
|
47
|
+
;
|
48
|
+
|
49
|
+
this.regexList = [
|
50
|
+
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
|
51
|
+
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
|
52
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
|
53
|
+
{ regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands
|
54
|
+
];
|
55
|
+
}
|
56
|
+
|
57
|
+
SyntaxHighlighter.brushes.Bash.prototype = new SyntaxHighlighter.Highlighter();
|
58
|
+
SyntaxHighlighter.brushes.Bash.aliases = ['bash', 'shell'];
|
59
|
+
|
@@ -0,0 +1,64 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 2.0.296 (March 01 2009)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* This file is part of SyntaxHighlighter.
|
16
|
+
*
|
17
|
+
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
18
|
+
* it under the terms of the GNU General Public License as published by
|
19
|
+
* the Free Software Foundation, either version 3 of the License, or
|
20
|
+
* (at your option) any later version.
|
21
|
+
*
|
22
|
+
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
23
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
24
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
25
|
+
* GNU General Public License for more details.
|
26
|
+
*
|
27
|
+
* You should have received a copy of the GNU General Public License
|
28
|
+
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/licenses/>.
|
29
|
+
*/
|
30
|
+
SyntaxHighlighter.brushes.CSharp = function()
|
31
|
+
{
|
32
|
+
var keywords = 'abstract as base bool break byte case catch char checked class const ' +
|
33
|
+
'continue decimal default delegate do double else enum event explicit ' +
|
34
|
+
'extern false finally fixed float for foreach get goto if implicit in int ' +
|
35
|
+
'interface internal is lock long namespace new null object operator out ' +
|
36
|
+
'override params private protected public readonly ref return sbyte sealed set ' +
|
37
|
+
'short sizeof stackalloc static string struct switch this throw true try ' +
|
38
|
+
'typeof uint ulong unchecked unsafe ushort using virtual void while';
|
39
|
+
|
40
|
+
function fixComments(match, regexInfo)
|
41
|
+
{
|
42
|
+
var css = (match[0].indexOf("///") == 0)
|
43
|
+
? 'color1'
|
44
|
+
: 'comments'
|
45
|
+
;
|
46
|
+
|
47
|
+
return [new SyntaxHighlighter.Match(match[0], match.index, css)];
|
48
|
+
}
|
49
|
+
|
50
|
+
this.regexList = [
|
51
|
+
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments
|
52
|
+
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
53
|
+
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
|
54
|
+
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
|
55
|
+
{ regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
|
56
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // c# keyword
|
57
|
+
];
|
58
|
+
|
59
|
+
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
|
60
|
+
};
|
61
|
+
|
62
|
+
SyntaxHighlighter.brushes.CSharp.prototype = new SyntaxHighlighter.Highlighter();
|
63
|
+
SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp'];
|
64
|
+
|
@@ -0,0 +1,99 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 2.0.296 (March 01 2009)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* This file is part of SyntaxHighlighter.
|
16
|
+
*
|
17
|
+
* SyntaxHighlighter is free software: you can redistribute it and/or modify
|
18
|
+
* it under the terms of the GNU General Public License as published by
|
19
|
+
* the Free Software Foundation, either version 3 of the License, or
|
20
|
+
* (at your option) any later version.
|
21
|
+
*
|
22
|
+
* SyntaxHighlighter is distributed in the hope that it will be useful,
|
23
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
24
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
25
|
+
* GNU General Public License for more details.
|
26
|
+
*
|
27
|
+
* You should have received a copy of the GNU General Public License
|
28
|
+
* along with SyntaxHighlighter. If not, see <http://www.gnu.org/licenses/>.
|
29
|
+
*/
|
30
|
+
SyntaxHighlighter.brushes.Cpp = function()
|
31
|
+
{
|
32
|
+
// Copyright 2006 Shin, YoungJin
|
33
|
+
|
34
|
+
var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' +
|
35
|
+
'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' +
|
36
|
+
'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' +
|
37
|
+
'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' +
|
38
|
+
'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' +
|
39
|
+
'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' +
|
40
|
+
'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' +
|
41
|
+
'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' +
|
42
|
+
'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' +
|
43
|
+
'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' +
|
44
|
+
'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' +
|
45
|
+
'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' +
|
46
|
+
'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' +
|
47
|
+
'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' +
|
48
|
+
'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' +
|
49
|
+
'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' +
|
50
|
+
'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' +
|
51
|
+
'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' +
|
52
|
+
'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' +
|
53
|
+
'__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' +
|
54
|
+
'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' +
|
55
|
+
'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' +
|
56
|
+
'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' +
|
57
|
+
'va_list wchar_t wctrans_t wctype_t wint_t signed';
|
58
|
+
|
59
|
+
var keywords = 'break case catch class const __finally __exception __try ' +
|
60
|
+
'const_cast continue private public protected __declspec ' +
|
61
|
+
'default delete deprecated dllexport dllimport do dynamic_cast ' +
|
62
|
+
'else enum explicit extern if for friend goto inline ' +
|
63
|
+
'mutable naked namespace new noinline noreturn nothrow ' +
|
64
|
+
'register reinterpret_cast return selectany ' +
|
65
|
+
'sizeof static static_cast struct switch template this ' +
|
66
|
+
'thread throw true false try typedef typeid typename union ' +
|
67
|
+
'using uuid virtual void volatile whcar_t while';
|
68
|
+
|
69
|
+
var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' +
|
70
|
+
'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' +
|
71
|
+
'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' +
|
72
|
+
'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' +
|
73
|
+
'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' +
|
74
|
+
'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' +
|
75
|
+
'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' +
|
76
|
+
'fwrite getc getchar gets perror printf putc putchar puts remove ' +
|
77
|
+
'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' +
|
78
|
+
'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' +
|
79
|
+
'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' +
|
80
|
+
'mbtowc qsort rand realloc srand strtod strtol strtoul system ' +
|
81
|
+
'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' +
|
82
|
+
'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' +
|
83
|
+
'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' +
|
84
|
+
'clock ctime difftime gmtime localtime mktime strftime time';
|
85
|
+
|
86
|
+
this.regexList = [
|
87
|
+
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
88
|
+
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
89
|
+
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
|
90
|
+
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
|
91
|
+
{ regex: /^ *#.*/gm, css: 'preprocessor' },
|
92
|
+
{ regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' },
|
93
|
+
{ regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' },
|
94
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' }
|
95
|
+
];
|
96
|
+
};
|
97
|
+
|
98
|
+
SyntaxHighlighter.brushes.Cpp.prototype = new SyntaxHighlighter.Highlighter();
|
99
|
+
SyntaxHighlighter.brushes.Cpp.aliases = ['cpp', 'c'];
|