From 8d4fc6d507a5b640059bac757dc3f6966e46e3ca Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Tue, 5 May 2009 11:22:26 +0000 Subject: [PATCH] Merge in changes from the 5.0-dev branch --- ChangeLog.txt | 51 +- README | 27 +- aboutus.html | 169 ++ class.phpmailer.php | 1062 ++++----- class.pop3.php | 27 +- class.smtp.php | 468 +--- codeworxtech.html | 121 - examples/contents.html | 16 +- examples/images/phpmailer.png | Bin 3506 -> 0 bytes examples/index.html | 114 +- examples/pop3_before_smtp_test.php | 39 - examples/test1.php | 29 - examples/test_db_smtp_basic.php | 58 + examples/test_mail.php | 29 - examples/test_mail_advanced.php | 31 + examples/test_mail_basic.php | 43 + examples/test_pop_before_smtp_advanced.php | 40 + examples/test_pop_before_smtp_basic.php | 49 + examples/test_sendmail.php | 37 - examples/test_sendmail_advanced.php | 34 + examples/test_sendmail_basic.php | 45 + examples/test_smtp.php | 39 - examples/test_smtp_advanced.php | 43 + examples/test_smtp_advanced_no_auth.php | 37 + examples/test_smtp_basic.php | 58 + examples/test_smtp_basic_no_auth.php | 53 + examples/test_smtp_gmail_advanced.php | 43 + ...st_gmail.php => test_smtp_gmail_basic.php} | 37 +- language/phpmailer.lang-ar.php | 43 +- language/phpmailer.lang-br.php | 33 +- language/phpmailer.lang-ca.php | 34 +- language/phpmailer.lang-ch.php | 34 +- language/phpmailer.lang-cz.php | 40 +- language/phpmailer.lang-de.php | 31 +- language/phpmailer.lang-dk.php | 33 +- language/phpmailer.lang-en.php | 23 - language/phpmailer.lang-es.php | 31 +- language/phpmailer.lang-et.php | 34 +- language/phpmailer.lang-fi.php | 33 +- language/phpmailer.lang-fo.php | 36 +- language/phpmailer.lang-fr.php | 32 +- language/phpmailer.lang-hu.php | 32 +- language/phpmailer.lang-it.php | 33 +- language/phpmailer.lang-ja.php | 34 +- language/phpmailer.lang-nl.php | 32 +- language/phpmailer.lang-no.php | 32 +- language/phpmailer.lang-pl.php | 40 +- language/phpmailer.lang-ro.php | 35 +- language/phpmailer.lang-ru.php | 32 +- language/phpmailer.lang-se.php | 33 +- language/phpmailer.lang-tr.php | 35 +- language/phpmailer.lang-zh.php | 33 +- language/phpmailer.lang-zh_cn.php | 42 +- test/contents.html | 10 + .../{phpmailer_test.php => phpmailerTest.php} | 374 ++-- test/phpunit.php | 378 ---- test/testemail.php | 48 + test_script/LGPLv3.txt | 165 ++ test_script/contents.html | 14 + test_script/images/aikido.gif | Bin 0 -> 26300 bytes {examples => test_script}/images/bkgrnd.gif | Bin test_script/images/phpmailer.gif | Bin 0 -> 4756 bytes test_script/index.php | 427 ++++ test_script/scripts/clipboard.swf | Bin 0 -> 1361 bytes test_script/scripts/shBrushBash.js | 59 + test_script/scripts/shBrushCSharp.js | 64 + test_script/scripts/shBrushCpp.js | 99 + test_script/scripts/shBrushCss.js | 93 + test_script/scripts/shBrushDelphi.js | 57 + test_script/scripts/shBrushDiff.js | 43 + test_script/scripts/shBrushGroovy.js | 69 + test_script/scripts/shBrushJScript.js | 51 + test_script/scripts/shBrushJava.js | 55 + test_script/scripts/shBrushPerl.js | 74 + test_script/scripts/shBrushPhp.js | 91 + test_script/scripts/shBrushPlain.js | 35 + test_script/scripts/shBrushPython.js | 56 + test_script/scripts/shBrushRuby.js | 57 + test_script/scripts/shBrushScala.js | 53 + test_script/scripts/shBrushSql.js | 68 + test_script/scripts/shBrushVb.js | 58 + test_script/scripts/shBrushXml.js | 71 + test_script/scripts/shCore.js | 30 + test_script/scripts/shLegacy.js | 30 + test_script/src/shCore.js | 1949 +++++++++++++++++ test_script/src/shLegacy.js | 172 ++ test_script/styles/help.png | Bin 0 -> 786 bytes test_script/styles/magnifier.png | Bin 0 -> 615 bytes test_script/styles/page_white_code.png | Bin 0 -> 603 bytes test_script/styles/page_white_copy.png | Bin 0 -> 309 bytes test_script/styles/printer.png | Bin 0 -> 731 bytes test_script/styles/shCore.css | 321 +++ test_script/styles/shThemeDefault.css | 191 ++ test_script/styles/shThemeDjango.css | 193 ++ test_script/styles/shThemeEmacs.css | 192 ++ test_script/styles/shThemeFadeToGrey.css | 193 ++ test_script/styles/shThemeMidnight.css | 192 ++ test_script/styles/shThemeRDark.css | 192 ++ test_script/styles/wrapping.png | Bin 0 -> 631 bytes test_script/test.html | 46 + 100 files changed, 7677 insertions(+), 2242 deletions(-) create mode 100644 aboutus.html delete mode 100644 codeworxtech.html delete mode 100644 examples/images/phpmailer.png delete mode 100644 examples/pop3_before_smtp_test.php delete mode 100644 examples/test1.php create mode 100644 examples/test_db_smtp_basic.php delete mode 100644 examples/test_mail.php create mode 100644 examples/test_mail_advanced.php create mode 100644 examples/test_mail_basic.php create mode 100644 examples/test_pop_before_smtp_advanced.php create mode 100644 examples/test_pop_before_smtp_basic.php delete mode 100644 examples/test_sendmail.php create mode 100644 examples/test_sendmail_advanced.php create mode 100644 examples/test_sendmail_basic.php delete mode 100644 examples/test_smtp.php create mode 100644 examples/test_smtp_advanced.php create mode 100644 examples/test_smtp_advanced_no_auth.php create mode 100644 examples/test_smtp_basic.php create mode 100644 examples/test_smtp_basic_no_auth.php create mode 100644 examples/test_smtp_gmail_advanced.php rename examples/{test_gmail.php => test_smtp_gmail_basic.php} (50%) delete mode 100644 language/phpmailer.lang-en.php create mode 100644 test/contents.html rename test/{phpmailer_test.php => phpmailerTest.php} (58%) delete mode 100644 test/phpunit.php create mode 100644 test/testemail.php create mode 100644 test_script/LGPLv3.txt create mode 100644 test_script/contents.html create mode 100644 test_script/images/aikido.gif rename {examples => test_script}/images/bkgrnd.gif (100%) create mode 100644 test_script/images/phpmailer.gif create mode 100644 test_script/index.php create mode 100644 test_script/scripts/clipboard.swf create mode 100644 test_script/scripts/shBrushBash.js create mode 100644 test_script/scripts/shBrushCSharp.js create mode 100644 test_script/scripts/shBrushCpp.js create mode 100644 test_script/scripts/shBrushCss.js create mode 100644 test_script/scripts/shBrushDelphi.js create mode 100644 test_script/scripts/shBrushDiff.js create mode 100644 test_script/scripts/shBrushGroovy.js create mode 100644 test_script/scripts/shBrushJScript.js create mode 100644 test_script/scripts/shBrushJava.js create mode 100644 test_script/scripts/shBrushPerl.js create mode 100644 test_script/scripts/shBrushPhp.js create mode 100644 test_script/scripts/shBrushPlain.js create mode 100644 test_script/scripts/shBrushPython.js create mode 100644 test_script/scripts/shBrushRuby.js create mode 100644 test_script/scripts/shBrushScala.js create mode 100644 test_script/scripts/shBrushSql.js create mode 100644 test_script/scripts/shBrushVb.js create mode 100644 test_script/scripts/shBrushXml.js create mode 100644 test_script/scripts/shCore.js create mode 100644 test_script/scripts/shLegacy.js create mode 100644 test_script/src/shCore.js create mode 100644 test_script/src/shLegacy.js create mode 100644 test_script/styles/help.png create mode 100644 test_script/styles/magnifier.png create mode 100644 test_script/styles/page_white_code.png create mode 100644 test_script/styles/page_white_copy.png create mode 100644 test_script/styles/printer.png create mode 100644 test_script/styles/shCore.css create mode 100644 test_script/styles/shThemeDefault.css create mode 100644 test_script/styles/shThemeDjango.css create mode 100644 test_script/styles/shThemeEmacs.css create mode 100644 test_script/styles/shThemeFadeToGrey.css create mode 100644 test_script/styles/shThemeMidnight.css create mode 100644 test_script/styles/shThemeRDark.css create mode 100644 test_script/styles/wrapping.png create mode 100644 test_script/test.html diff --git a/ChangeLog.txt b/ChangeLog.txt index 18bfba7f..eca7690d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,11 +1,52 @@ ChangeLog -NOTE: THIS VERSION OF PHPMAILER IS DESIGNED FOR PHP5/PHP6. IT WILL NOT WORK WITH PHP4. +NOTE: THIS VERSION OF PHPMAILER IS DESIGNED FOR PHP5/PHP6. + IT WILL NOT WORK WITH PHP4. -Version ?? -* replaced deprecated split() -* fixed image file extension checking to retrieve last part of explode() file name -* added code to check for duplicate image filename to eliminate multiple same-name images +Version 5.0.1 (April 08, 2009) +* fixed duplicate attachments issue (inline graphic vs attachment) + +Version 5.0.0 (April 02, 2009) + +* With the release of this version, we are initiating a new version numbering + system to differentiate from the PHP4 version of PHPMailer. +* Most notable in this release is fully object oriented code. +class.smtp.php: +* Refactored class.smtp.php to support new exception handling + code size reduced from 29.2 Kb to 25.6 Kb +* Removed unnecessary functions from class.smtp.php: + public function Expand($name) { + public function Help($keyword="") { + public function Noop() { + public function Send($from) { + public function SendOrMail($from) { + public function Verify($name) { +class.phpmailer.php: +* Refactored class.phpmailer.php with new exception handling +* Changed processing functionality of Sendmail and Qmail so they cannot be + inadvertently used +* removed getFile() function, just became a simple wrapper for + file_get_contents() +* added check for PHP version (will gracefully exit if not at least PHP 5.0) +class.phpmailer.php enhancements +* enhanced code to check if an attachment source is the same as an embedded or + inline graphic source to eliminate duplicate attachments +New /test_script +* We have written a test script you can use to test the script as part of your + installation. Once you press submit, the test script will send a multi-mime + email with either the message you type in or an HTML email with an inline + graphic. Two attachments are included in the email (one of the attachments + is also the inline graphic so you can see that only one copy of the graphic + is sent in the email). The test script will also display the functional + script that you can copy/paste to your editor to duplicate the functionality. +New examples +* All new examples in both basic and advanced modes. Advanced examples show + Exception handling. +PHPDocumentator (phpdocs) documentation for PHPMailer version 5.0.0 +* all new documentation + +Please note: the website has been updated to reflect the changes in PHPMailer +version 5.0.0. http://phpmailer.codeworxtech.com/ Version 2.3 (November 06, 2008) diff --git a/README b/README index 3f0ee3fa..8d48dc05 100644 --- a/README +++ b/README @@ -9,6 +9,31 @@ PHPMailer Full Featured Email Transfer Class for PHP ========================================== +Version 5.0.0 (April 02, 2009) + +With the release of this version, we are initiating a new version numbering +system to differentiate from the PHP4 version of PHPMailer. + +Most notable in this release is fully object oriented code. + +We now have available the PHPDocumentor (phpdocs) documentation. This is +separate from the regular download to keep file sizes down. Please see the +download area of http://phpmailer.codeworxtech.com. + +We also have created a new test script (see /test_script) that you can use +right out of the box. Copy the /test_script folder directly to your server (in +the same structure ... with class.phpmailer.php and class.smtp.php in the +folder above it. Then launch the test script with: +http://www.yourdomain.com/phpmailer/test_script/index.php +from this one script, you can test your server settings for mail(), sendmail (or +qmail), and SMTP. This will email you a sample email (using contents.html for +the email body) and two attachments. One of the attachments is used as an inline +image to demonstrate how PHPMailer will automatically detect if attachments are +the same source as inline graphics and only include one version. Once you click +the Submit button, the results will be displayed including any SMTP debug +information and send status. We will also display a version of the script that +you can cut and paste to include in your projects. Enjoy! + Version 2.3 (November 08, 2008) We have removed the /phpdoc from the downloads. All documentation is now on @@ -119,7 +144,7 @@ easy to use classes: AspEmail(tm) and AspMail. Both of these programs are COM components only available on Windows. They are also a little pricey for smaller projects. -Since I do Linux development I’ve missed these tools for my PHP coding. +Since I do Linux development I�ve missed these tools for my PHP coding. So I built a version myself that implements the same methods (object calls) that the Windows-based components do. It is open source and the LGPL license allows you to place the class in your proprietary PHP diff --git a/aboutus.html b/aboutus.html new file mode 100644 index 00000000..b59308cb --- /dev/null +++ b/aboutus.html @@ -0,0 +1,169 @@ + + + + + + +
+
+
+The http://phpmailer.codeworxtech.com/ website now carries a few +advertisements through the Google Adsense network to help offset +some of our costs.
+Thanks ....
+
+

PHPMailer is the world's leading email transport class and downloaded an +average of more than 26,000 each month. In March 2009, PHPMailer was downloaded +more than 31,000 times -- that's an average of 1,000 downloads daily. Our thanks +to our new users and loyal users. We understand you have many choices available +to select from and we thank you for select our fast and stable tool for your +website and projects.

+

Credits:
+PHPMailer's original founder is Brent Matzelle. The current team is:
+Project Administrator: Andy Prevost (codeworxtech), + +codeworxtech@users.sourceforge.net
+Author: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net
+Author: Marcus Bointon (coolbru) +coolbru@users.sourceforge.net

+

PHPMailer is used in many projects ranging from Open Source to commercial +packages. Our LGPL licensing terms are very flexible and allow for including +PHPMailer to enhance projects of all types. If you discover PHPMailer being used +in a project, please let us know about it.

+

WHY USE OUR TOOLS & WHAT'S IN IT FOR YOU?

+

A valid question. We're developers too. We've been writing software, primarily for the internet, for more than 15 years. Along the way, there are two major things that had tremendous impact of our company: PHP and Open Source. PHP is without doubt the most popular platform for the internet. There has been more progress in this area of technology because of Open Source software than in any other IT segment. We have used many open source tools, some as learning tools, some as components in projects we were working on. To us, it's not about popularity ... we're committed to robust, stable, and efficient tools you can use to get your projects in your user's hands quickly. So the shorter answer: what's in it for you? rapid development and rapid deployment without fuss and with straight forward open source licensing.

+

Now, here's our team:

+ + + + + + + + + +
About Andy Prevost, AKA "codeworxtech".About Marcus Bointon, AKA "coolbru".
+

www.codeworxtech.com for more information.
+ Web design, web applications, forms: WorxStudio.com
+

+

Our company, Worx International Inc., is the publisher of several Open Source applications and developer tools as well as several commercial PHP applications. The Open Source applications are ttCMS and DCP Portal. The Open Source developer tools include QuickComponents (QuickSkin and QuickCache) and now PHPMailer. + We have staff and offices in the United States, Caribbean, the Middle + East, and our primary development center in Canada. Our company is represented by + agents and resellers globally.

+

Worx International Inc. is at the forefront of developing PHP applications. Our staff are all Zend Certified university educated and experts at object oriented programming. While Worx International Inc. can handle any project from trouble shooting programs written by others all the way to finished mission-critical applications, we specialize in taking projects from inception all the way through to implementation - on budget, and on time. If you need help with your projects, we're the team to get it done right at a reasonable price.

+

Over the years, there have been a number of tools that have been constant favorites in all of our projects. We have become the project administrators for most of these tools.

+

Our developer tools are all Open Source. Here's a brief description:

+
    +
  • PHPMailer. Originally authored by Brent Matzelle, PHPMailer is the leading "email transfer class" for PHP. PHPMailer is downloaded more than + 26000 times each and every month by developers looking for a fast, stable, simple email solution. We used it ourselves for years as our favorite tool. It's always been small (the entire footprint is + less than 100 Kb), stable, and as complete a solution as you can find. + Other tools are nowhere near as simple. Our thanks to Brent Matzelle for this superb tool - our commitment is to keep it lean, keep it focused, and compliant with standards. Visit the PHPMailer website at + http://phpmailer.codeworxtech.com/.
    + Please note: all of our focus is now on the PHPMailer for PHP5.
    + PS. While you are at it, please visit our sponsor's sites, click on their ads. + It helps offset some of our costs.
    + Want to help? We're looking for progressive developers to join our team of volunteer professionals working on PHPMailer. Our entire focus is on PHPMailer + for PHP5. If you are interested, let us know.
    +
    +
  • +
  • QuickCache. Originally authored by Jean Pierre Deckers as jpCache, QuickCache is an HTTP OpCode caching strategy that works on your entire site with only one line of code at the top of your script. The cached pages can be stored as files or as database objects. The benefits are absolutely astounding: bandwidth savings of up to 80% and screen display times increased by 8 - 10x. Visit the QuickCache website at + http://quickcache.codeworxtech.com/.
    +
    +
  • +
  • QuickSkin. Originally authored by Philipp v. Criegern and named "SmartTemplate". The project was taken over by Manuel 'EndelWar' Dalla Lana and now by "codeworxtech". QuickSkin is one of the truly outstanding templating engines available, but has always been confused with Smarty Templating Engine. QuickSkin is even more relevant today than when it was launched. It's a small footprint with big impact on your projects. It features a built in caching technology, token based substitution, and works on the concept of one single HTML file as the template. The HTML template file can contain variable information making it one small powerful tool for your developer tool kit. Visit the QuickSkin website at + http://quickskin.codeworxtech.com/.
    +
    +
  • +
+

We're committed to PHP and to the Open Source community.

+

Opportunities with Worx International Inc.:

+
    +
  • Resellers/Agents: We're always interested in talking with companies that + want to represent + Worx International Inc. in their markets. We also have private label programs for our commercial products (in certain circumstances).
  • +
  • Programmers/Developers: We are usually fully staffed, however, if you would like to be considered for a career with + Worx International Inc., we would be pleased to hear from you.
    + A few things to note:
    +
      +
    • experience level does not matter: from fresh out of college to multi-year experience - it's your + creative mind and a positive attitude we want
    • +
    • if you contact us looking for employment, include a cover letter, indicate what type of work/career you are looking for and expected compensation
    • +
    • if you are representing someone else looking for work, do not contact us. We have an exclusive relationship with a recruiting partner already and not interested in altering the arrangement. We will not hire your candidate under any circumstances unless they wish to approach us individually.
    • +
    • any contact that ignores any of these points will be discarded
    • +
  • +
  • Affiliates/Partnerships: We are interested in partnering with other firms who are leaders in their field. We clearly understand that successful companies are built on successful relationships in all industries world-wide. We currently have innovative relationships throughout the world that are mutually beneficial. Drop us a line and let's talk.
  • +
+ Regards,
+ Andy Prevost (aka, codeworxtech)
+ codeworxtech@users.sourceforge.net
+
+ We now also offer website design. hosting, and remote forms processing. Visit WorxStudio.com for more information.
+
+

Marcus is the technical director of Synchromedia Limited, a UK-based company providing online business services. Synchromedia's main services are:

+

Smartmessages.net

+

Smartmessages.net logo
Smartmessages.net
is Synchromedia's large-scale mailing list management system, providing email delivery services for a wide range of businesses, from sole traders to corporates. + We pride ourselves on personal service, and realise that every one of your subscribers is a precious asset to be handled with care. + We provide fast, reliable, high-volume delivery (some of our customers have lists of more than 1,000,000 subscribers) with fine-grained tracking while ensuring you stay fully compliant with UK, EC and US data protection laws. Smartmessages of course uses PHPMailer at its heart!

+

info@hand

+

info@hand logo
Synchromedia is the official UK distributor of info@hand, a class-leading open-source web-based CRM system. We provide licenses, hosting, planning, support and training for this very fully-featured system at very competitive prices. info@hand also uses PHPMailer!

+

How can we help you?

+

In addition to our headline services, we also provide consulting, development, hosting and sysadmin services, so if you just need a simple web hosting package, we can do that too. Not surprisingly, we know rather a lot about email, so you can talk to us about that too.

+

Please contact us if you'd like to know more.

+

Marcus is a regular attendee at PHP London, and occasionally speaks on email at technical conferences.

+
+
+
+ + \ No newline at end of file diff --git a/class.phpmailer.php b/class.phpmailer.php index edc9e30a..11baf72e 100644 --- a/class.phpmailer.php +++ b/class.phpmailer.php @@ -2,15 +2,15 @@ /*~ class.phpmailer.php .---------------------------------------------------------------------------. | Software: PHPMailer - PHP email class | -| Version: 2.3 | +| Version: 5.0.1 | | Contact: via sourceforge.net support pages (also www.codeworxtech.com) | | Info: http://phpmailer.sourceforge.net | | Support: http://sourceforge.net/projects/phpmailer/ | | ------------------------------------------------------------------------- | -| Author: Andy Prevost (project admininistrator) | -| Author: Brent R. Matzelle (original founder) | -| Team : Marcus Bointon (coolbru), coolbru@users.sourceforge.net | -| Carl P. Corliss (rabbitt), rabbitt@users.sourceforge.net | +| Admin: Andy Prevost (project admininistrator) | +| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net | +| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net | +| Founder: Brent R. Matzelle (original founder) | | Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. | | Copyright (c) 2001-2003, Brent R. Matzelle | | ------------------------------------------------------------------------- | @@ -29,19 +29,17 @@ /** * PHPMailer - PHP email transport class - * NOTE: Designed for use with PHP version 5 and up + * NOTE: Requires PHP version 5 or later * @package PHPMailer * @author Andy Prevost + * @author Marcus Bointon * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL) * @version $Id$ + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ -/** - * PHPMailer - PHP email transport class - * @package PHPMailer - * @author Andy Prevost - */ +if (version_compare(PHP_VERSION, '5.0.0', '<') ) exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n"); + class PHPMailer { ///////////////////////////////////////////////// @@ -67,8 +65,8 @@ class PHPMailer { public $ContentType = 'text/plain'; /** - * Sets the Encoding of the message. Options for this are "8bit", - * "7bit", "binary", "base64", and "quoted-printable". + * Sets the Encoding of the message. Options for this are + * "8bit", "7bit", "binary", "base64", and "quoted-printable". * @var string */ public $Encoding = '8bit'; @@ -77,7 +75,7 @@ class PHPMailer { * Holds the most recent mailer error message. * @var string */ - protected $ErrorInfo = ''; + public $ErrorInfo = ''; /** * Sets the From email address for the message. @@ -140,18 +138,12 @@ class PHPMailer { public $Sendmail = '/usr/sbin/sendmail'; /** - * Path to PHPMailer plugins. This is now only useful if the SMTP class + * Path to PHPMailer plugins. Useful if the SMTP class * is in a different directory than the PHP include path. * @var string */ public $PluginDir = ''; - /** - * Holds PHPMailer version. - * @var string - */ - protected $Version = "2.3"; - /** * Sets the email address that a reading confirmation will be sent. * @var string @@ -171,7 +163,7 @@ class PHPMailer { * If empty, a unique id will be generated. * @var string */ - public $MessageID = ''; + public $MessageID = ''; ///////////////////////////////////////////////// // PROPERTIES FOR SMTP @@ -185,57 +177,57 @@ class PHPMailer { * Hosts will be tried in order. * @var string */ - public $Host = 'localhost'; + public $Host = 'localhost'; /** * Sets the default SMTP server port. * @var int */ - public $Port = 25; + public $Port = 25; /** * Sets the SMTP HELO of the message (Default is $Hostname). * @var string */ - public $Helo = ''; + public $Helo = ''; /** * Sets connection prefix. * Options are "", "ssl" or "tls" * @var string */ - public $SMTPSecure = ""; + public $SMTPSecure = ''; /** * Sets SMTP authentication. Utilizes the Username and Password variables. * @var bool */ - public $SMTPAuth = false; + public $SMTPAuth = false; /** * Sets SMTP username. * @var string */ - public $Username = ''; + public $Username = ''; /** * Sets SMTP password. * @var string */ - public $Password = ''; + public $Password = ''; /** - * Sets the SMTP server timeout in seconds. This function will not - * work with the win32 version. + * Sets the SMTP server timeout in seconds. + * This function will not work with the win32 version. * @var int */ - public $Timeout = 10; + public $Timeout = 10; /** * Sets SMTP class debugging on or off. * @var bool */ - public $SMTPDebug = false; + public $SMTPDebug = false; /** * Prevents the SMTP connection from being closed after each mail @@ -250,7 +242,7 @@ class PHPMailer { * emails, instead of sending to entire TO addresses * @var bool */ - public $SingleTo = false; + public $SingleTo = false; /** * Provides the ability to change the line ending @@ -259,36 +251,54 @@ class PHPMailer { public $LE = "\n"; ///////////////////////////////////////////////// - // PROPERTIES, PRIVATE + // PROPERTIES, PRIVATE AND PROTECTED ///////////////////////////////////////////////// - private $smtp = NULL; - private $to = array(); - private $cc = array(); - private $bcc = array(); - private $ReplyTo = array(); - private $all_recipients = array(); - private $attachment = array(); - private $CustomHeader = array(); - private $message_type = ''; - private $boundary = array(); - private $language = array(); - private $error_count = 0; - private $sign_cert_file = ""; - private $sign_key_file = ""; - private $sign_key_pass = ""; + private $smtp = NULL; + private $to = array(); + private $cc = array(); + private $bcc = array(); + private $ReplyTo = array(); + private $all_recipients = array(); + private $attachment = array(); + private $CustomHeader = array(); + private $message_type = ''; + private $boundary = array(); + protected $language = array(); + private $error_count = 0; + private $sign_cert_file = ""; + private $sign_key_file = ""; + private $sign_key_pass = ""; + private $exceptions = false; + + ///////////////////////////////////////////////// + // CONSTANTS + ///////////////////////////////////////////////// + + const VERSION = '5.0.0'; + const STOP_MESSAGE = 0; // message only, continue processing + const STOP_CONTINUE = 1; // message?, likely ok to continue processing + const STOP_CRITICAL = 2; // message, plus full stop, critical error reached ///////////////////////////////////////////////// // METHODS, VARIABLES ///////////////////////////////////////////////// + /** + * Constructor + * @param boolean $exceptions Should we throw external exceptions? + */ + public function __construct($exceptions = false) { + $this->exceptions = ($exceptions == true); + } + /** * Sets message type to HTML. - * @param bool $bool + * @param bool $ishtml * @return void */ - public function IsHTML($bool) { - if($bool == true) { + public function IsHTML($ishtml = true) { + if ($ishtml) { $this->ContentType = 'text/html'; } else { $this->ContentType = 'text/plain'; @@ -316,6 +326,9 @@ class PHPMailer { * @return void */ public function IsSendmail() { + if (!stristr(ini_get('sendmail_path'), 'sendmail')) { + $this->Sendmail = '/var/qmail/bin/sendmail'; + } $this->Mailer = 'sendmail'; } @@ -324,7 +337,9 @@ class PHPMailer { * @return void */ public function IsQmail() { - $this->Sendmail = '/var/qmail/bin/sendmail'; + if (stristr(ini_get('sendmail_path'), 'qmail')) { + $this->Sendmail = '/var/qmail/bin/sendmail'; + } $this->Mailer = 'sendmail'; } @@ -336,61 +351,126 @@ class PHPMailer { * Adds a "To" address. * @param string $address * @param string $name - * @return boolean true on success, false if addressed already used - * @author Marcus Bointon - * @author Carl Corliss + * @return boolean true on success, false if address already used */ public function AddAddress($address, $name = '') { - if (!isset($this->all_recipients[strtolower(trim($address))])) { - $this->to[] = array(trim($address), $name); - $this->all_recipients[strtolower(trim($address))] = true; - return true; - } - return false; + return $this->AddAnAddress('to', $address, $name); } /** - * Adds a "Cc" address. Note: this function works - * with the SMTP mailer on win32, not with the "mail" - * mailer. + * Adds a "Cc" address. + * Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. * @param string $address * @param string $name - * @return boolean true on success, false if addressed already used + * @return boolean true on success, false if address already used */ public function AddCC($address, $name = '') { - if (!isset($this->all_recipients[strtolower(trim($address))])) { - $this->cc[] = array(trim($address), $name); - $this->all_recipients[strtolower(trim($address))] = true; - return true; - } - return false; + return $this->AddAnAddress('cc', $address, $name); } /** - * Adds a "Bcc" address. Note: this function works - * with the SMTP mailer on win32, not with the "mail" - * mailer. + * Adds a "Bcc" address. + * Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. * @param string $address * @param string $name - * @return boolean true on success, false if addressed already used + * @return boolean true on success, false if address already used */ public function AddBCC($address, $name = '') { - if (!isset($this->all_recipients[strtolower(trim($address))])) { - $this->bcc[] = array(trim($address), $name); - $this->all_recipients[strtolower(trim($address))] = true; - return true; - } - return false; + return $this->AddAnAddress('bcc', $address, $name); } /** * Adds a "Reply-to" address. * @param string $address * @param string $name - * @return void + * @return boolean */ public function AddReplyTo($address, $name = '') { - $this->ReplyTo[] = array(trim($address), $name); + return $this->AddAnAddress('ReplyTo', $address, $name); + } + + /** + * Adds an address to one of the recipient arrays + * Addresses that have been added already return false, but do not throw exceptions + * @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo' + * @param string $address The email address to send to + * @param string $name + * @return boolean true on success, false if address already used or invalid in some way + * @access private + */ + private function AddAnAddress($kind, $address, $name = '') { + if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) { + echo 'Invalid recipient array: ' . kind; + return false; + } + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + if (!self::ValidateAddress($address)) { + $this->SetError($this->Lang('invalid_address').': '. $address); + if ($this->exceptions) { + throw new phpmailerException($this->Lang('invalid_address').': '.$address); + } + echo $this->Lang('invalid_address').': '.$address; + return false; + } + if ($kind != 'ReplyTo') { + if (!isset($this->all_recipients[strtolower($address)])) { + array_push($this->$kind, array($address, $name)); + $this->all_recipients[strtolower($address)] = true; + return true; + } + } else { + if (!array_key_exists(strtolower($address), $this->ReplyTo)) { + $this->ReplyTo[strtolower($address)] = array($address, $name); + return true; + } + } + return false; + } + +/** + * Set the From and FromName properties + * @param string $address + * @param string $name + * @return boolean + */ + public function SetFrom($address, $name = '') { + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + if (!self::ValidateAddress($address)) { + $this->SetError($this->Lang('invalid_address').': '. $address); + if ($this->exceptions) { + throw new phpmailerException($this->Lang('invalid_address').': '.$address); + } + echo $this->Lang('invalid_address').': '.$address; + return false; + } + $this->From = $address; + $this->FromName = $name; + return true; + } + + /** + * Check that a string looks roughly like an email address should + * Static so it can be used without instantiation + * Tries to use PHP built-in validator in the filter extension (from PHP 5.2), falls back to a reasonably competent regex validator + * Conforms approximately to RFC2822 + * @link http://www.hexillion.com/samples/#Regex Original pattern found here + * @param string $address The email address to check + * @return boolean + * @static + * @access public + */ + public static function ValidateAddress($address) { + if (function_exists('filter_var')) { //Introduced in PHP 5.2 + if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) { + return false; + } else { + return true; + } + } else { + return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address); + } } ///////////////////////////////////////////////// @@ -404,97 +484,84 @@ class PHPMailer { * @return bool */ public function Send() { - $header = ''; - $body = ''; - $result = true; + try { + if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { + throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL); + } - if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { - $this->SetError($this->Lang('provide_address')); + // Set whether the message is multipart/alternative + if(!empty($this->AltBody)) { + $this->ContentType = 'multipart/alternative'; + } + + $this->error_count = 0; // reset errors + $this->SetMessageType(); + $header = $this->CreateHeader(); + $body = $this->CreateBody(); + + if (empty($this->Body)) { + throw new phpmailerException($this->Lang('empty_message'), self::STOP_CRITICAL); + } + + // Choose the mailer and send through it + switch($this->Mailer) { + case 'sendmail': + return $this->SendmailSend($header, $body); + case 'smtp': + return $this->SmtpSend($header, $body); + case 'mail': + default: + return $this->MailSend($header, $body); + } + + } catch (phpmailerException $e) { + $this->SetError($e->getMessage()); + if ($this->exceptions) { + throw $e; + } + echo $e->getMessage()."\n"; return false; } - - /* Set whether the message is multipart/alternative */ - if(!empty($this->AltBody)) { - $this->ContentType = 'multipart/alternative'; - } - - $this->error_count = 0; // reset errors - $this->SetMessageType(); - $header .= $this->CreateHeader(); - $body = $this->CreateBody(); - - if($body == '') { - return false; - } - - /* Choose the mailer */ - switch($this->Mailer) { - case 'sendmail': - $result = $this->SendmailSend($header, $body); - break; - case 'smtp': - $result = $this->SmtpSend($header, $body); - break; - case 'mail': - $result = $this->MailSend($header, $body); - break; - default: - $result = $this->MailSend($header, $body); - break; - //$this->SetError($this->Mailer . $this->Lang('mailer_not_supported')); - //$result = false; - //break; - } - - return $result; } /** * Sends mail using the $Sendmail program. - * @access public + * @param string $header The message headers + * @param string $body The message body + * @access protected * @return bool */ - public function SendmailSend($header, $body) { + protected function SendmailSend($header, $body) { if ($this->Sender != '') { $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); } else { $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); } - if(!@$mail = popen($sendmail, 'w')) { - $this->SetError($this->Lang('execute') . $this->Sendmail); - return false; + throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } - fputs($mail, $header); fputs($mail, $body); - $result = pclose($mail); - if (version_compare(phpversion(), '4.2.3') == -1) { - $result = $result >> 8 & 0xFF; - } if($result != 0) { - $this->SetError($this->Lang('execute') . $this->Sendmail); - return false; + throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } - return true; } /** * Sends mail using the PHP mail() function. - * @access public + * @param string $header The message headers + * @param string $body The message body + * @access protected * @return bool */ - public function MailSend($header, $body) { - - $to = ''; - for($i = 0; $i < count($this->to); $i++) { - if($i != 0) { $to .= ', '; } - $to .= $this->AddrFormat($this->to[$i]); + protected function MailSend($header, $body) { + $toArr = array(); + foreach($this->to as $t) { + $toArr[] = $this->AddrFormat($t); } - - $toArr = explode(',', $to); + $to = implode(', ', $toArr); $params = sprintf("-oi -f %s", $this->Sender); if ($this->Sender != '' && strlen(ini_get('safe_mode'))< 1) { @@ -516,85 +583,62 @@ class PHPMailer { $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header); } } - if (isset($old_from)) { ini_set('sendmail_from', $old_from); } - if(!$rt) { - $this->SetError($this->Lang('instantiate')); - return false; + throw new phpmailerException($this->Lang('instantiate'), self::STOP_CRITICAL); } - return true; } /** * Sends mail via SMTP using PhpSMTP * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. + * @param string $header The message headers + * @param string $body The message body * @uses SMTP - * @access public + * @access protected * @return bool - * @author Chris Ryan */ - public function SmtpSend($header, $body) { - include_once($this->PluginDir . 'class.smtp.php'); - $error = ''; + protected function SmtpSend($header, $body) { + require_once $this->PluginDir . 'class.smtp.php'; $bad_rcpt = array(); if(!$this->SmtpConnect()) { - return false; + throw new phpmailerException($this->Lang('smtp_connect_failed'), self::STOP_CRITICAL); } - $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender; if(!$this->smtp->Mail($smtp_from)) { - $error = $this->Lang('from_failed') . $smtp_from; - $this->SetError($error); - $this->smtp->Reset(); - return false; + throw new phpmailerException($this->Lang('from_failed') . $smtp_from, self::STOP_CRITICAL); } - /* Attempt to send attach all recipients */ - for($i = 0; $i < count($this->to); $i++) { - if(!$this->smtp->Recipient($this->to[$i][0])) { - $bad_rcpt[] = $this->to[$i][0]; + // Attempt to send attach all recipients + foreach($this->to as $to) { + if (!$this->smtp->Recipient($to[0])) { + $bad_rcpt[] = $to[0]; } } - for($i = 0; $i < count($this->cc); $i++) { - if(!$this->smtp->Recipient($this->cc[$i][0])) { - $bad_rcpt[] = $this->cc[$i][0]; + foreach($this->cc as $cc) { + if (!$this->smtp->Recipient($cc[0])) { + $bad_rcpt[] = $cc[0]; } } - for($i = 0; $i < count($this->bcc); $i++) { - if(!$this->smtp->Recipient($this->bcc[$i][0])) { - $bad_rcpt[] = $this->bcc[$i][0]; + foreach($this->bcc as $bcc) { + if (!$this->smtp->Recipient($bcc[0])) { + $bad_rcpt[] = $bcc[0]; } } - - if(count($bad_rcpt) > 0) { // Create error message - for($i = 0; $i < count($bad_rcpt); $i++) { - if($i != 0) { - $error .= ', '; - } - $error .= $bad_rcpt[$i]; - } - $error = $this->Lang('recipients_failed') . $error; - $this->SetError($error); - $this->smtp->Reset(); - return false; + if (count($bad_rcpt) > 0 ) { //Create error message for any bad addresses + $badaddresses = implode(', ', $bad_rcpt); + throw new phpmailerException($this->Lang('recipients_failed') . $badaddresses); } - if(!$this->smtp->Data($header . $body)) { - $this->SetError($this->Lang('data_not_accepted')); - $this->smtp->Reset(); - return false; + throw new phpmailerException($this->Lang('data_not_accepted'), self::STOP_CRITICAL); } if($this->SMTPKeepAlive == true) { $this->smtp->Reset(); - } else { - $this->SmtpClose(); } - return true; } @@ -606,70 +650,69 @@ class PHPMailer { * @return bool */ public function SmtpConnect() { - if($this->smtp == NULL) { + if(is_null($this->smtp)) { $this->smtp = new SMTP(); } $this->smtp->do_debug = $this->SMTPDebug; $hosts = explode(';', $this->Host); $index = 0; - $connection = ($this->smtp->Connected()); + $connection = $this->smtp->Connected(); - /* Retry while there is no connection */ - while($index < count($hosts) && $connection == false) { - $hostinfo = array(); - if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) { - $host = $hostinfo[1]; - $port = $hostinfo[2]; - } else { - $host = $hosts[$index]; - $port = $this->Port; - } + // Retry while there is no connection + try { + while($index < count($hosts) && !$connection) { + $hostinfo = array(); + if (preg_match('/^(.+):([0-9]+)$/', $hosts[$index], $hostinfo)) { + $host = $hostinfo[1]; + $port = $hostinfo[2]; + } else { + $host = $hosts[$index]; + $port = $this->Port; + } - $tls = ($this->SMTPSecure == 'tls'); - $ssl = ($this->SMTPSecure == 'ssl'); + $tls = ($this->SMTPSecure == 'tls'); + $ssl = ($this->SMTPSecure == 'ssl'); - if($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) { + if ($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) { - $hello = ($this->Helo != '' ? $this->Helo : $this->ServerHostname()); - $this->smtp->Hello($hello); - - if($tls) { - if(!$this->smtp->StartTLS()) { - $this->SetError($this->Lang("tls")); - $this->smtp->Reset(); - $connection = false; - } - - //We must resend HELLO after tls negociation + $hello = ($this->Helo != '' ? $this->Helo : $this->ServerHostname()); $this->smtp->Hello($hello); - } - $connection = true; - if($this->SMTPAuth) { - if(!$this->smtp->Authenticate($this->Username, $this->Password)) { - $this->SetError($this->Lang('authenticate')); - $this->smtp->Reset(); - $connection = false; + if ($tls) { + if (!$this->smtp->StartTLS()) { + throw new phpmailerException($this->Lang('tls')); + } + + //We must resend HELO after tls negotiation + $this->smtp->Hello($hello); + } + + $connection = true; + if ($this->SMTPAuth) { + if (!$this->smtp->Authenticate($this->Username, $this->Password)) { + throw new phpmailerException($this->Lang('authenticate')); + } } } + $index++; + if (!$connection) { + throw new phpmailerException($this->Lang('connect_host')); + } } - $index++; + } catch (phpmailerException $e) { + $this->smtp->Reset(); + throw $e; } - if(!$connection) { - $this->SetError($this->Lang('connect_host')); - } - - return $connection; + return true; } /** * Closes the active SMTP session if one exists. - * @uses SMTP * @return void */ public function SmtpClose() { - if($this->smtp != NULL) { + if(!is_null($this->smtp)) { if($this->smtp->Connected()) { $this->smtp->Quit(); $this->smtp->Close(); @@ -678,34 +721,48 @@ class PHPMailer { } /** - * Sets the language for all class error messages. Returns false - * if it cannot load the language file. The default language type - * is English. - * @param string $lang_type Type of language (e.g. Portuguese: "br") - * @param string $lang_path Path to the language file directory - * @access public - * @return bool - */ - function SetLanguage($lang_type = 'en', $lang_path = 'language/') { - if( !(@include $lang_path.'phpmailer.lang-'.$lang_type.'.php') ) { - $PHPMAILER_LANG = array(); - $PHPMAILER_LANG['provide_address'] = 'You must provide at least one recipient email address.'; - $PHPMAILER_LANG['mailer_not_supported'] = ' mailer is not supported.'; - $PHPMAILER_LANG['execute'] = 'Could not execute: '; - $PHPMAILER_LANG['instantiate'] = 'Could not instantiate mail function.'; - $PHPMAILER_LANG['authenticate'] = 'SMTP Error: Could not authenticate.'; - $PHPMAILER_LANG['from_failed'] = 'The following From address failed: '; - $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: The following ' . - $PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data not accepted.'; - $PHPMAILER_LANG['connect_host'] = 'SMTP Error: Could not connect to SMTP host.'; - $PHPMAILER_LANG['file_access'] = 'Could not access file: '; - $PHPMAILER_LANG['file_open'] = 'File Error: Could not open file: '; - $PHPMAILER_LANG['encoding'] = 'Unknown encoding: '; - $PHPMAILER_LANG['signing'] = 'Signing Error: '; - $PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; + * Sets the language for all class error messages. + * Returns false if it cannot load the language file. The default language is English. + * @param string $langcode ISO 639-1 2-character language code (e.g. Portuguese: "br") + * @param string $lang_path Path to the language file directory + * @access public + */ + function SetLanguage($langcode = 'en', $lang_path = 'language/') { + //Define full set of translatable strings + $PHPMAILER_LANG = array( + 'provide_address' => 'You must provide at least one recipient email address.', + 'mailer_not_supported' => ' mailer is not supported.', + 'execute' => 'Could not execute: ', + 'instantiate' => 'Could not instantiate mail function.', + 'authenticate' => 'SMTP Error: Could not authenticate.', + 'from_failed' => 'The following From address failed: ', + 'recipients_failed' => 'SMTP Error: The following recipients failed: ', + 'data_not_accepted' => 'SMTP Error: Data not accepted.', + 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', + 'file_access' => 'Could not access file: ', + 'file_open' => 'File Error: Could not open file: ', + 'encoding' => 'Unknown encoding: ', + 'signing' => 'Signing Error: ', + 'smtp_error' => 'SMTP server error: ', + 'empty_message' => 'Message body empty', + 'invalid_address' => 'Invalid address', + 'variable_set' => 'Cannot set or reset variable: ' + ); + //Overwrite language-specific strings. This way we'll never have missing translations - no more "language string failed to load"! + $l = true; + if ($langcode != 'en') { //There is no English translation file + $l = @include $lang_path.'phpmailer.lang-'.$langcode.'.php'; } $this->language = $PHPMAILER_LANG; - return true; + return ($l == true); //Returns false if language not found + } + + /** + * Return the current array of language strings + * @return array + */ + public function GetTranslations() { + return $this->language; } ///////////////////////////////////////////////// @@ -719,12 +776,11 @@ class PHPMailer { */ public function AddrAppend($type, $addr) { $addr_str = $type . ': '; - $addr_str .= $this->AddrFormat($addr[0]); - if(count($addr) > 1) { - for($i = 1; $i < count($addr); $i++) { - $addr_str .= ', ' . $this->AddrFormat($addr[$i]); - } + $addresses = array(); + foreach ($addr as $a) { + $addresses[] = $this->AddrFormat($a); } + $addr_str .= implode(', ', $addresses); $addr_str .= $this->LE; return $addr_str; @@ -736,19 +792,20 @@ class PHPMailer { * @return string */ public function AddrFormat($addr) { - if(empty($addr[1])) { - $formatted = $this->SecureHeader($addr[0]); + if (empty($addr[1])) { + return $this->SecureHeader($addr[0]); } else { - $formatted = $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">"; + return $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">"; } - - return $formatted; } /** * Wraps message for use with mailers that do not * automatically perform wrapping and for quoted-printable. * Original written by philippe. + * @param string $message The message to wrap + * @param integer $length The line length to wrap to + * @param boolean $qp_mode Whether to run in Quoted-Printable mode * @access public * @return string */ @@ -879,7 +936,6 @@ class PHPMailer { switch($this->message_type) { case 'alt': - /* fall through */ case 'alt_attachments': $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap); break; @@ -892,24 +948,24 @@ class PHPMailer { /** * Assembles message header. * @access public - * @return string + * @return string The assembled header */ public function CreateHeader() { $result = ''; - /* Set the boundaries */ + // Set the boundaries $uniq_id = md5(uniqid(time())); $this->boundary[1] = 'b1_' . $uniq_id; $this->boundary[2] = 'b2_' . $uniq_id; - $result .= $this->HeaderLine('Date', $this->RFCDate()); + $result .= $this->HeaderLine('Date', self::RFCDate()); if($this->Sender == '') { $result .= $this->HeaderLine('Return-Path', trim($this->From)); } else { $result .= $this->HeaderLine('Return-Path', trim($this->Sender)); } - /* To be created automatically by mail() */ + // To be created automatically by mail() if($this->Mailer != 'mail') { if(count($this->to) > 0) { $result .= $this->AddrAppend('To', $this->to); @@ -923,12 +979,12 @@ class PHPMailer { $from[0][1] = $this->FromName; $result .= $this->AddrAppend('From', $from); - /* sendmail and mail() extract Cc from the header before sending */ + // sendmail and mail() extract Cc from the header before sending if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->cc) > 0)) { $result .= $this->AddrAppend('Cc', $this->cc); } - /* sendmail and mail() extract Bcc from the header before sending */ + // sendmail and mail() extract Bcc from the header before sending if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) { $result .= $this->AddrAppend('Bcc', $this->bcc); } @@ -937,7 +993,7 @@ class PHPMailer { $result .= $this->AddrAppend('Reply-to', $this->ReplyTo); } - /* mail() sets the subject itself */ + // mail() sets the subject itself if($this->Mailer != 'mail') { $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject))); } @@ -948,7 +1004,7 @@ class PHPMailer { $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); } $result .= $this->HeaderLine('X-Priority', $this->Priority); - $result .= $this->HeaderLine('X-Mailer', 'PHPMailer (phpmailer.codeworxtech.com) [version ' . $this->Version . ']'); + $result .= $this->HeaderLine('X-Mailer', 'PHPMailer ' . self::VERSION . ' (phpmailer.codeworxtech.com)'); if($this->ConfirmReadingTo != '') { $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>'); @@ -979,7 +1035,6 @@ class PHPMailer { $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet); break; case 'attachments': - /* fall through */ case 'alt_attachments': if($this->InlineImageExists()){ $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE); @@ -1004,83 +1059,82 @@ class PHPMailer { /** * Assembles the message body. Returns an empty string on failure. * @access public - * @return string + * @return string The assembled message body */ public function CreateBody() { - $result = ''; + $body = ''; if ($this->sign_key_file) { - $result .= $this->GetMailMIME(); + $body .= $this->GetMailMIME(); } $this->SetWordWrap(); switch($this->message_type) { case 'alt': - $result .= $this->GetBoundary($this->boundary[1], '', 'text/plain', ''); - $result .= $this->EncodeString($this->AltBody, $this->Encoding); - $result .= $this->LE.$this->LE; - $result .= $this->GetBoundary($this->boundary[1], '', 'text/html', ''); - $result .= $this->EncodeString($this->Body, $this->Encoding); - $result .= $this->LE.$this->LE; - $result .= $this->EndBoundary($this->boundary[1]); + $body .= $this->GetBoundary($this->boundary[1], '', 'text/plain', ''); + $body .= $this->EncodeString($this->AltBody, $this->Encoding); + $body .= $this->LE.$this->LE; + $body .= $this->GetBoundary($this->boundary[1], '', 'text/html', ''); + $body .= $this->EncodeString($this->Body, $this->Encoding); + $body .= $this->LE.$this->LE; + $body .= $this->EndBoundary($this->boundary[1]); break; case 'plain': - $result .= $this->EncodeString($this->Body, $this->Encoding); + $body .= $this->EncodeString($this->Body, $this->Encoding); break; case 'attachments': - $result .= $this->GetBoundary($this->boundary[1], '', '', ''); - $result .= $this->EncodeString($this->Body, $this->Encoding); - $result .= $this->LE; - $result .= $this->AttachAll(); + $body .= $this->GetBoundary($this->boundary[1], '', '', ''); + $body .= $this->EncodeString($this->Body, $this->Encoding); + $body .= $this->LE; + $body .= $this->AttachAll(); break; case 'alt_attachments': - $result .= sprintf("--%s%s", $this->boundary[1], $this->LE); - $result .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE); - $result .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body - $result .= $this->EncodeString($this->AltBody, $this->Encoding); - $result .= $this->LE.$this->LE; - $result .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body - $result .= $this->EncodeString($this->Body, $this->Encoding); - $result .= $this->LE.$this->LE; - $result .= $this->EndBoundary($this->boundary[2]); - $result .= $this->AttachAll(); + $body .= sprintf("--%s%s", $this->boundary[1], $this->LE); + $body .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE); + $body .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body + $body .= $this->EncodeString($this->AltBody, $this->Encoding); + $body .= $this->LE.$this->LE; + $body .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body + $body .= $this->EncodeString($this->Body, $this->Encoding); + $body .= $this->LE.$this->LE; + $body .= $this->EndBoundary($this->boundary[2]); + $body .= $this->AttachAll(); break; } - if($this->IsError()) { - $result = ''; - } else if ($this->sign_key_file) { - $file = tempnam("", "mail"); - $fp = fopen($file, "w"); - fwrite($fp, $result); - fclose($fp); - $signed = tempnam("", "signed"); - - if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), null)) { - $fp = fopen($signed, "r"); - $result = ''; - while(!feof($fp)){ - $result = $result . fread($fp, 1024); + if ($this->IsError()) { + $body = ''; + } elseif ($this->sign_key_file) { + try { + $file = tempnam('', 'mail'); + file_put_contents($file, $body); //TODO check this worked + $signed = tempnam("", "signed"); + if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), NULL)) { + @unlink($file); + @unlink($signed); + $body = file_get_contents($signed); + } else { + @unlink($file); + @unlink($signed); + throw new phpmailerException($this->Lang("signing").openssl_error_string()); + } + } catch (phpmailerException $e) { + $body = ''; + if ($this->exceptions) { + throw $e; } - fclose($fp); - } else { - $this->SetError($this->Lang("signing").openssl_error_string()); - $result = ''; } - - unlink($file); - unlink($signed); } - return $result; + return $body; } /** * Returns the start of a message boundary. - * @access public + * @access private */ - public function GetBoundary($boundary, $charSet, $contentType, $encoding) { + private function GetBoundary($boundary, $charSet, $contentType, $encoding) { $result = ''; if($charSet == '') { $charSet = $this->CharSet; @@ -1102,18 +1156,18 @@ class PHPMailer { /** * Returns the end of a message boundary. - * @access public + * @access private */ - public function EndBoundary($boundary) { + private function EndBoundary($boundary) { return $this->LE . '--' . $boundary . '--' . $this->LE; } /** * Sets the message type. - * @access public + * @access private * @return void */ - public function SetMessageType() { + private function SetMessageType() { if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) { $this->message_type = 'plain'; } else { @@ -1129,7 +1183,8 @@ class PHPMailer { } } - /* Returns a formatted header line. + /** + * Returns a formatted header line. * @access public * @return string */ @@ -1161,70 +1216,81 @@ class PHPMailer { * @return bool */ public function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { - if(!@is_file($path)) { - $this->SetError($this->Lang('file_access') . $path); - return false; + try { + if ( !@is_file($path) ) { + throw new phpmailerException($this->Lang('file_access') . $path, self::STOP_CONTINUE); + } + $filename = basename($path); + if ( $name == '' ) { + $name = $filename; + } + + $this->attachment[] = array( + 0 => $path, + 1 => $filename, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => false, // isStringAttachment + 6 => 'attachment', + 7 => 0 + ); + + } catch (phpmailerException $e) { + $this->SetError($e->getMessage()); + if ($this->exceptions) { + throw $e; + } + echo $e->getMessage()."\n"; + if ( $e->getCode() == self::STOP_CRITICAL ) { + return false; + } } - - $filename = basename($path); - if($name == '') { - $name = $filename; - } - - $cur = count($this->attachment); - $this->attachment[$cur][0] = $path; - $this->attachment[$cur][1] = $filename; - $this->attachment[$cur][2] = $name; - $this->attachment[$cur][3] = $encoding; - $this->attachment[$cur][4] = $type; - $this->attachment[$cur][5] = false; // isStringAttachment - $this->attachment[$cur][6] = 'attachment'; - $this->attachment[$cur][7] = 0; - return true; } /** - * Gets all current attachments. - * Needed for testability - * @return array - */ + * Return the current array of attachments + * @return array + */ public function GetAttachments() { - return $this->attachment; + return $this->attachment; } /** * Attaches all fs, string, and binary attachments to the message. * Returns an empty string on failure. - * @access public + * @access private * @return string */ - public function AttachAll() { - /* Return text of body */ - $mime = array(); + private function AttachAll() { + // Return text of body + $mime = array(); $cidUniq = array(); + $incl = array(); - /* Add all attachments */ - for($i = 0; $i < count($this->attachment); $i++) { - /* Check for string attachment */ - $bString = $this->attachment[$i][5]; + // Add all attachments + foreach ($this->attachment as $attachment) { + // Check for string attachment + $bString = $attachment[5]; if ($bString) { - $string = $this->attachment[$i][0]; + $string = $attachment[0]; } else { - $path = $this->attachment[$i][0]; + $path = $attachment[0]; } - $filename = $this->attachment[$i][1]; - $name = $this->attachment[$i][2]; - $encoding = $this->attachment[$i][3]; - $type = $this->attachment[$i][4]; - $disposition = $this->attachment[$i][6]; - $cid = $this->attachment[$i][7]; - if ( isset($cidUniq[$cid]) ) { continue; } + if (in_array($attachment[0], $incl)) { continue; } + $filename = $attachment[1]; + $name = $attachment[2]; + $encoding = $attachment[3]; + $type = $attachment[4]; + $disposition = $attachment[6]; + $cid = $attachment[7]; + $incl[] = $attachment[0]; + if ( $disposition == 'inline' && isset($cidUniq[$cid]) ) { continue; } $cidUniq[$cid] = true; $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE); - //$mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE); $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE); $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE); @@ -1232,10 +1298,9 @@ class PHPMailer { $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE); } - //$mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $name, $this->LE.$this->LE); $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE); - /* Encode as string attachment */ + // Encode as string attachment if($bString) { $mime[] = $this->EncodeString($string, $encoding); if($this->IsError()) { @@ -1257,35 +1322,43 @@ class PHPMailer { } /** - * Encodes attachment in requested format. Returns an - * empty string on failure. - * @access public + * Encodes attachment in requested format. + * Returns an empty string on failure. + * @param string $path The full path to the file + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' + * @see EncodeFile() + * @access private * @return string */ - public function EncodeFile ($path, $encoding = 'base64') { - if(!@$fd = fopen($path, 'rb')) { - $this->SetError($this->Lang('file_open') . $path); - fclose($fd); + private function EncodeFile($path, $encoding = 'base64') { + try { + if (!is_readable($path)) { + throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE); + } + if (function_exists('get_magic_quotes')) { + function get_magic_quotes() { + return false; + } + } + if (PHP_VERSION < 6) { + $magic_quotes = get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + } + $file_buffer = file_get_contents($path); + $file_buffer = $this->EncodeString($file_buffer, $encoding); + if (PHP_VERSION < 6) { set_magic_quotes_runtime($magic_quotes); } + return $file_buffer; + } catch (Exception $e) { + $this->SetError($e->getMessage()); return ''; } - if (function_exists('get_magic_quotes')) { - function get_magic_quotes() { - return false; - } - } - if (PHP_VERSION < 6) { - $magic_quotes = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); - } - $file_buffer = file_get_contents($path); - $file_buffer = $this->EncodeString($file_buffer, $encoding); - if (PHP_VERSION < 6) { set_magic_quotes_runtime($magic_quotes); } - return $file_buffer; } /** - * Encodes string to requested format. Returns an - * empty string on failure. + * Encodes string to requested format. + * Returns an empty string on failure. + * @param string $str The text to encode + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' * @access public * @return string */ @@ -1298,6 +1371,7 @@ class PHPMailer { case '7bit': case '8bit': $encoded = $this->FixEOL($str); + //Make sure it ends with a line break if (substr($encoded, -(strlen($this->LE))) != $this->LE) $encoded .= $this->LE; break; @@ -1315,17 +1389,17 @@ class PHPMailer { } /** - * Encode a header string to best of Q, B, quoted or none. + * Encode a header string to best (shortest) of Q, B, quoted or none. * @access public * @return string */ - public function EncodeHeader ($str, $position = 'text') { + public function EncodeHeader($str, $position = 'text') { $x = 0; switch (strtolower($position)) { case 'phrase': if (!preg_match('/[\200-\377]/', $str)) { - /* Can't use addslashes as we don't know what value has magic_quotes_sybase. */ + // Can't use addslashes as we don't know what value has magic_quotes_sybase $encoded = addcslashes($str, "\0..\37\177\\\""); if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { return ($encoded); @@ -1337,7 +1411,7 @@ class PHPMailer { break; case 'comment': $x = preg_match_all('/[()"]/', $str, $matches); - /* Fall-through */ + // Fall-through case 'text': default: $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); @@ -1349,12 +1423,12 @@ class PHPMailer { } $maxlen = 75 - 7 - strlen($this->CharSet); - /* Try to select the encoding which should produce the shortest output */ + // Try to select the encoding which should produce the shortest output if (strlen($str)/3 < $x) { $encoding = 'B'; if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) { - // Use a custom function which correctly encodes and wraps long - // multibyte strings without breaking lines within a character + // Use a custom function which correctly encodes and wraps long + // multibyte strings without breaking lines within a character $encoded = $this->Base64EncodeWrapMB($str); } else { $encoded = base64_encode($str); @@ -1384,7 +1458,7 @@ class PHPMailer { if (function_exists('mb_strlen')) { return (strlen($str) > mb_strlen($str, $this->CharSet)); } else { // Assume no multibytes (we can't handle without mbstring functions anyway) - return False; + return false; } } @@ -1481,7 +1555,7 @@ class PHPMailer { * Encode string to RFC2045 (6.7) quoted-printable format * Uses a PHP5 stream filter to do the encoding about 64x faster than the old version * Also results in same content as you started with after decoding - * Note that there is a quoted_printable_encode function due to appear, possibly in PHP 5.3. + * @see EncodeQPphp() * @access public * @param string $string the text to encode * @param integer $line_max Number of chars allowed on a line before wrapping @@ -1512,12 +1586,15 @@ class PHPMailer { /** * Encode string to q encoding. + * @link http://tools.ietf.org/html/rfc2047 + * @param string $str the text to encode + * @param string $position Where the text is going to be used, see the RFC for what that means * @access public * @return string */ public function EncodeQ ($str, $position = 'text') { - /* There should not be any EOL in the string */ - $encoded = preg_replace("/[\r\n]*/", '', $str); + // There should not be any EOL in the string + $encoded = preg_replace('/[\r\n]*/', '', $str); switch (strtolower($position)) { case 'phrase': @@ -1527,13 +1604,14 @@ class PHPMailer { $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); case 'text': default: - /* Replace every high ascii, control =, ? and _ characters */ + // Replace every high ascii, control =, ? and _ characters + //TODO using /e (equivalent to eval()) is probably not a good idea $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e', "'='.sprintf('%02X', ord('\\1'))", $encoded); break; } - /* Replace every spaces to _ (more readable than =20) */ + // Replace every spaces to _ (more readable than =20) $encoded = str_replace(' ', '_', $encoded); return $encoded; @@ -1550,16 +1628,17 @@ class PHPMailer { * @return void */ public function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') { - /* Append to $attachment array */ - $cur = count($this->attachment); - $this->attachment[$cur][0] = $string; - $this->attachment[$cur][1] = $filename; - $this->attachment[$cur][2] = $filename; - $this->attachment[$cur][3] = $encoding; - $this->attachment[$cur][4] = $type; - $this->attachment[$cur][5] = true; // isString - $this->attachment[$cur][6] = 'attachment'; - $this->attachment[$cur][7] = 0; + // Append to $attachment array + $this->attachment[] = array( + 0 => $string, + 1 => $filename, + 2 => $filename, + 3 => $encoding, + 4 => $type, + 5 => true, // isStringAttachment + 6 => 'attachment', + 7 => 0 + ); } /** @@ -1577,26 +1656,27 @@ class PHPMailer { */ public function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { - if(!@is_file($path)) { + if ( !@is_file($path) ) { $this->SetError($this->Lang('file_access') . $path); return false; } $filename = basename($path); - if($name == '') { + if ( $name == '' ) { $name = $filename; } - /* Append to $attachment array */ - $cur = count($this->attachment); - $this->attachment[$cur][0] = $path; - $this->attachment[$cur][1] = $filename; - $this->attachment[$cur][2] = $name; - $this->attachment[$cur][3] = $encoding; - $this->attachment[$cur][4] = $type; - $this->attachment[$cur][5] = false; - $this->attachment[$cur][6] = 'inline'; - $this->attachment[$cur][7] = $cid; + // Append to $attachment array + $this->attachment[] = array( + 0 => $path, + 1 => $filename, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => false, // isStringAttachment + 6 => 'inline', + 7 => $cid + ); return true; } @@ -1607,15 +1687,12 @@ class PHPMailer { * @return bool */ public function InlineImageExists() { - $result = false; - for($i = 0; $i < count($this->attachment); $i++) { - if($this->attachment[$i][6] == 'inline') { - $result = true; - break; + foreach($this->attachment as $attachment) { + if ($attachment[6] == 'inline') { + return true; } } - - return $result; + return false; } ///////////////////////////////////////////////// @@ -1698,12 +1775,10 @@ class PHPMailer { /** * Adds the error message to the error container. - * Also gets SMTP error if there is one - * Returns void. - * @access private + * @access protected * @return void */ - private function SetError($msg) { + protected function SetError($msg) { $this->error_count++; if ($this->Mailer == 'smtp' and !is_null($this->smtp)) { $lasterror = $this->smtp->getError(); @@ -1716,10 +1791,11 @@ class PHPMailer { /** * Returns the proper RFC 822 formatted date. - * @access private + * @access public * @return string + * @static */ - private static function RFCDate() { + public static function RFCDate() { $tz = date('Z'); $tzs = ($tz < 0) ? '-' : '+'; $tz = abs($tz); @@ -1740,7 +1816,7 @@ class PHPMailer { } elseif (isset($_SERVER['SERVER_NAME'])) { $result = $_SERVER['SERVER_NAME']; } else { - $result = "localhost.localdomain"; + $result = 'localhost.localdomain'; } return $result; @@ -1803,15 +1879,13 @@ class PHPMailer { if(isset($images[2])) { foreach($images[2] as $i => $url) { // do not change urls for absolute images (thanks to corvuscorax) - if (!preg_match('/^[A-z][A-z]*:\/\//',$url)) { + if (!preg_match('#^[A-z]+://#',$url)) { $filename = basename($url); $directory = dirname($url); ($directory == '.')?$directory='':''; $cid = 'cid:' . md5($filename); - $fileParts = explode('.', $filename); - $fileParts = array_reverse($fileParts); - $ext = $fileParts[0]; - $mimeType = $this->_mime_types($ext); + $ext = pathinfo($filename, PATHINFO_EXTENSION); + $mimeType = self::_mime_types($ext); if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; } if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; } if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) { @@ -1823,20 +1897,22 @@ class PHPMailer { $this->IsHTML(true); $this->Body = $message; $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message))); - if ( !empty($textMsg) && empty($this->AltBody) ) { + if (!empty($textMsg) && empty($this->AltBody)) { $this->AltBody = html_entity_decode($textMsg); } - if ( empty($this->AltBody) ) { - $this->AltBody = 'To view this email message, open the email in with HTML compatibility!' . "\n\n"; + if (empty($this->AltBody)) { + $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n"; } } /** - * Gets the mime type of the embedded or inline image + * Gets the MIME type of the embedded or inline image + * @param string File extension * @access public - * @return mime type of ext + * @return string MIME type of ext + * @static */ - public function _mime_types($ext = '') { + public static function _mime_types($ext = '') { $mimes = array( 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', @@ -1926,38 +2002,35 @@ class PHPMailer { 'xl' => 'application/excel', 'eml' => 'message/rfc822' ); - return ( ! isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)]; + return (!isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)]; } /** - * Set (or reset) Class Objects (variables) - * - * Usage Example: - * $page->set('X-Priority', '3'); - * - * @access public - * @param string $name Parameter Name - * @param mixed $value Parameter Value - * NOTE: will not work with arrays, there are no arrays to set/reset - */ - public function set ( $name, $value = '' ) { - if ( isset($this->$name) ) { - $this->$name = $value; - } else { - $this->SetError('Cannot set or reset variable ' . $name); - return false; + * Set (or reset) Class Objects (variables) + * + * Usage Example: + * $page->set('X-Priority', '3'); + * + * @access public + * @param string $name Parameter Name + * @param mixed $value Parameter Value + * NOTE: will not work with arrays, there are no arrays to set/reset + * @todo Should this not be using __set() magic function? + */ + public function set($name, $value = '') { + try { + if (isset($this->$name) ) { + $this->$name = $value; + } else { + throw new phpmailerException($this->Lang('variable_set') . $name, self::STOP_CRITICAL); + } + } catch (Exception $e) { + $this->SetError($e->getMessage()); + if ($e->getCode() == self::STOP_CRITICAL) { + return false; + } } - } - - /** - * Read a file from a supplied filename and return it. - * - * @access public - * @param string $filename Parameter File Name - * @return string (or boolean false if it fails to read for any reason) - */ - public function getFile($filename) { - return @file_get_contents($filename); + return true; } /** @@ -1967,10 +2040,9 @@ class PHPMailer { * @return string */ public function SecureHeader($str) { - $str = trim($str); - $str = str_replace("\r", "", $str); - $str = str_replace("\n", "", $str); - return $str; + $str = str_replace("\r", '', $str); + $str = str_replace("\n", '', $str); + return trim($str); } /** @@ -1987,4 +2059,10 @@ class PHPMailer { } } +class phpmailerException extends Exception { + public function errorMessage() { + $errorMsg = '' . $this->getMessage() . "
\n"; + return $errorMsg; + } +} ?> \ No newline at end of file diff --git a/class.pop3.php b/class.pop3.php index 31c26ecd..021a068f 100644 --- a/class.pop3.php +++ b/class.pop3.php @@ -2,14 +2,16 @@ /*~ class.pop3.php .---------------------------------------------------------------------------. | Software: PHPMailer - PHP email class | -| Version: 2.3 | +| Version: 5.0.0 | | Contact: via sourceforge.net support pages (also www.codeworxtech.com) | | Info: http://phpmailer.sourceforge.net | | Support: http://sourceforge.net/projects/phpmailer/ | | ------------------------------------------------------------------------- | -| Author: Andy Prevost (project admininistrator) | -| Author: Brent R. Matzelle (original founder) | -| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. | +| Admin: Andy Prevost (project admininistrator) | +| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net | +| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net | +| Founder: Brent R. Matzelle (original founder) | +| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. | | Copyright (c) 2001-2003, Brent R. Matzelle | | ------------------------------------------------------------------------- | | License: Distributed under the Lesser General Public License (LGPL) | @@ -30,24 +32,25 @@ * NOTE: Designed for use with PHP version 5 and up * @package PHPMailer * @author Andy Prevost - * @copyright 2004 - 2008 Andy Prevost + * @author Marcus Bointon + * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL) * @version $Id$ */ /** * POP Before SMTP Authentication Class - * Version 2.3 + * Version 5.0.0 * * Author: Richard Davey (rich@corephp.co.uk) * Modifications: Andy Prevost * License: LGPL, see PHPMailer License * * Specifically for PHPMailer to allow POP before SMTP authentication. - * Does not yet work with APOP - if you have an APOP account, contact me + * Does not yet work with APOP - if you have an APOP account, contact Richard Davey * and we can test changes to this script. * - * This class is based on the structure of the SMTP class by Chris Ryan + * This class is based on the structure of the SMTP class originally authored by Chris Ryan * * This class is rfc 1939 compliant and implements all the commands * required for POP3 connection, authentication and disconnection. @@ -111,13 +114,13 @@ class POP3 { */ public $password; - /**#@+ - * @access private - */ + ///////////////////////////////////////////////// + // PROPERTIES, PRIVATE AND PROTECTED + ///////////////////////////////////////////////// + private $pop_conn; private $connected; private $error; // Error log array - /**#@-*/ /** * Constructor, sets the initial values diff --git a/class.smtp.php b/class.smtp.php index a6e10ae3..f2bb4bdd 100644 --- a/class.smtp.php +++ b/class.smtp.php @@ -2,14 +2,16 @@ /*~ class.smtp.php .---------------------------------------------------------------------------. | Software: PHPMailer - PHP email class | -| Version: 2.3 | +| Version: 5.0.0 | | Contact: via sourceforge.net support pages (also www.codeworxtech.com) | | Info: http://phpmailer.sourceforge.net | | Support: http://sourceforge.net/projects/phpmailer/ | | ------------------------------------------------------------------------- | -| Author: Andy Prevost (project admininistrator) | -| Author: Brent R. Matzelle (original founder) | -| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. | +| Admin: Andy Prevost (project admininistrator) | +| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net | +| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net | +| Founder: Brent R. Matzelle (original founder) | +| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. | | Copyright (c) 2001-2003, Brent R. Matzelle | | ------------------------------------------------------------------------- | | License: Distributed under the Lesser General Public License (LGPL) | @@ -30,6 +32,7 @@ * NOTE: Designed for use with PHP version 5 and up * @package PHPMailer * @author Andy Prevost + * @author Marcus Bointon * @copyright 2004 - 2008 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL) * @version $Id$ @@ -40,8 +43,7 @@ * commands except TURN which will always return a not implemented * error. SMTP also provides some utility methods for sending mail * to an SMTP server. - * @package PHPMailer - * @author Chris Ryan + * original author: Chris Ryan */ class SMTP { @@ -69,13 +71,13 @@ class SMTP { */ public $do_verp = false; - /**#@+ - * @access private - */ - private $smtp_conn; // the socket to the server - private $error; // error if any on the last call - private $helo_rply; // the reply the server sent to us for HELO - /**#@-*/ + ///////////////////////////////////////////////// + // PROPERTIES, PRIVATE AND PROTECTED + ///////////////////////////////////////////////// + + private $smtp_conn; // the socket to the server + private $error; // error if any on the last call + private $helo_rply; // the reply the server sent to us for HELO /** * Initialize the class so that the data is in a known state. @@ -90,9 +92,9 @@ class SMTP { $this->do_debug = 0; } - /************************************************************* - * CONNECTION FUNCTIONS * - ***********************************************************/ + ///////////////////////////////////////////////// + // CONNECTION FUNCTIONS + ///////////////////////////////////////////////// /** * Connect to the server specified on the port specified. @@ -108,15 +110,12 @@ class SMTP { * @return bool */ public function Connect($host, $port = 0, $tval = 30) { - /* set the error val to null so there is no confusion */ + // set the error val to null so there is no confusion $this->error = null; - /* make sure we are __not__ connected */ + // make sure we are __not__ connected if($this->connected()) { - /* ok we are connected! what should we do? - * for now we will just give an error saying we - * are already connected - */ + // already connected, generate error $this->error = array("error" => "Already connected to a server"); return false; } @@ -125,40 +124,33 @@ class SMTP { $port = $this->SMTP_PORT; } - /* connect to the smtp server */ - $this->smtp_conn = fsockopen($host, // the host of the server + // connect to the smtp server + $this->smtp_conn = @fsockopen($host, // the host of the server $port, // the port to use $errno, // error number if any $errstr, // error message if any $tval); // give up after ? secs - /* verify we connected properly */ + // verify we connected properly if(empty($this->smtp_conn)) { $this->error = array("error" => "Failed to connect to server", "errno" => $errno, "errstr" => $errstr); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": $errstr ($errno)" . $this->CRLF; + echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '
'; } return false; } - /* sometimes the SMTP server takes a little longer to respond - * so we will give it a longer timeout for the first read - * - Windows still does not have support for this timeout function - */ + // SMTP server can take longer to respond, give longer timeout for first read + // Windows does not have support for this timeout function if(substr(PHP_OS, 0, 3) != "WIN") socket_set_timeout($this->smtp_conn, $tval, 0); - /* get any announcement stuff */ + // get any announcement $announce = $this->get_lines(); - /* set the timeout of any socket functions at 1/10 of a second */ - //if(function_exists("socket_set_timeout")) - // socket_set_timeout($this->smtp_conn, 0, 100000); - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce; + echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '
'; } return true; @@ -187,7 +179,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; } if($code != 220) { @@ -196,12 +188,12 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; } return false; } - //Begin encrypted connection + // Begin encrypted connection if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { return false; } @@ -228,8 +220,7 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; } return false; } @@ -246,8 +237,7 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; } return false; } @@ -264,8 +254,7 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; } return false; } @@ -282,11 +271,9 @@ class SMTP { if(!empty($this->smtp_conn)) { $sock_status = socket_get_status($this->smtp_conn); if($sock_status["eof"]) { - // hmm this is an odd situation... the socket is - // valid but we are not connected anymore + // the socket is valid but we are not connected if($this->do_debug >= 1) { - echo "SMTP -> NOTICE:" . $this->CRLF . - "EOF caught while checking if connected"; + echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected"; } $this->Close(); return false; @@ -313,9 +300,9 @@ class SMTP { } } - /*************************************************************** - * SMTP COMMANDS * - *************************************************************/ + ///////////////////////////////////////////////// + // SMTP COMMANDS + ///////////////////////////////////////////////// /** * Issues a data command and sends the msg_data to the server @@ -351,7 +338,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; } if($code != 354) { @@ -360,8 +347,7 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; } return false; } @@ -374,7 +360,7 @@ class SMTP { * each of those into smaller lines to fit within the limit. * in addition we will be looking for lines that start with * a period '.' and append and additional period '.' to that - * line. NOTE: this does not count towards are limit. + * line. NOTE: this does not count towards limit. */ // normalize the line breaks so we know the explode works @@ -390,6 +376,7 @@ class SMTP { * and we can process all lines before a blank "" line as * headers. */ + $field = substr($lines[0],0,strpos($lines[0],":")); $in_headers = false; if(!empty($field) && !strstr($field," ")) { @@ -417,8 +404,7 @@ class SMTP { $line = substr($line,$pos + 1); } - /* if we are processing headers we need to - * add a LWSP-char to the front of the new line + /* if processing headers add a LWSP-char to the front of new line * rfc 822 on long msg headers */ if($in_headers) { @@ -427,7 +413,7 @@ class SMTP { } $lines_out[] = $line; - // now send the lines to the server + // send the lines to the server while(list(,$line_out) = @each($lines_out)) { if(strlen($line_out) > 0) { @@ -439,15 +425,14 @@ class SMTP { } } - // ok all the message data has been sent so lets get this - // over with aleady + // message data has been sent fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; } if($code != 250) { @@ -456,69 +441,13 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; } return false; } return true; } - /** - * Expand takes the name and asks the server to list all the - * people who are members of the _list_. Expand will return - * back and array of the result or false if an error occurs. - * Each value in the array returned has the format of: - * [ ] - * The definition of is defined in rfc 821 - * - * Implements rfc 821: EXPN - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE FAILURE: 550 - * SMTP CODE ERROR : 500,501,502,504,421 - * @access public - * @return string array - */ - public function Expand($name) { - $this->error = null; // so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Expand() without being connected"); - return false; - } - - fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => "EXPN not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - - // parse the reply and place in our array to return to user - $entries = explode($this->CRLF,$rply); - while(list(,$l) = @each($entries)) { - $list[] = substr($l,4); - } - - return $list; - } - /** * Sends the HELO command to the smtp server. * This makes sure that we and the server are in @@ -540,19 +469,17 @@ class SMTP { return false; } - // if a hostname for the HELO was not specified determine - //a suitable one to send + // if hostname for HELO was not specified send default if(empty($host)) { - // we need to determine some sort of appopiate default - // to send to the server + // determine appropriate default to send to server $host = "localhost"; } // Send extended hello first (RFC 2821) - if(!$this->SendHello("EHLO", $host)) - { - if(!$this->SendHello("HELO", $host)) - return false; + if(!$this->SendHello("EHLO", $host)) { + if(!$this->SendHello("HELO", $host)) { + return false; + } } return true; @@ -570,7 +497,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply; + echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '
'; } if($code != 250) { @@ -579,8 +506,7 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; } return false; } @@ -590,59 +516,6 @@ class SMTP { return true; } - /** - * Gets help information on the keyword specified. If the keyword - * is not specified then returns generic help, ussually contianing - * A list of keywords that help is available on. This function - * returns the results back to the user. It is up to the user to - * handle the returned data. If an error occurs then false is - * returned with $this->error set appropiately. - * - * Implements rfc 821: HELP [ ] - * - * SMTP CODE SUCCESS: 211,214 - * SMTP CODE ERROR : 500,501,502,504,421 - * @access public - * @return string - */ - public function Help($keyword = '') { - $this->error = null; // to avoid confusion - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Help() without being connected"); - return false; - } - - $extra = ""; - if(!empty($keyword)) { - $extra = " " . $keyword; - } - - fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 211 && $code != 214) { - $this->error = - array("error" => "HELP not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - - return $rply; - } - /** * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True @@ -673,7 +546,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; } if($code != 250) { @@ -682,50 +555,7 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - return true; - } - - /** - * Sends the command NOOP to the SMTP server. - * - * Implements from rfc 821: NOOP - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE ERROR : 500, 421 - * @access public - * @return bool - */ - public function Noop() { - $this->error = null; // so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Noop() without being connected"); - return false; - } - - fputs($this->smtp_conn,"NOOP" . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => "NOOP not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; } return false; } @@ -759,7 +589,7 @@ class SMTP { $byemsg = $this->get_lines(); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg; + echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '
'; } $rval = true; @@ -773,8 +603,7 @@ class SMTP { "smtp_rply" => substr($byemsg,4)); $rval = false; if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $e["error"] . ": " . - $byemsg . $this->CRLF; + echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '
'; } } @@ -812,7 +641,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; } if($code != 250 && $code != 251) { @@ -821,8 +650,7 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; } return false; } @@ -856,7 +684,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; } if($code != 250) { @@ -865,8 +693,7 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; } return false; } @@ -874,54 +701,6 @@ class SMTP { return true; } - /** - * Starts a mail transaction from the email address specified in - * $from. Returns true if successful or false otherwise. If True - * the mail transaction is started and then one or more Recipient - * commands may be called followed by a Data command. This command - * will send the message to the users terminal if they are logged - * in. - * - * Implements rfc 821: SEND FROM: - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE SUCCESS: 552,451,452 - * SMTP CODE SUCCESS: 500,501,502,421 - * @access public - * @return bool - */ - public function Send($from) { - $this->error = null; // so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Send() without being connected"); - return false; - } - - fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => "SEND not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - return true; - } - /** * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True @@ -953,7 +732,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
'; } if($code != 250) { @@ -962,56 +741,7 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - return true; - } - - /** - * Starts a mail transaction from the email address specified in - * $from. Returns true if successful or false otherwise. If True - * the mail transaction is started and then one or more Recipient - * commands may be called followed by a Data command. This command - * will send the message to the users terminal if they are logged - * in or mail it to them if they are not. - * - * Implements rfc 821: SOML FROM: - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE SUCCESS: 552,451,452 - * SMTP CODE SUCCESS: 500,501,502,421 - * @access public - * @return bool - */ - public function SendOrMail($from) { - $this->error = null; // so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called SendOrMail() without being connected"); - return false; - } - - fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => "SOML not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
'; } return false; } @@ -1035,56 +765,11 @@ class SMTP { $this->error = array("error" => "This method, TURN, of the SMTP ". "is not implemented"); if($this->do_debug >= 1) { - echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF; + echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '
'; } return false; } - /** - * Verifies that the name is recognized by the server. - * Returns false if the name could not be verified otherwise - * the response from the server is returned. - * - * Implements rfc 821: VRFY - * - * SMTP CODE SUCCESS: 250,251 - * SMTP CODE FAILURE: 550,551,553 - * SMTP CODE ERROR : 500,501,502,421 - * @access public - * @return int - */ - public function Verify($name) { - $this->error = null; // so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Verify() without being connected"); - return false; - } - - fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250 && $code != 251) { - $this->error = - array("error" => "VRFY failed on name '$name'", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - return $rply; - } - /** * Get the current error * @access public @@ -1094,9 +779,9 @@ class SMTP { return $this->error; } - /******************************************************************* - * INTERNAL FUNCTIONS * - ******************************************************************/ + ///////////////////////////////////////////////// + // INTERNAL FUNCTIONS + ///////////////////////////////////////////////// /** * Read in as many lines as possible @@ -1111,17 +796,14 @@ class SMTP { $data = ""; while($str = @fgets($this->smtp_conn,515)) { if($this->do_debug >= 4) { - echo "SMTP -> get_lines(): \$data was \"$data\"" . - $this->CRLF; - echo "SMTP -> get_lines(): \$str is \"$str\"" . - $this->CRLF; + echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '
'; + echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '
'; } $data .= $str; if($this->do_debug >= 4) { - echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF; + echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '
'; } - // if the 4th character is a space then we are done reading - // so just break the loop + // if 4th character is a space, we are done reading, break the loop if(substr($str,3,1) == " ") { break; } } return $data; diff --git a/codeworxtech.html b/codeworxtech.html deleted file mode 100644 index 68ccaa93..00000000 --- a/codeworxtech.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - -
-
-
-The http://phpmailer.codeworxtech.com/ website now carries a few -advertisements through the Google Adsense network to help offset -some of our costs.
-Thanks ....
-
-

My name is Andy Prevost, AKA "codeworxtech".
-www.codeworxtech.com for more information.
-

-

WHY USE OUR TOOLS & WHAT'S IN IT FOR YOU?

-

A valid question. We're developers too. We've been writing software, primarily for the internet, for more than 15 years. Along the way, there are two major things that had tremendous impact of our company: PHP and Open Source. PHP is without doubt the most popular platform for the internet. There has been more progress in this area of technology because of Open Source software than in any other IT segment. We have used many open source tools, some as learning tools, some as components in projects we were working on. To us, it's not about popularity ... we're committed to robust, stable, and efficient tools you can use to get your projects in your user's hands quickly. So the shorter answer: what's in it for you? rapid development and rapid deployment without fuss and with straight forward open source licensing.

-

Now, the introductions:

-

Our company, Worx International Inc., is the publisher of several Open Source applications and developer tools as well as several commercial PHP applications. The Open Source applications are ttCMS and DCP Portal. The Open Source developer tools include QuickComponents (QuickSkin and QuickCache) and now PHPMailer. -We have staff and offices in the United States, Caribbean, the Middle -East, and our primary development center in Canada. Our company is represented by -agents and resellers globally.

-

Worx International Inc. is at the forefront of developing PHP applications. Our staff are all Zend Certified university educated and experts at object oriented programming. While Worx International Inc. can handle any project from trouble shooting programs written by others all the way to finished mission-critical applications, we specialize in taking projects from inception all the way through to implementation - on budget, and on time. If you need help with your projects, we're the team to get it done right at a reasonable price.

-

Over the years, there have been a number of tools that have been constant favorites in all of our projects. We have become the project administrators for most of these tools.

-

Our developer tools are all Open Source. Here's a brief description:

-
    -
  • PHPMailer. Originally authored by Brent Matzelle, PHPMailer is the leading "email transfer class" for PHP. PHPMailer is downloaded more than 18000 times each and every month by developers looking for a stable, simple email solution. We used it ourselves for years as our favorite tool. It's always been small (the entire footprint is around 100 Kb), stable, and as complete a solution as you can find. Other tools are nowhere near as simple. And more importantly, most of our applications (including PHPMailer) is implemented in a smaller footprint than one competing email class. Our thanks to Brent Matzelle for this superb tool - our commitment is to keep it lean, keep it focused, and compliant with standards. Visit the PHPMailer website at - http://phpmailer.codeworxtech.com/.
    - Please note: all of our focus is now on the PHPMailer for PHP5.
    - PS. While you are at it, please visit our sponsor's sites, click on their ads. - It helps offset some of our costs.
    - Want to help? We're looking for progressive developers to join our team of volunteer professionals working on PHPMailer. Our entire focus is on PHPMailer for PHP5, and our next major task is to enhance our - exception/error handling with PHP 5's object oriented try/throw/catch mechanisms. If you are interested, let us know.
    -
    -
  • -
  • QuickCache. Originally authored by Jean Pierre Deckers as jpCache, QuickCache is an HTTP OpCode caching strategy that works on your entire site with only one line of code at the top of your script. The cached pages can be stored as files or as database objects. The benefits are absolutely astounding: bandwidth savings of up to 80% and screen display times increased by 8 - 10x. Visit the QuickCache website at - http://quickcache.codeworxtech.com/.
    -
    -
  • -
  • QuickSkin. Originally authored by Philipp v. Criegern and named "SmartTemplate". The project was taken over by Manuel 'EndelWar' Dalla Lana and now by "codeworxtech". QuickSkin is one of the truly outstanding templating engines available, but has always been confused with Smarty Templating Engine. QuickSkin is even more relevant today than when it was launched. It's a small footprint with big impact on your projects. It features a built in caching technology, token based substitution, and works on the concept of one single HTML file as the template. The HTML template file can contain variable information making it one small powerful tool for your developer tool kit. Visit the QuickSkin website at - http://quickskin.codeworxtech.com/.
    -
    -
  • -
-

We're committed to PHP and to the Open Source community.

-

Opportunities with Worx International Inc.:

-
    -
  • Resellers/Agents: We're always interested in talking with companies that -want to represent -Worx International Inc. in their markets. We also have private label programs for our commercial products (in certain circumstances).
  • -
  • Programmers/Developers: We are usually fully staffed, however, if you would like to be considered for a career with -Worx International Inc., we would be pleased to hear from you.
    -A few things to note:
    -
      -
    • experience level does not matter: from fresh out of college to multi-year experience - it's your - creative mind and a positive attitude we want
    • -
    • if you contact us looking for employment, include a cover letter, indicate what type of work/career you are looking for and expected compensation
    • -
    • if you are representing someone else looking for work, do not contact us. We have an exclusive relationship with a recruiting partner already and not interested in altering the arrangement. We will not hire your candidate under any circumstances unless they wish to approach us individually.
    • -
    • any contact that ignores any of these points will be discarded
    • -
  • -
  • Affiliates/Partnerships: We are interested in partnering with other firms who are leaders in their field. We clearly understand that successful companies are built on successful relationships in all industries world-wide. We currently have innovative relationships throughout the world that are mutually beneficial. Drop us a line and let's talk.
  • -
-Regards,
-Andy Prevost (aka, codeworxtech)
-codeworxtech@users.sourceforge.net
-
-We now also offer website design. hosting, and remote forms processing. Visit WorxStudio.com for more information.
-
-
- - diff --git a/examples/contents.html b/examples/contents.html index 70c7e307..3d445ba4 100644 --- a/examples/contents.html +++ b/examples/contents.html @@ -1,12 +1,20 @@ - +


- This is a test of PHPMailer v2.0.0 rc1.
+ This is a test of PHPMailer.

This particular example uses HTML, with a <div> tag and inline
styles.

-Also note the use of the PHPMailer at the top with no specific code to handle -including it in the body of the email.
+Also note the use of the PHPMailer logo above with no specific code to handle +including it.
+Included are two attachments:
+phpmailer.gif is an attachment and used inline as a graphic (above)
+phpmailer_mini.gif is an attachment
+
+PHPMailer:
+Author: Andy Prevost (codeworxtech@users.sourceforge.net)
+Author: Marcus Bointon (coolbru@users.sourceforge.net)
+ diff --git a/examples/images/phpmailer.png b/examples/images/phpmailer.png deleted file mode 100644 index abe0101f36b3f0b3aac2362b546255e5c79fc9d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3506 zcmV;j4NdZiP)wjaBy(X&(Fa?KtMo1zP`S(Ffh80kLtg_wO?PaBqX+LYpo0nw|955M@PM~ zvb?6I`tR?uJ3F|8gRU4Du@DfvFfi}W&$Lrh%V1!;nwsFBpY`A0wjdzekB`uBaOJPB z#!yhI008*-_@n>;m;eBu005={0E_?tfdBxrv$J>r0N2;ohX4Tl{QU6n@caAw;Nalm z;^NfQ)bH=_b8~ai(b1lso|ToAe}8|c003qP2u&CmK|w)kYHEapgut(_WMpJhQ&V~% zAV(Y=ejp%6M@LLdOq+0U&A-2uU|^V-m|tICMMXto2ncQz6h$;NLNPH_M@M)X8i`(B zgilXBFff#9X-gOwL_|b*9v+imV6UN}l!k^|C@5_c6FxC9V+jeRl$2`?4SgOShg4KO zEG%U@I#enuXEHL%yu6Hidy`&XSt_Uz0000MbVXQnQ*UN;cVTj60B31tGH`BZATlmA zE-+0{CL#a;3;Rh#K~#9!?VV?vn>rSNA-D z0)eryGrqf=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*6;#+NFbXh=oeLZ&WJjC|_YLw14i008yl%Wlb2DNN0&CG6WN0q9V^e{@ z;Z7^AnGYgLLh2!fDVAw~{t-ZNMK_LeUXoA|kgjDJ$v}-LCq|K}E>$#01(07@Ub2TI zXb65MMT1{QCJ9oSYKkPIFkqvr$*50p5!400Nv5P4WJerUNG%>V;AXhwrXk&f$mGRm zkRQm=AeqsSs4}4L<69{U$$OGeEe8mhi1>Xd5~nOy>+#w3^Azfj5BC|WhqR-`l_K-}Ap6xq14Bx9K~n@7(`;|3!*z$g`7=KYN|NJ)M7W_PhSu zDO>2LC%^dS)mi$UfBx3p$N%WR^3yd&9iM*u%da12U!>sq8y8>w=#TyPs5%fmJi7e$ zXWxAN)kXg86hig!s~^00-hVl5(=VqzfAP1MpS^l~vHZ#pp?df1_1kx!zWiP<8_CO0 z-@Sc(cDMLFD&kik+&_Er^x+4+Y$Ok#J~_Mpfc|nCkvq5VT|D}*myP7n#l72imM>o6 gd)d15PThe example file "test_mail.php" contents include:

-
- -<?php
-
-include_once('../class.phpmailer.php');
-
-$mail = new PHPMailer();
-
-$body = $mail->getFile('contents.html');
-
-$body = eregi_replace("[\]",'',$body);
-$subject = eregi_replace("[\]",'',$subject);
-
-$mail->From = "name@yourdomain.com";
-$mail->FromName = "First Last";
-
-$mail->Subject = "PHPMailer Test Subject";
-
-$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
-
-$mail->MsgHTML($body);
-
-$mail->AddAddress("whoto@otherdomain.com", "John Doe");
-
-if(!$mail->Send()) {
- echo 'Failed to send mail';
-} else {
- echo 'Mail sent';
-}
-
-?> -
-
-
-Although you could use full compabitility with PHPMailer 1.7.3, this example -shows how to use the new features. If you view 'contents.html', you will note -that there is a background image used in the <body tag as well as an image used -with a regular <img tag. Here's what the HTML file looks like:
-
-
- -<body background="images/bkgrnd.gif" style="margin: 0px;">
-<div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
-<div align="center"><img src="images/phpmailer.gif" style="height: 90px; width: 340px"></div><br>
-<br>
- This is a test of PHPMailer v2.0.0 rc1.<br>
-<br>
-This particular example uses <strong>HTML</strong>, with a <div> tag and inline<br>
-styles.<br>
-<br>
-Also note the use of the PHPMailer at the top with no specific code to handle
-including it in the body of the email.</div>
-</body>
-
-
-
-A few things to notice in the PHP script that generates the email: +This release of PHPMailer (v5.0.0) sets a new milestone in the development +cycle of PHPMailer. First, class.phpmailer.php has a small footprint (65.7 Kb), +while class.smtp.php is even smaller than before (at only 25.0 Kb).
+
+We have maintained all functionality and added Exception handling unique to +PHP 5/6.
+
+There is only one function that has been removed: that is getFile(). The reason +for this is that getFile() became a wrapper for the PHP function 'file_get_contents()' +and nothing more. Rather than burden the class with a function already available +in PHP, we decided to remove it.
+
+Our new Exception handling provides your own scripts far more power than ever.
+
+We have also enhanced the "packaging" of PHPMailer with an entirely new set of +examples. Included are both basic and advanced examples showing how you can take +advantage of PHP Exception handling to improve your own scripts.
+
+A few things to note about PHPMailer:
  • the use of $mail->AltBody is completely optional. If not used, PHPMailer - will use the HTML text with htmlentities().
  • -
  • the background= and <img src= images were processed without any directives - or methods from the PHP script
  • -
  • there is no specific code to define the image type ... that is handled + will use the HTML text with htmlentities().
    + We also highly recommend using HTML2Text authored by Jon Abernathy. The class description + and download can be viewed at: http://www.chuggnutt.com/html2text.php. +
  • +
  • there is no specific code to define image or attachment types ... that is handled automatically by PHPMailer when it parses the images
  • -
  • we are using a new class method '$mail->MsgHTML($body)' ... that is what will handle the parsing of the images and creating the AltBody text
-

Of course, you can still use PHPMailer the same way you have in the past. -That provides full compatibility with all existing scripts, while new scripts -can take advantage of the new features.

-

Modify test_mail.php now with your own email address and try it out.

-To see what the email SHOULD look like in your HTML compatible email viewer: click here
- +A note to users that want to use SMTP with PHPMailer. The most common problems are: +
    +
  • wrong port ... most ISP (Internet Service Providers) will not allow relaying through + their servers. If that's the case with your ISP, try using port 26. +
  • +
  • wrong authentication information (username and/or password) ... don't forget that + many servers require the account name to be in the format of the full email address. +
  • +
  • ... if these tips do not get your SMTP settings working, we have a debug mode + for helping you determine the problem. Insert this after $mail->IsSMTP();
    + $mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
    + note that a setting of 2 will display all errors and messages generated by the SMTP + server
    +
  • +
+Our examples all use an HTML file in the /examples folder. To see what the email SHOULD +look like in your HTML compatible email viewer: click here
+
+From the PHPMailer team:
+Author: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net (and Project Administrator)
+Author: Marcus Bointon (coolbru) coolbru@users.sourceforge.net
diff --git a/examples/pop3_before_smtp_test.php b/examples/pop3_before_smtp_test.php deleted file mode 100644 index 794b2a26..00000000 --- a/examples/pop3_before_smtp_test.php +++ /dev/null @@ -1,39 +0,0 @@ - - -POP before SMTP Test - - - - -
-Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);
-
-  $mail = new PHPMailer();
-
-  $mail->IsSMTP();
-  $mail->SMTPDebug = 2;
-  $mail->IsHTML(false);
-
-  $mail->Host     = 'relay.example.com';
-
-  $mail->From     = 'mailer@example.com';
-  $mail->FromName = 'Example Mailer';
-
-  $mail->Subject  =  'My subject';
-  $mail->Body     =  'Hello world';
-  $mail->AddAddress('name@anydomain.com', 'First Last');
-
-  if (!$mail->Send())
-  {
-    echo $mail->ErrorInfo;
-  }
-?>
-
- - - diff --git a/examples/test1.php b/examples/test1.php deleted file mode 100644 index 5e9a72fa..00000000 --- a/examples/test1.php +++ /dev/null @@ -1,29 +0,0 @@ -getFile('contents.html'); - -$body = eregi_replace("[\]",'',$body); -$subject = eregi_replace("[\]",'',$subject); - -$mail->From = "name@yourdomain.com"; -$mail->FromName = "First Last"; - -$mail->Subject = "PHPMailer Test Subject"; - -$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test - -$mail->MsgHTML($body); - -$mail->AddAddress("whoto@otherdomain.com", "John Doe"); - -if(!$mail->Send()) { - echo 'Failed to send mail'; -} else { - echo 'Mail sent'; -} - -?> diff --git a/examples/test_db_smtp_basic.php b/examples/test_db_smtp_basic.php new file mode 100644 index 00000000..85d01f8d --- /dev/null +++ b/examples/test_db_smtp_basic.php @@ -0,0 +1,58 @@ + + +PHPMailer - MySQL Database - SMTP basic test with authentication + + + +IsSMTP(); // telling the class to use SMTP +$mail->Host = "smtp1.site.com;smtp2.site.com"; +$mail->SMTPAuth = true; // enable SMTP authentication +$mail->SMTPKeepAlive = true; // SMTP connection will not close after each email sent +$mail->Host = "mail.yourdomain.com"; // sets the SMTP server +$mail->Port = 26; // set the SMTP port for the GMAIL server +$mail->Username = "yourname@yourdomain"; // SMTP account username +$mail->Password = "yourpassword"; // SMTP account password +$mail->SetFrom('list@mydomain.com', 'List manager'); +$mail->AddReplyTo('list@mydomain.com', 'List manager'); + +$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication"; + +@MYSQL_CONNECT("localhost","root","password"); +@mysql_select_db("my_company"); +$query = "SELECT full_name, email, photo FROM employee WHERE id=$id"; +$result = @MYSQL_QUERY($query); + +while ($row = mysql_fetch_array ($result)) { + $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test + $mail->MsgHTML($body); + $mail->AddAddress($row["email"], $row["full_name"]); + $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg"); + + if(!$mail->Send()) { + echo "Mailer Error (" . str_replace("@", "@", $row["email"]) . ') ' . $mail->ErrorInfo . '
'; + } else { + echo "Message sent to :" . $row["full_name"] . ' (' . str_replace("@", "@", $row["email"]) . ')
'; + } + // Clear all addresses and attachments for next loop + $mail->ClearAddresses(); + $mail->ClearAttachments(); +} +?> + + + diff --git a/examples/test_mail.php b/examples/test_mail.php deleted file mode 100644 index e87056e9..00000000 --- a/examples/test_mail.php +++ /dev/null @@ -1,29 +0,0 @@ -getFile('contents.html'); -$body = eregi_replace("[\]",'',$body); - -$mail->From = "name@yourdomain.com"; -$mail->FromName = "First Last"; - -$mail->Subject = "PHPMailer Test Subject via mail()"; - -$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test - -$mail->MsgHTML($body); - -$mail->AddAddress("whoto@otherdomain.com", "John Doe"); - -$mail->AddAttachment("images/phpmailer.gif"); // attachment - -if(!$mail->Send()) { - echo "Mailer Error: " . $mail->ErrorInfo; -} else { - echo "Message sent!"; -} - -?> diff --git a/examples/test_mail_advanced.php b/examples/test_mail_advanced.php new file mode 100644 index 00000000..db0dd53b --- /dev/null +++ b/examples/test_mail_advanced.php @@ -0,0 +1,31 @@ + + +PHPMailer - Mail() advanced test + + + +AddReplyTo('name@yourdomain.com', 'First Last'); + $mail->AddAddress('whoto@otherdomain.com', 'John Doe'); + $mail->SetFrom('name@yourdomain.com', 'First Last'); + $mail->AddReplyTo('name@yourdomain.com', 'First Last'); + $mail->Subject = 'PHPMailer Test Subject via mail(), advanced'; + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically + $mail->MsgHTML(file_get_contents('contents.html')); + $mail->AddAttachment('images/phpmailer.gif'); // attachment + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment + $mail->Send(); + echo "Message Sent OK

\n"; +} catch (phpmailerException $e) { + echo $e->errorMessage(); //Pretty error messages from PHPMailer +} catch (Exception $e) { + echo $e->getMessage(); //Boring error messages from anything else! +} +?> + + diff --git a/examples/test_mail_basic.php b/examples/test_mail_basic.php new file mode 100644 index 00000000..5db9f8fb --- /dev/null +++ b/examples/test_mail_basic.php @@ -0,0 +1,43 @@ + + +PHPMailer - Mail() basic test + + + +AddReplyTo("name@yourdomain.com","First Last"); + +$mail->SetFrom('name@yourdomain.com', 'First Last'); + +$mail->AddReplyTo("name@yourdomain.com","First Last"); + +$address = "whoto@otherdomain.com"; +$mail->AddAddress($address, "John Doe"); + +$mail->Subject = "PHPMailer Test Subject via mail(), basic"; + +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test + +$mail->MsgHTML($body); + +$mail->AddAttachment("images/phpmailer.gif"); // attachment +$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment + +if(!$mail->Send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} + +?> + + + diff --git a/examples/test_pop_before_smtp_advanced.php b/examples/test_pop_before_smtp_advanced.php new file mode 100644 index 00000000..1828b30b --- /dev/null +++ b/examples/test_pop_before_smtp_advanced.php @@ -0,0 +1,40 @@ + + +POP before SMTP Test + + + +Authorise('pop3.yourdomain.com', 110, 30, 'username', 'password', 1); + +$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch + +$mail->IsSMTP(); + +try { + $mail->SMTPDebug = 2; + $mail->Host = 'pop3.yourdomain.com'; + $mail->AddReplyTo('name@yourdomain.com', 'First Last'); + $mail->AddAddress('whoto@otherdomain.com', 'John Doe'); + $mail->SetFrom('name@yourdomain.com', 'First Last'); + $mail->AddReplyTo('name@yourdomain.com', 'First Last'); + $mail->Subject = 'PHPMailer Test Subject via mail(), advanced'; + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically + $mail->MsgHTML(file_get_contents('contents.html')); + $mail->AddAttachment('images/phpmailer.gif'); // attachment + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment + $mail->Send(); + echo "Message Sent OK

\n"; +} catch (phpmailerException $e) { + echo $e->errorMessage(); //Pretty error messages from PHPMailer +} catch (Exception $e) { + echo $e->getMessage(); //Boring error messages from anything else! +} +?> + + + diff --git a/examples/test_pop_before_smtp_basic.php b/examples/test_pop_before_smtp_basic.php new file mode 100644 index 00000000..3673436a --- /dev/null +++ b/examples/test_pop_before_smtp_basic.php @@ -0,0 +1,49 @@ + + +POP before SMTP Test + + + +Authorise('pop3.yourdomain.com', 110, 30, 'username', 'password', 1); + +$mail = new PHPMailer(); + +$body = file_get_contents('contents.html'); +$body = eregi_replace("[\]",'',$body); + +$mail->IsSMTP(); +$mail->SMTPDebug = 2; +$mail->Host = 'pop3.yourdomain.com'; + +$mail->SetFrom('name@yourdomain.com', 'First Last'); + +$mail->AddReplyTo("name@yourdomain.com","First Last"); + +$mail->Subject = "PHPMailer Test Subject via POP before SMTP, basic"; + +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test + +$mail->MsgHTML($body); + +$address = "whoto@otherdomain.com"; +$mail->AddAddress($address, "John Doe"); + +$mail->AddAttachment("images/phpmailer.gif"); // attachment +$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment + + +if(!$mail->Send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} + +?> + + + diff --git a/examples/test_sendmail.php b/examples/test_sendmail.php deleted file mode 100644 index 38eb78d5..00000000 --- a/examples/test_sendmail.php +++ /dev/null @@ -1,37 +0,0 @@ -getFile('contents.html'); -$body = eregi_replace("[\]",'',$body); - -$mail->IsSendmail(); // telling the class to use SendMail transport - -$mail->From = "name@yourdomain.com"; -$mail->FromName = "First Last"; - -$mail->Subject = "PHPMailer Test Subject via smtp"; - -$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test - -$mail->MsgHTML($body); - -$mail->AddAddress("whoto@otherdomain.com", "John Doe"); - -$mail->AddAttachment("images/phpmailer.gif"); // attachment - -if(!$mail->Send()) { - echo "Mailer Error: " . $mail->ErrorInfo; -} else { - echo "Message sent!"; -} - -?> diff --git a/examples/test_sendmail_advanced.php b/examples/test_sendmail_advanced.php new file mode 100644 index 00000000..46024525 --- /dev/null +++ b/examples/test_sendmail_advanced.php @@ -0,0 +1,34 @@ + + +PHPMailer - Sendmail advanced test + + + +IsSendmail(); // telling the class to use SendMail transport + +try { + $mail->AddReplyTo('name@yourdomain.com', 'First Last'); + $mail->AddAddress('whoto@otherdomain.com', 'John Doe'); + $mail->SetFrom('name@yourdomain.com', 'First Last'); + $mail->AddReplyTo('name@yourdomain.com', 'First Last'); + $mail->Subject = 'PHPMailer Test Subject via mail(), advanced'; + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically + $mail->MsgHTML(file_get_contents('contents.html')); + $mail->AddAttachment('images/phpmailer.gif'); // attachment + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment + $mail->Send(); + echo "Message Sent OK

\n"; +} catch (phpmailerException $e) { + echo $e->errorMessage(); //Pretty error messages from PHPMailer +} catch (Exception $e) { + echo $e->getMessage(); //Boring error messages from anything else! +} +?> + + + diff --git a/examples/test_sendmail_basic.php b/examples/test_sendmail_basic.php new file mode 100644 index 00000000..46c05e39 --- /dev/null +++ b/examples/test_sendmail_basic.php @@ -0,0 +1,45 @@ + + +PHPMailer - Sendmail basic test + + + +IsSendmail(); // telling the class to use SendMail transport + +$body = file_get_contents('contents.html'); +$body = eregi_replace("[\]",'',$body); + +$mail->AddReplyTo("name@yourdomain.com","First Last"); + +$mail->SetFrom('name@yourdomain.com', 'First Last'); + +$mail->AddReplyTo("name@yourdomain.com","First Last"); + +$address = "whoto@otherdomain.com"; +$mail->AddAddress($address, "John Doe"); + +$mail->Subject = "PHPMailer Test Subject via Sendmail, basic"; + +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test + +$mail->MsgHTML($body); + +$mail->AddAttachment("images/phpmailer.gif"); // attachment +$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment + +if(!$mail->Send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} + +?> + + + diff --git a/examples/test_smtp.php b/examples/test_smtp.php deleted file mode 100644 index bc46c672..00000000 --- a/examples/test_smtp.php +++ /dev/null @@ -1,39 +0,0 @@ -getFile('contents.html'); -$body = eregi_replace("[\]",'',$body); - -$mail->IsSMTP(); // telling the class to use SMTP -$mail->Host = "mail.worxteam.com"; // SMTP server - -$mail->From = "name@yourdomain.com"; -$mail->FromName = "First Last"; - -$mail->Subject = "PHPMailer Test Subject via smtp"; - -$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test - -$mail->MsgHTML($body); - -$mail->AddAddress("whoto@otherdomain.com", "John Doe"); - -$mail->AddAttachment("images/phpmailer.gif"); // attachment - -if(!$mail->Send()) { - echo "Mailer Error: " . $mail->ErrorInfo; -} else { - echo "Message sent!"; -} - -?> diff --git a/examples/test_smtp_advanced.php b/examples/test_smtp_advanced.php new file mode 100644 index 00000000..71a8614a --- /dev/null +++ b/examples/test_smtp_advanced.php @@ -0,0 +1,43 @@ + + +PHPMailer - SMTP advanced test with authentication + + + +IsSMTP(); // telling the class to use SMTP + +try { + $mail->Host = "mail.yourdomain.com"; // SMTP server + $mail->SMTPDebug = 2; // enables SMTP debug information (for testing) + $mail->SMTPAuth = true; // enable SMTP authentication + $mail->Host = "mail.yourdomain.com"; // sets the SMTP server + $mail->Port = 26; // set the SMTP port for the GMAIL server + $mail->Username = "yourname@yourdomain"; // SMTP account username + $mail->Password = "yourpassword"; // SMTP account password + $mail->AddReplyTo('name@yourdomain.com', 'First Last'); + $mail->AddAddress('whoto@otherdomain.com', 'John Doe'); + $mail->SetFrom('name@yourdomain.com', 'First Last'); + $mail->AddReplyTo('name@yourdomain.com', 'First Last'); + $mail->Subject = 'PHPMailer Test Subject via mail(), advanced'; + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically + $mail->MsgHTML(file_get_contents('contents.html')); + $mail->AddAttachment('images/phpmailer.gif'); // attachment + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment + $mail->Send(); + echo "Message Sent OK

\n"; +} catch (phpmailerException $e) { + echo $e->errorMessage(); //Pretty error messages from PHPMailer +} catch (Exception $e) { + echo $e->getMessage(); //Boring error messages from anything else! +} +?> + + + diff --git a/examples/test_smtp_advanced_no_auth.php b/examples/test_smtp_advanced_no_auth.php new file mode 100644 index 00000000..69b9b5d4 --- /dev/null +++ b/examples/test_smtp_advanced_no_auth.php @@ -0,0 +1,37 @@ + + +PHPMailer - SMTP advanced test with no authentication + + + +IsSMTP(); // telling the class to use SMTP + +try { + $mail->Host = "mail.yourdomain.com"; // SMTP server + $mail->SMTPDebug = 2; // enables SMTP debug information (for testing) + $mail->AddReplyTo('name@yourdomain.com', 'First Last'); + $mail->AddAddress('whoto@otherdomain.com', 'John Doe'); + $mail->SetFrom('name@yourdomain.com', 'First Last'); + $mail->AddReplyTo('name@yourdomain.com', 'First Last'); + $mail->Subject = 'PHPMailer Test Subject via mail(), advanced'; + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically + $mail->MsgHTML(file_get_contents('contents.html')); + $mail->AddAttachment('images/phpmailer.gif'); // attachment + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment + $mail->Send(); + echo "Message Sent OK

\n"; +} catch (phpmailerException $e) { + echo $e->errorMessage(); //Pretty error messages from PHPMailer +} catch (Exception $e) { + echo $e->getMessage(); //Boring error messages from anything else! +} +?> + + + diff --git a/examples/test_smtp_basic.php b/examples/test_smtp_basic.php new file mode 100644 index 00000000..f92c5313 --- /dev/null +++ b/examples/test_smtp_basic.php @@ -0,0 +1,58 @@ + + +PHPMailer - SMTP basic test with authentication + + + +IsSMTP(); // telling the class to use SMTP +$mail->Host = "mail.yourdomain.com"; // SMTP server +$mail->SMTPDebug = 2; // enables SMTP debug information (for testing) + // 1 = errors and messages + // 2 = messages only +$mail->SMTPAuth = true; // enable SMTP authentication +$mail->Host = "mail.yourdomain.com"; // sets the SMTP server +$mail->Port = 26; // set the SMTP port for the GMAIL server +$mail->Username = "yourname@yourdomain"; // SMTP account username +$mail->Password = "yourpassword"; // SMTP account password + +$mail->SetFrom('name@yourdomain.com', 'First Last'); + +$mail->AddReplyTo("name@yourdomain.com","First Last"); + +$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication"; + +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test + +$mail->MsgHTML($body); + +$address = "whoto@otherdomain.com"; +$mail->AddAddress($address, "John Doe"); + +$mail->AddAttachment("images/phpmailer.gif"); // attachment +$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment + +if(!$mail->Send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} + +?> + + + diff --git a/examples/test_smtp_basic_no_auth.php b/examples/test_smtp_basic_no_auth.php new file mode 100644 index 00000000..d96cda25 --- /dev/null +++ b/examples/test_smtp_basic_no_auth.php @@ -0,0 +1,53 @@ + + +PHPMailer - SMTP basic test with no authentication + + + +IsSMTP(); // telling the class to use SMTP +$mail->Host = "mail.yourdomain.com"; // SMTP server +$mail->SMTPDebug = 2; // enables SMTP debug information (for testing) + // 1 = errors and messages + // 2 = messages only + +$mail->SetFrom('name@yourdomain.com', 'First Last'); + +$mail->AddReplyTo("name@yourdomain.com","First Last"); + +$mail->Subject = "PHPMailer Test Subject via smtp, basic with no authentication"; + +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test + +$mail->MsgHTML($body); + +$address = "whoto@otherdomain.com"; +$mail->AddAddress($address, "John Doe"); + +$mail->AddAttachment("images/phpmailer.gif"); // attachment +$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment + +if(!$mail->Send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} + +?> + + + diff --git a/examples/test_smtp_gmail_advanced.php b/examples/test_smtp_gmail_advanced.php new file mode 100644 index 00000000..055cc618 --- /dev/null +++ b/examples/test_smtp_gmail_advanced.php @@ -0,0 +1,43 @@ + + +PHPMailer - SMTP (Gmail) advanced test + + + +IsSMTP(); // telling the class to use SMTP + +try { + $mail->Host = "mail.yourdomain.com"; // SMTP server + $mail->SMTPDebug = 2; // enables SMTP debug information (for testing) + $mail->SMTPAuth = true; // enable SMTP authentication + $mail->SMTPSecure = "ssl"; // sets the prefix to the servier + $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server + $mail->Port = 465; // set the SMTP port for the GMAIL server + $mail->Username = "yourusername@gmail.com"; // GMAIL username + $mail->Password = "yourpassword"; // GMAIL password + $mail->AddReplyTo('name@yourdomain.com', 'First Last'); + $mail->AddAddress('whoto@otherdomain.com', 'John Doe'); + $mail->SetFrom('name@yourdomain.com', 'First Last'); + $mail->AddReplyTo('name@yourdomain.com', 'First Last'); + $mail->Subject = 'PHPMailer Test Subject via mail(), advanced'; + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically + $mail->MsgHTML(file_get_contents('contents.html')); + $mail->AddAttachment('images/phpmailer.gif'); // attachment + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment + $mail->Send(); + echo "Message Sent OK

\n"; +} catch (phpmailerException $e) { + echo $e->errorMessage(); //Pretty error messages from PHPMailer +} catch (Exception $e) { + echo $e->getMessage(); //Boring error messages from anything else! +} +?> + + + diff --git a/examples/test_gmail.php b/examples/test_smtp_gmail_basic.php similarity index 50% rename from examples/test_gmail.php rename to examples/test_smtp_gmail_basic.php index 4592efc1..3f578807 100644 --- a/examples/test_gmail.php +++ b/examples/test_smtp_gmail_basic.php @@ -1,3 +1,9 @@ + + +PHPMailer - SMTP (Gmail) basic test + + + getFile('contents.html'); +$body = file_get_contents('contents.html'); $body = eregi_replace("[\]",'',$body); -$mail->IsSMTP(); +$mail->IsSMTP(); // telling the class to use SMTP +$mail->Host = "mail.yourdomain.com"; // SMTP server +$mail->SMTPDebug = 2; // enables SMTP debug information (for testing) + // 1 = errors and messages + // 2 = messages only $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 465; // set the SMTP port for the GMAIL server - $mail->Username = "yourusername@gmail.com"; // GMAIL username $mail->Password = "yourpassword"; // GMAIL password -$mail->AddReplyTo("yourusername@gmail.com","First Last"); +$mail->SetFrom('name@yourdomain.com', 'First Last'); -$mail->From = "name@yourdomain.com"; -$mail->FromName = "First Last"; +$mail->AddReplyTo("name@yourdomain.com","First Last"); -$mail->Subject = "PHPMailer Test Subject via gmail"; +$mail->Subject = "PHPMailer Test Subject via smtp (Gmail), basic"; -//$mail->Body = "Hi,
This is the HTML BODY
"; //HTML Body $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test -$mail->WordWrap = 50; // set word wrap $mail->MsgHTML($body); -$mail->AddAddress("whoto@otherdomain.com", "John Doe"); +$address = "whoto@otherdomain.com"; +$mail->AddAddress($address, "John Doe"); -$mail->AddAttachment("images/phpmailer.gif"); // attachment - -$mail->IsHTML(true); // send as HTML +$mail->AddAttachment("images/phpmailer.gif"); // attachment +$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; @@ -48,3 +54,6 @@ if(!$mail->Send()) { } ?> + + + diff --git a/language/phpmailer.lang-ar.php b/language/phpmailer.lang-ar.php index c7f343ae..b7c5057d 100644 --- a/language/phpmailer.lang-ar.php +++ b/language/phpmailer.lang-ar.php @@ -1,26 +1,27 @@ - */ +* PHPMailer language file: refer to English translation for definitive list +* Arabic Version, UTF-8 +* by : bahjat al mostafa +*/ -$PHPMAILER_LANG = array(); - -$PHPMAILER_LANG['provide_address'] = 'You must provide at least one ' . - 'recipient email address.'; +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: لم نستطع تأكيد الهوية.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: لم نستطع الاتصال بمخدم SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: لم يتم قبول المعلومات .'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'ترميز غير معروÙ: '; +$PHPMAILER_LANG['execute'] = 'لم أستطع تنÙيذ : '; +$PHPMAILER_LANG['file_access'] = 'لم نستطع الوصول للملÙ: '; +$PHPMAILER_LANG['file_open'] = 'File Error: لم نستطع ÙØªØ­ الملÙ: '; +$PHPMAILER_LANG['from_failed'] = 'البريد التالي لم نستطع ارسال البريد له : '; +$PHPMAILER_LANG['instantiate'] = 'لم نستطع توÙير خدمة البريد.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer غير مدعوم.'; -$PHPMAILER_LANG['execute'] = 'لم أستطع تنÙيذ : '; -$PHPMAILER_LANG['instantiate'] = 'لم نستطع توÙير خدمة البريد.'; -$PHPMAILER_LANG['authenticate'] = 'SMTP Error: لم نستطع تأكيد الهوية.'; -$PHPMAILER_LANG['from_failed'] = 'البريد التالي لم نستطع ارسال البريد له : '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: الأخطاء التالية ' . - 'ÙØ´Ù„ ÙÙŠ الارسال لكل من : '; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: لم يتم قبول المعلومات .'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: لم نستطع الاتصال بمخدم SMTP.'; -$PHPMAILER_LANG['file_access'] = 'لم نستطع الوصول للملÙ: '; -$PHPMAILER_LANG['file_open'] = 'File Error: لم نستطع ÙØªØ­ الملÙ: '; -$PHPMAILER_LANG['encoding'] = 'ترميز غير معروÙ: '; -$PHPMAILER_LANG['signing'] = 'خطأ ÙÙŠ التوقيع: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['provide_address'] = 'You must provide at least one recipient email address.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: الأخطاء التالية ' . + 'ÙØ´Ù„ ÙÙŠ الارسال لكل من : '; +$PHPMAILER_LANG['signing'] = 'خطأ ÙÙŠ التوقيع: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/language/phpmailer.lang-br.php b/language/phpmailer.lang-br.php index d2e97535..6afe60b1 100644 --- a/language/phpmailer.lang-br.php +++ b/language/phpmailer.lang-br.php @@ -1,23 +1,26 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-ca.php b/language/phpmailer.lang-ca.php index bb100447..4a160a21 100644 --- a/language/phpmailer.lang-ca.php +++ b/language/phpmailer.lang-ca.php @@ -1,24 +1,26 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-ch.php b/language/phpmailer.lang-ch.php index 5251402b..31ebd861 100644 --- a/language/phpmailer.lang-ch.php +++ b/language/phpmailer.lang-ch.php @@ -1,24 +1,26 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-cz.php b/language/phpmailer.lang-cz.php index 2c6b3535..1c8b2063 100644 --- a/language/phpmailer.lang-cz.php +++ b/language/phpmailer.lang-cz.php @@ -1,23 +1,25 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-de.php b/language/phpmailer.lang-de.php index eab10611..b2a76ce1 100644 --- a/language/phpmailer.lang-de.php +++ b/language/phpmailer.lang-de.php @@ -1,24 +1,25 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-dk.php b/language/phpmailer.lang-dk.php index defe5b68..b2625731 100644 --- a/language/phpmailer.lang-dk.php +++ b/language/phpmailer.lang-dk.php @@ -1,23 +1,26 @@ */ +* PHPMailer language file: refer to English translation for definitive list +* Danish Version +* Author: Mikael Stokkebro +*/ -$PHPMAILER_LANG = array(); - -$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; -$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: '; -$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.'; $PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge pÃ¥.'; -$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.'; $PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: '; $PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: '; $PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke Ã¥bne filen: '; -$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; -$PHPMAILER_LANG['signing'] = 'Signing Error: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; +$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; +$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/language/phpmailer.lang-en.php b/language/phpmailer.lang-en.php deleted file mode 100644 index 77043193..00000000 --- a/language/phpmailer.lang-en.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/language/phpmailer.lang-es.php b/language/phpmailer.lang-es.php index b14b747a..69b68174 100644 --- a/language/phpmailer.lang-es.php +++ b/language/phpmailer.lang-es.php @@ -1,23 +1,26 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-et.php b/language/phpmailer.lang-et.php index 943680cd..cf61779b 100644 --- a/language/phpmailer.lang-et.php +++ b/language/phpmailer.lang-et.php @@ -1,24 +1,26 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-fi.php b/language/phpmailer.lang-fi.php index b58ffc3e..12a845aa 100644 --- a/language/phpmailer.lang-fi.php +++ b/language/phpmailer.lang-fi.php @@ -1,24 +1,27 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-fo.php b/language/phpmailer.lang-fo.php index 57f41783..6bd9b0a2 100644 --- a/language/phpmailer.lang-fo.php +++ b/language/phpmailer.lang-fo.php @@ -1,25 +1,27 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-fr.php b/language/phpmailer.lang-fr.php index 8c9fe7b4..c99ac3ca 100644 --- a/language/phpmailer.lang-fr.php +++ b/language/phpmailer.lang-fr.php @@ -1,23 +1,25 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-hu.php b/language/phpmailer.lang-hu.php index 06ca0386..caca0b50 100644 --- a/language/phpmailer.lang-hu.php +++ b/language/phpmailer.lang-hu.php @@ -1,23 +1,25 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-it.php b/language/phpmailer.lang-it.php index b9c89d78..fc1fcb8d 100644 --- a/language/phpmailer.lang-it.php +++ b/language/phpmailer.lang-it.php @@ -1,26 +1,27 @@ */ +* @author Ilias Bartolini +*/ -$PHPMAILER_LANG = array(); - -$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; -$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; -$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; -$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; $PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; -$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi'. - 'destinatari hanno generato errore: '; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data non accettati dal'. - 'server.'; $PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data non accettati dal server.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Encoding set dei caratteri sconosciuto: '; +$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; $PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; $PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; -$PHPMAILER_LANG['encoding'] = 'Encoding set dei caratteri sconosciuto: '; -$PHPMAILER_LANG['signing'] = 'Signing Error: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; +$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; +$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato errore: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/language/phpmailer.lang-ja.php b/language/phpmailer.lang-ja.php index c9b81c15..63cfb23b 100644 --- a/language/phpmailer.lang-ja.php +++ b/language/phpmailer.lang-ja.php @@ -1,24 +1,26 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-nl.php b/language/phpmailer.lang-nl.php index 6d9b3365..d2c380b0 100644 --- a/language/phpmailer.lang-nl.php +++ b/language/phpmailer.lang-nl.php @@ -1,23 +1,25 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-no.php b/language/phpmailer.lang-no.php index 77b30a4e..65cb8843 100644 --- a/language/phpmailer.lang-no.php +++ b/language/phpmailer.lang-no.php @@ -1,23 +1,25 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-pl.php b/language/phpmailer.lang-pl.php index 20820d2f..f4fd801d 100644 --- a/language/phpmailer.lang-pl.php +++ b/language/phpmailer.lang-pl.php @@ -1,23 +1,25 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-ro.php b/language/phpmailer.lang-ro.php index 01cb6bf9..f6aa9225 100644 --- a/language/phpmailer.lang-ro.php +++ b/language/phpmailer.lang-ro.php @@ -1,24 +1,27 @@ */ +* PHPMailer language file: refer to English translation for definitive list +* Romanian Version +* @package PHPMailer +* @author Catalin Constantin +*/ -$PHPMAILER_LANG = array(); - -$PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).'; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; -$PHPMAILER_LANG['execute'] = 'Nu pot executa: '; -$PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.'; $PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Nu a functionat autentificarea.'; -$PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: '; -$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: '; -$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.'; $PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: '; +$PHPMAILER_LANG['execute'] = 'Nu pot executa: '; $PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: '; $PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: '; -$PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: '; -$PHPMAILER_LANG['signing'] = 'Signing Error: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +$PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: '; +$PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; +$PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).'; +$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/language/phpmailer.lang-ru.php b/language/phpmailer.lang-ru.php index 7619c293..d6990525 100644 --- a/language/phpmailer.lang-ru.php +++ b/language/phpmailer.lang-ru.php @@ -1,23 +1,25 @@ */ +* PHPMailer language file: refer to English translation for definitive list +* Russian Version by Alexey Chumakov +*/ -$PHPMAILER_LANG = array(); - -$PHPMAILER_LANG['provide_address'] = 'ПожалуйÑта, введите Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ один Ð°Ð´Ñ€ÐµÑ e-mail получателÑ.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый Ñервер не поддерживаетÑÑ.'; -$PHPMAILER_LANG['execute'] = 'Ðевозможно выполнить команду: '; -$PHPMAILER_LANG['instantiate'] = 'Ðевозможно запуÑтить функцию mail.'; $PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; -$PHPMAILER_LANG['from_failed'] = 'Ðеверный Ð°Ð´Ñ€ÐµÑ Ð¾Ñ‚Ð¿Ñ€Ð°Ð²Ð¸Ñ‚ÐµÐ»Ñ: '; -$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по Ñледующим ' . - 'адреÑам получателей не удалаÑÑŒ: '; -$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не принÑты.'; $PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удаетÑÑ Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡Ð¸Ñ‚ÑŒÑÑ Ðº Ñерверу SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не принÑты.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'ÐеизвеÑтный вид кодировки: '; +$PHPMAILER_LANG['execute'] = 'Ðевозможно выполнить команду: '; $PHPMAILER_LANG['file_access'] = 'Ðет доÑтупа к файлу: '; $PHPMAILER_LANG['file_open'] = 'Ð¤Ð°Ð¹Ð»Ð¾Ð²Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°: не удаетÑÑ Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚ÑŒ файл: '; -$PHPMAILER_LANG['encoding'] = 'ÐеизвеÑтный вид кодировки: '; -$PHPMAILER_LANG['signing'] = 'Signing Error: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +$PHPMAILER_LANG['from_failed'] = 'Ðеверный Ð°Ð´Ñ€ÐµÑ Ð¾Ñ‚Ð¿Ñ€Ð°Ð²Ð¸Ñ‚ÐµÐ»Ñ: '; +$PHPMAILER_LANG['instantiate'] = 'Ðевозможно запуÑтить функцию mail.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['provide_address'] = 'ПожалуйÑта, введите Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ один Ð°Ð´Ñ€ÐµÑ e-mail получателÑ.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый Ñервер не поддерживаетÑÑ.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по Ñледующим адреÑам получателей не удалаÑÑŒ: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/language/phpmailer.lang-se.php b/language/phpmailer.lang-se.php index 461d10bd..67e05f59 100644 --- a/language/phpmailer.lang-se.php +++ b/language/phpmailer.lang-se.php @@ -1,23 +1,26 @@ */ +* PHPMailer language file: refer to English translation for definitive list +* Swedish Version +* Author: Johan Linnér +*/ -$PHPMAILER_LANG = array(); - -$PHPMAILER_LANG['provide_address'] = 'Du mÃ¥ste ange minst en mottagares e-postadress.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; -$PHPMAILER_LANG['execute'] = 'Kunde inte köra: '; -$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; $PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; -$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.'; $PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunde inte köra: '; $PHPMAILER_LANG['file_access'] = 'Ingen Ã¥tkomst till fil: '; $PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; -$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: '; -$PHPMAILER_LANG['signing'] = 'Signing Error: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; +$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['provide_address'] = 'Du mÃ¥ste ange minst en mottagares e-postadress.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/language/phpmailer.lang-tr.php b/language/phpmailer.lang-tr.php index cdc32e5c..d24627a4 100644 --- a/language/phpmailer.lang-tr.php +++ b/language/phpmailer.lang-tr.php @@ -1,24 +1,27 @@ \ No newline at end of file diff --git a/language/phpmailer.lang-zh.php b/language/phpmailer.lang-zh.php index 31c10faa..fef66f8c 100644 --- a/language/phpmailer.lang-zh.php +++ b/language/phpmailer.lang-zh.php @@ -1,23 +1,26 @@ - */ +* PHPMailer language file: refer to English translation for definitive list +* Traditional Chinese Version +* @author liqwei +*/ -$PHPMAILER_LANG = array(); -$PHPMAILER_LANG['provide_address'] = 'å¿…é ˆæä¾›è‡³å°‘一個收件人地å€ã€‚'; -$PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端ä¸è¢«æ”¯æŒã€‚'; -$PHPMAILER_LANG['execute'] = '無法執行:'; -$PHPMAILER_LANG['instantiate'] = '未知函數調用。'; $PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登錄失敗。'; -$PHPMAILER_LANG['from_failed'] = '發é€åœ°å€éŒ¯èª¤ï¼š'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地å€éŒ¯èª¤ï¼š'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:數據ä¸è¢«æŽ¥å—。'; $PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連接到 SMTP 主機。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:數據ä¸è¢«æŽ¥å—。'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = '未知編碼: '; $PHPMAILER_LANG['file_access'] = 'ç„¡æ³•è¨ªå•æ–‡ä»¶ï¼š'; $PHPMAILER_LANG['file_open'] = '文件錯誤:無法打開文件:'; -$PHPMAILER_LANG['encoding'] = '未知編碼: '; -$PHPMAILER_LANG['signing'] = 'Signing Error: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +$PHPMAILER_LANG['from_failed'] = '發é€åœ°å€éŒ¯èª¤ï¼š'; +$PHPMAILER_LANG['execute'] = '無法執行:'; +$PHPMAILER_LANG['instantiate'] = '未知函數調用。'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['provide_address'] = 'å¿…é ˆæä¾›è‡³å°‘一個收件人地å€ã€‚'; +$PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端ä¸è¢«æ”¯æŒã€‚'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地å€éŒ¯èª¤ï¼š'; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/language/phpmailer.lang-zh_cn.php b/language/phpmailer.lang-zh_cn.php index b01d806f..b1884043 100644 --- a/language/phpmailer.lang-zh_cn.php +++ b/language/phpmailer.lang-zh_cn.php @@ -1,24 +1,26 @@ - */ +* PHPMailer language file: refer to English translation for definitive list +* Simplified Chinese Version +* @author liqwei +*/ -$PHPMAILER_LANG = array(); - -$PHPMAILER_LANG["provide_address"] = 'å¿…é¡»æä¾›è‡³å°‘一个收件人地å€ã€‚'; -$PHPMAILER_LANG["mailer_not_supported"] = 'å‘信客户端ä¸è¢«æ”¯æŒã€‚'; -$PHPMAILER_LANG["execute"] = '无法执行:'; -$PHPMAILER_LANG["instantiate"] = '未知函数调用。'; -$PHPMAILER_LANG["authenticate"] = 'SMTP 错误:登录失败。'; -$PHPMAILER_LANG["from_failed"] = 'å‘é€åœ°å€é”™è¯¯ï¼š'; -$PHPMAILER_LANG["recipients_failed"] = 'SMTP 错误:收件人地å€é”™è¯¯ï¼š'; -$PHPMAILER_LANG["data_not_accepted"] = 'SMTP 错误:数æ®ä¸è¢«æŽ¥å—。'; -$PHPMAILER_LANG["connect_host"] = 'SMTP 错误:无法连接到 SMTP 主机。'; -$PHPMAILER_LANG["file_access"] = '无法访问文件:'; -$PHPMAILER_LANG["file_open"] = '文件错误:无法打开文件:'; -$PHPMAILER_LANG["encoding"] = '未知编ç : '; -$PHPMAILER_LANG["signing"] = 'Signing Error: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数æ®ä¸è¢«æŽ¥å—。'; +//$P$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = '未知编ç : '; +$PHPMAILER_LANG['execute'] = '无法执行:'; +$PHPMAILER_LANG['file_access'] = '无法访问文件:'; +$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; +$PHPMAILER_LANG['from_failed'] = 'å‘é€åœ°å€é”™è¯¯ï¼š'; +$PHPMAILER_LANG['instantiate'] = '未知函数调用。'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['mailer_not_supported'] = 'å‘信客户端ä¸è¢«æ”¯æŒã€‚'; +$PHPMAILER_LANG['provide_address'] = 'å¿…é¡»æä¾›è‡³å°‘一个收件人地å€ã€‚'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地å€é”™è¯¯ï¼š'; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/test/contents.html b/test/contents.html new file mode 100644 index 00000000..dbb8bfee --- /dev/null +++ b/test/contents.html @@ -0,0 +1,10 @@ + + + + Email test + + + +

Here is a test HTML email

+ + diff --git a/test/phpmailer_test.php b/test/phpmailerTest.php similarity index 58% rename from test/phpmailer_test.php rename to test/phpmailerTest.php index 5ee74ec1..99581de1 100644 --- a/test/phpmailer_test.php +++ b/test/phpmailerTest.php @@ -1,20 +1,30 @@ TestCase( $name ); - } - /** * Run before each test is started. */ function setUp() { - global $global_vars; global $INCLUDE_DIR; + @include './testbootstrap.php'; //Overrides go in here + $this->Mail = new PHPMailer(); $this->Mail->Priority = 3; $this->Mail->Encoding = "8bit"; $this->Mail->CharSet = "iso-8859-1"; - $this->Mail->From = "unit_test@phpmailer.sf.net"; + if (array_key_exists('mail_from', $_REQUEST)) { + $this->Mail->From = $_REQUEST['mail_from']; + } else { + $this->Mail->From = 'unit_test@phpmailer.sf.net'; + } $this->Mail->FromName = "Unit Tester"; $this->Mail->Sender = ""; $this->Mail->Subject = "Unit Test"; $this->Mail->Body = ""; $this->Mail->AltBody = ""; $this->Mail->WordWrap = 0; - $this->Mail->Host = $global_vars["mail_host"]; + if (array_key_exists('mail_host', $_REQUEST)) { + $this->Mail->Host = $_REQUEST['mail_host']; + } else { + $this->Mail->Host = 'mail.example.com'; + } $this->Mail->Port = 25; $this->Mail->Helo = "localhost.localdomain"; $this->Mail->SMTPAuth = false; @@ -80,18 +91,19 @@ class phpmailerTest extends TestCase $this->Mail->AddReplyTo("no_reply@phpmailer.sf.net", "Reply Guy"); $this->Mail->Sender = "unit_test@phpmailer.sf.net"; - if(strlen($this->Mail->Host) > 0) + if(strlen($this->Mail->Host) > 0) { $this->Mail->Mailer = "smtp"; - else - { + } else { $this->Mail->Mailer = "mail"; $this->Sender = "unit_test@phpmailer.sf.net"; } - global $global_vars; - $this->SetAddress($global_vars["mail_to"], "Test User"); - if(strlen($global_vars["mail_cc"]) > 0) - $this->SetAddress($global_vars["mail_cc"], "Carbon User", "cc"); + if (array_key_exists('mail_to', $_REQUEST)) { + $this->SetAddress($_REQUEST['mail_to'], 'Test User', 'to'); + } + if (array_key_exists('mail_cc', $_REQUEST) and strlen($_REQUEST['mail_cc']) > 0) { + $this->SetAddress($_REQUEST['mail_cc'], 'Carbon User', 'cc'); + } } /** @@ -134,7 +146,7 @@ class phpmailerTest extends TestCase $ReportBody .= "---------------------" . $eol; $ReportBody .= "Unit Test Information" . $eol; $ReportBody .= "---------------------" . $eol; - $ReportBody .= "phpmailer version: " . $this->Mail->Version . $eol; + $ReportBody .= "phpmailer version: " . PHPMailer::VERSION . $eol; $ReportBody .= "Content Type: " . $this->Mail->ContentType . $eol; if(strlen($this->Mail->Host) > 0) @@ -146,11 +158,10 @@ class phpmailerTest extends TestCase { $ReportBody .= "Attachments:" . $eol; $ReportBody .= $bullet_start; - for($i = 0; $i < count($attachments); $i++) - { - $ReportBody .= $bullet . "Name: " . $attachments[$i][1] . ", "; - $ReportBody .= "Encoding: " . $attachments[$i][3] . ", "; - $ReportBody .= "Type: " . $attachments[$i][4] . $eol; + foreach($attachments as $attachment) { + $ReportBody .= $bullet . "Name: " . $attachment[1] . ", "; + $ReportBody .= "Encoding: " . $attachment[3] . ", "; + $ReportBody .= "Type: " . $attachment[4] . $eol; } $ReportBody .= $bullet_end . $eol; } @@ -271,7 +282,7 @@ class phpmailerTest extends TestCase $this->Mail->Subject .= ": Wordwrap"; $this->BuildBody(); - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); } /** @@ -286,7 +297,7 @@ class phpmailerTest extends TestCase $this->Mail->AddReplyTo("nobody@nobody.com", "Nobody (Unit Test)"); $this->BuildBody(); - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); } /** @@ -299,18 +310,18 @@ class phpmailerTest extends TestCase if(!$this->Mail->AddAttachment("test.png")) { - $this->assert(false, $this->Mail->ErrorInfo); + $this->assertTrue(false, $this->Mail->ErrorInfo); return; } - if(!$this->Mail->AddAttachment("phpmailer_test.php", "test.txt")) + if(!$this->Mail->AddAttachment(__FILE__, "test.txt")) { - $this->assert(false, $this->Mail->ErrorInfo); + $this->assertTrue(false, $this->Mail->ErrorInfo); return; } $this->BuildBody(); - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); } /** @@ -328,7 +339,7 @@ class phpmailerTest extends TestCase $this->Mail->AddStringAttachment($sAttachment, "string_attach.txt"); $this->BuildBody(); - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); } /** @@ -341,7 +352,13 @@ class phpmailerTest extends TestCase $this->Mail->Encoding = "quoted-printable"; $this->BuildBody(); - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); + + //Check that a quoted printable encode and decode results in the same as went in + $t = substr(file_get_contents(__FILE__), 0, 1024); //Just pick a chunk of this file as test content + $this->assertEquals($t, quoted_printable_decode($this->Mail->EncodeQP($t)), 'QP encoding round-trip failed'); + //$this->assertEquals($t, quoted_printable_decode($this->Mail->EncodeQPphp($t)), 'Native PHP QP encoding round-trip failed'); //TODO the PHP qp encoder is quite broken + } /** @@ -358,7 +375,7 @@ class phpmailerTest extends TestCase "phpmailer.

Thank you!"; $this->BuildBody(); - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); } /** @@ -370,14 +387,14 @@ class phpmailerTest extends TestCase $this->Mail->Subject .= ": HTML + Attachment"; $this->Mail->IsHTML(true); - if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt")) + if(!$this->Mail->AddAttachment(__FILE__, "test_attach.txt")) { - $this->assert(false, $this->Mail->ErrorInfo); + $this->assertTrue(false, $this->Mail->ErrorInfo); return; } $this->BuildBody(); - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); } /** @@ -393,12 +410,16 @@ class phpmailerTest extends TestCase if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png", "base64", "image/png")) { - $this->assert(false, $this->Mail->ErrorInfo); + $this->assertTrue(false, $this->Mail->ErrorInfo); return; } $this->BuildBody(); - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); + //For code coverage + $this->Mail->AddEmbeddedImage('thisfiledoesntexist', 'xyz'); //Non-existent file + $this->Mail->AddEmbeddedImage(__FILE__, '123'); //Missing name + } /** @@ -414,18 +435,18 @@ class phpmailerTest extends TestCase if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png", "base64", "image/png")) { - $this->assert(false, $this->Mail->ErrorInfo); + $this->assertTrue(false, $this->Mail->ErrorInfo); return; } - if(!$this->Mail->AddAttachment("phpmailer_test.php", "test.txt")) + if(!$this->Mail->AddAttachment(__FILE__, "test.txt")) { - $this->assert(false, $this->Mail->ErrorInfo); + $this->assertTrue(false, $this->Mail->ErrorInfo); return; } $this->BuildBody(); - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); } /** @@ -442,7 +463,7 @@ class phpmailerTest extends TestCase $this->Mail->Subject .= ": AltBody + Word Wrap"; $this->BuildBody(); - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); } /** @@ -455,18 +476,18 @@ class phpmailerTest extends TestCase $this->Mail->Subject .= ": AltBody + Attachment"; $this->Mail->IsHTML(true); - if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt")) + if(!$this->Mail->AddAttachment(__FILE__, "test_attach.txt")) { - $this->assert(false, $this->Mail->ErrorInfo); + $this->assertTrue(false, $this->Mail->ErrorInfo); return; } $this->BuildBody(); - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); if (is_writable('.')) { file_put_contents('message.txt', $this->Mail->CreateHeader() . $this->Mail->CreateBody()); } else { - $this->assert(false, 'Could not write local file - check permissions'); + $this->assertTrue(false, 'Could not write local file - check permissions'); } } @@ -476,10 +497,30 @@ class phpmailerTest extends TestCase $subject = $this->Mail->Subject; $this->Mail->Subject = $subject . ": SMTP 1"; - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); $this->Mail->Subject = $subject . ": SMTP 2"; - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + function test_SendmailSend() { + $this->Mail->Body = "Sending via sendmail"; + $this->BuildBody(); + $subject = $this->Mail->Subject; + + $this->Mail->Subject = $subject . ": sendmail"; + $this->Mail->IsSendmail(); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); + } + + function test_MailSend() { + $this->Mail->Body = "Sending via mail()"; + $this->BuildBody(); + $subject = $this->Mail->Subject; + + $this->Mail->Subject = $subject . ": mail()"; + $this->Mail->IsMail(); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); } function test_SmtpKeepAlive() { @@ -489,10 +530,10 @@ class phpmailerTest extends TestCase $this->Mail->SMTPKeepAlive = true; $this->Mail->Subject = $subject . ": SMTP keep-alive 1"; - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); $this->Mail->Subject = $subject . ": SMTP keep-alive 2"; - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); $this->Mail->SmtpClose(); } @@ -505,124 +546,114 @@ class phpmailerTest extends TestCase $this->BuildBody(); $this->Mail->Subject = str_repeat("A", 998); - $this->assert($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); } - function test_Error() { - $this->Mail->Subject .= ": This should be sent"; - $this->BuildBody(); - $this->Mail->ClearAllRecipients(); // no addresses should cause an error - $this->assert($this->Mail->IsError() == false, "Error found"); - $this->assert($this->Mail->Send() == false, "Send succeeded"); - $this->assert($this->Mail->IsError(), "No error found"); - //Note that this is language dependent - $this->assertEquals('You must provide at least one recipient email address.', $this->Mail->ErrorInfo); - $this->Mail->AddAddress(get("mail_to")); - $this->assert($this->Mail->Send(), "Send failed"); - } - - function test_Addressing() { - $this->assert($this->Mail->AddAddress('a@example.com'), 'Addressing failed'); - $this->assert(!$this->Mail->AddAddress('a@example.com'), 'Duplicate addressing failed'); - $this->assert($this->Mail->AddCC('b@example.com'), 'CC addressing failed'); - $this->assert(!$this->Mail->AddCC('b@example.com'), 'CC duplicate Addressing failed'); - $this->assert(!$this->Mail->AddCC('a@example.com'), 'CC duplicate Addressing failed (2)'); - $this->assert($this->Mail->AddBCC('c@example.com'), 'BCC addressing failed'); - $this->assert(!$this->Mail->AddBCC('c@example.com'), 'BCC duplicate addressing failed'); - $this->assert(!$this->Mail->AddBCC('a@example.com'), 'BCC duplicate Addressing failed (2)'); - $this->Mail->ClearAddresses(); - $this->assert($this->Mail->AddAddress('a@example.com'), 'Addressing after clear failed'); - $this->Mail->ClearCCs(); - $this->assert($this->Mail->AddAddress('b@example.com'), 'CC addressing after clear failed'); - $this->Mail->ClearBCCs(); - $this->assert($this->Mail->AddAddress('c@example.com'), 'BCC addressing after clear failed'); - $this->Mail->AddAddress('a@example.com'); - $this->Mail->AddCC('b@example.com'); - $this->Mail->AddBCC('c@example.com'); - $this->Mail->ClearAllRecipients(); //Not much of a test, but helps coverage - } - - // Check that we are not missing any translations in any langauges - function test_Translations() { - //Extend this array as new strings are added - $expectedtranslations = array( - 'provide_address', - 'mailer_not_supported', - 'execute', - 'instantiate', - 'authenticate', - 'from_failed', - 'recipients_failed', - 'data_not_accepted', - 'connect_host', - 'file_access', - 'file_open', - 'encoding', - 'signing', - 'smtp_error' - ); - try { - foreach (new DirectoryIterator('../language') as $langfile) { - if (!preg_match('/^phpmailer\.lang-/', $langfile)) continue; //Skip non-language files - $PHPMAILER_LANG = array(); - include '../language/'.$langfile; - foreach($expectedtranslations as $string) { - $this->assert(isset($PHPMAILER_LANG[$string]), 'Translation missing; \''.$string.'\' in '.$langfile); - } - } - } - catch(Exception $e) { - $this->assert(false, 'No language files found!'); - } - } - - //Check that getFile works - function test_getFile() { - $a = $this->Mail->getFile('../class.phpmailer.php'); //Point at any non-empty file - $this->assert(($a !== false), 'GetFile failed to read a file.'); - } -} -/** - * Create and run test instance. - */ + function test_Error() { + $this->Mail->Subject .= ": This should be sent"; + $this->BuildBody(); + $this->Mail->ClearAllRecipients(); // no addresses should cause an error + $this->assertTrue($this->Mail->IsError() == false, "Error found"); + $this->assertTrue($this->Mail->Send() == false, "Send succeeded"); + $this->assertTrue($this->Mail->IsError(), "No error found"); + $this->assertEquals('You must provide at least one recipient email address.', $this->Mail->ErrorInfo); + $this->Mail->AddAddress($_REQUEST['mail_to']); + $this->assertTrue($this->Mail->Send(), "Send failed"); + } + + function test_Addressing() { + $this->assertFalse($this->Mail->AddAddress('a@example..com'), 'Invalid address accepted'); + $this->assertTrue($this->Mail->AddAddress('a@example.com'), 'Addressing failed'); + $this->assertFalse($this->Mail->AddAddress('a@example.com'), 'Duplicate addressing failed'); + $this->assertTrue($this->Mail->AddCC('b@example.com'), 'CC addressing failed'); + $this->assertFalse($this->Mail->AddCC('b@example.com'), 'CC duplicate addressing failed'); + $this->assertFalse($this->Mail->AddCC('a@example.com'), 'CC duplicate addressing failed (2)'); + $this->assertTrue($this->Mail->AddBCC('c@example.com'), 'BCC addressing failed'); + $this->assertFalse($this->Mail->AddBCC('c@example.com'), 'BCC duplicate addressing failed'); + $this->assertFalse($this->Mail->AddBCC('a@example.com'), 'BCC duplicate addressing failed (2)'); + $this->assertTrue($this->Mail->AddReplyTo('a@example.com'), 'Replyto Addressing failed'); + $this->assertFalse($this->Mail->AddReplyTo('a@example..com'), 'Invalid Replyto address accepted'); + $this->Mail->ClearAddresses(); + $this->Mail->ClearCCs(); + $this->Mail->ClearBCCs(); + $this->Mail->ClearReplyTos(); + } + + /** + * Test language files for missing and excess translations + * All languages are compared with English + */ + function test_Translations() { + $this->Mail->SetLanguage('en'); + $definedStrings = $this->Mail->GetTranslations(); + foreach (new DirectoryIterator('../language') as $fileInfo) { + if($fileInfo->isDot()) continue; + $matches = array(); + //Only look at language files, ignore anything else in there + if (preg_match('/^phpmailer\.lang-([a-z_]{2,})\.php$/', $fileInfo->getFilename(), $matches)) { + $lang = $matches[1]; //Extract language code + $PHPMAILER_LANG = array(); //Language strings get put in here + include $fileInfo->getPathname(); //Get language strings + $missing = array_diff(array_keys($definedStrings), array_keys($PHPMAILER_LANG)); + $extra = array_diff(array_keys($PHPMAILER_LANG), array_keys($definedStrings)); + $this->assertTrue(empty($missing), "Missing translations in $lang: ". implode(', ', $missing)); + $this->assertTrue(empty($extra), "Extra translations in $lang: ". implode(', ', $extra)); + } + } + } + + /** + * Encoding tests + */ + function test_Encodings() { + $this->Mail->Charset = 'iso-8859-1'; + $this->assertEquals('=A1Hola!_Se=F1or!', $this->Mail->EncodeQ('¡Hola! Señor!', 'text'), 'Q Encoding (text) failed'); + $this->assertEquals('=A1Hola!_Se=F1or!', $this->Mail->EncodeQ('¡Hola! Señor!', 'comment'), 'Q Encoding (comment) failed'); + $this->assertEquals('=A1Hola!_Se=F1or!', $this->Mail->EncodeQ('¡Hola! Señor!', 'phrase'), 'Q Encoding (phrase) failed'); + } + + /** + * Signing tests + */ + function test_Signing() { + $this->Mail->Sign('certfile.txt', 'keyfile.txt', 'password'); //TODO this is not really testing signing, but at least helps coverage + } + + /** + * Miscellaneous calls to improve test coverage and some small tests + */ + function test_Miscellaneous() { + $this->assertEquals('application/pdf', PHPMailer::_mime_types('pdf') , 'MIME TYPE lookup failed'); + $this->Mail->AddCustomHeader('SomeHeader: Some Value'); + $this->Mail->ClearCustomHeaders(); + $this->Mail->ClearAttachments(); + $this->Mail->IsHTML(false); + $this->Mail->IsSMTP(); + $this->Mail->IsMail(); + $this->Mail->IsSendMail(); + $this->Mail->IsQmail(); + $this->Mail->SetLanguage('fr'); + $this->Mail->Sender = ''; + $this->Mail->CreateHeader(); + $this->assertFalse($this->Mail->set('x', 'y'), 'Invalid property set succeeded'); + $this->assertTrue($this->Mail->set('Timeout', 11), 'Valid property set failed'); + $this->Mail->getFile(__FILE__); + } +} -if(isset($HTTP_GET_VARS)) - $global_vars = $HTTP_GET_VARS; -else - $global_vars = $_REQUEST; - -if(isset($global_vars["submitted"])) -{ - echo "Test results:
"; - $suite = new TestSuite( "phpmailerTest" ); - - $testRunner = new TestRunner; - $testRunner->run($suite); - echo "


"; -} - -function get($sName) { - global $global_vars; - if(isset($global_vars[$sName])) - return $global_vars[$sName]; - else - return ""; -} - -?> - +/** +* This is a sample form for setting appropriate test values through a browser +* These values can also be set using a file called testbootstrap.php (not in svn) in the same folder as this script +* which is probably more useful if you run these tests a lot - - - PHPMailer Unit Tests -

phpmailer Unit Test

By entering a SMTP hostname it will automatically perform tests with SMTP. -
+ +From Address: "/> +
To Address: "/>
Cc Address: "/> @@ -634,3 +665,6 @@ SMTP Hostname: -// OntoSys, Inc -// -// $Id$ - -// Copyright (c) 2000 Fred Yankowski - -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, copy, -// modify, merge, publish, distribute, sublicense, and/or sell copies -// of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE | - E_CORE_ERROR | E_CORE_WARNING); - -/* -interface Test { - function run($aTestResult); - function countTestCases(); -} -*/ - -function trace($msg) { - return; - print($msg); - flush(); -} - - -class phpUnitException { - /* Emulate a Java exception, sort of... */ - var $message; - var $type; - function phpUnitException($message, $type = 'FAILURE') { - $this->message = $message; - $this->type = $type; - } - function getMessage() { - return $this->message; - } -} - -class Assert { - function assert($boolean, $message=0) { - if (! $boolean) - $this->fail($message); - } - - function assertEquals($expected, $actual, $message=0) { - if ($expected != $actual) { - $this->failNotEquals($expected, $actual, "expected", $message); - } - } - - function assertRegexp($regexp, $actual, $message=false) { - if (! preg_match($regexp, $actual)) { - $this->failNotEquals($regexp, $actual, "pattern", $message); - } - } - - function failNotEquals($expected, $actual, $expected_label, $message=0) { - // Private function for reporting failure to match. - $str = $message ? ($message . ' ') : ''; - $str .= "($expected_label/actual)
"; - $htmlExpected = htmlspecialchars($expected); - $htmlActual = htmlspecialchars($actual); - $str .= sprintf("
%s\n--------\n%s
", - $htmlExpected, $htmlActual); - $this->fail($str); - } -} - -class TestCase extends Assert /* implements Test */ { - /* Defines context for running tests. Specific context -- such as - instance variables, global variables, global state -- is defined - by creating a subclass that specializes the setUp() and - tearDown() methods. A specific test is defined by a subclass - that specializes the runTest() method. */ - var $fName; - var $fResult; - var $fExceptions = array(); - - function TestCase($name) { - $this->fName = $name; - } - - function run(&$testResult=0) { - /* Run this single test, by calling the run() method of the - TestResult object which will in turn call the runBare() method - of this object. That complication allows the TestResult object - to do various kinds of progress reporting as it invokes each - test. Create/obtain a TestResult object if none was passed in. - Note that if a TestResult object was passed in, it must be by - reference. */ - if (! $testResult) - $testResult = $this->_createResult(); - $this->fResult = $testResult; - $testResult->run($this); - $this->fResult = 0; - return $testResult; - } - - function countTestCases() { - return 1; - } - - function runTest() { - $name = $this->name(); - // Since isset($this->$name) is false, no way to run defensive checks - $this->$name(); - } - - function setUp() /* expect override */ { - //print("TestCase::setUp()
\n"); - } - - function tearDown() /* possible override */ { - //print("TestCase::tearDown()
\n"); - } - - //////////////////////////////////////////////////////////////// - - - function _createResult() /* protected */ { - /* override this to use specialized subclass of TestResult */ - return new TestResult; - } - - function fail($message=0) { - //printf("TestCase::fail(%s)
\n", ($message) ? $message : ''); - /* JUnit throws AssertionFailedError here. We just record the - failure and carry on */ - $this->fExceptions[] = new Exception($message); - } - - function error($message) { - /* report error that requires correction in the test script - itself, or (heaven forbid) in this testing infrastructure */ - printf('ERROR: ' . $message . '
'); - $this->fResult->stop(); - } - - function failed() { - return count($this->fExceptions); - } - - function getExceptions() { - return $this->fExceptions; - } - - function name() { - return $this->fName; - } - - function runBare() { - $this->setup(); - $this->runTest(); - $this->tearDown(); - } -} - - -class TestSuite /* implements Test */ { - /* Compose a set of Tests (instances of TestCase or TestSuite), and - run them all. */ - var $fTests = array(); - - function TestSuite($classname=false) { - if ($classname) { - // Find all methods of the given class whose name starts with - // "test" and add them to the test suite. We are just _barely_ - // able to do this with PHP's limited introspection... Note - // that PHP seems to store method names in lower case, and we - // have to avoid the constructor function for the TestCase class - // superclass. This will fail when $classname starts with - // "Test" since that will have a constructor method that will - // get matched below and then treated (incorrectly) as a test - // method. So don't name any TestCase subclasses as "Test..."! - if (floor(phpversion()) >= 4) { - // PHP4 introspection, submitted by Dylan Kuhn - $names = get_class_methods($classname); - while (list($key, $method) = each($names)) { - if (preg_match('/^test/', $method) && $method != "testcase") { - $this->addTest(new $classname($method)); - } - } - } - else { - $dummy = new $classname("dummy"); - $names = (array) $dummy; - while (list($key, $value) = each($names)) { - $type = gettype($value); - if ($type == "user function" && preg_match('/^test/', $key) - && $key != "testcase") { - $this->addTest(new $classname($key)); - } - } - } - } - } - - function addTest($test) { - /* Add TestCase or TestSuite to this TestSuite */ - $this->fTests[] = $test; - } - - function run($testResult) { - /* Run all TestCases and TestSuites comprising this TestSuite, - accumulating results in the given TestResult object. */ - reset($this->fTests); - while (list($na, $test) = each($this->fTests)) { - if ($testResult->shouldStop()) - break; - $test->run($testResult); - } - } - - function countTestCases() { - /* Number of TestCases comprising this TestSuite (including those - in any constituent TestSuites) */ - $count = 0; - reset($fTests); - while (list($na, $test_case) = each($this->fTests)) { - $count += $test_case->countTestCases(); - } - return $count; - } -} - - -class TestFailure { - /* Record failure of a single TestCase, associating it with the - exception(s) that occurred */ - var $fFailedTestName; - var $fExceptions; - - function TestFailure(&$test, &$exceptions) { - $this->fFailedTestName = $test->name(); - $this->fExceptions = $exceptions; - } - - function getExceptions() { - return $this->fExceptions; - } - function getTestName() { - return $this->fFailedTestName; - } -} - - -class TestResult { - /* Collect the results of running a set of TestCases. */ - var $fFailures = array(); - var $fRunTests = 0; - var $fStop = false; - - function TestResult() { } - - function _endTest($test) /* protected */ { - /* specialize this for end-of-test action, such as progress - reports */ - } - - function getFailures() { - return $this->fFailures; - } - - function run($test) { - /* Run a single TestCase in the context of this TestResult */ - $this->_startTest($test); - $this->fRunTests++; - - $test->runBare(); - - /* this is where JUnit would catch AssertionFailedError */ - $exceptions = $test->getExceptions(); - if ($exceptions) - $this->fFailures[] = new TestFailure($test, $exceptions); - $this->_endTest($test); - } - - function countTests() { - return $this->fRunTests; - } - - function shouldStop() { - return $this->fStop; - } - - function _startTest($test) /* protected */ { - /* specialize this for start-of-test actions */ - } - - function stop() { - /* set indication that the test sequence should halt */ - $fStop = true; - } - - function countFailures() { - return count($this->fFailures); - } -} - - -class TextTestResult extends TestResult { - /* Specialize TestResult to produce text/html report */ - function TextTestResult() { - $this->TestResult(); // call superclass constructor - } - - function report() { - /* report result of test run */ - $nRun = $this->countTests(); - $nFailures = $this->countFailures(); - printf("

%s test%s run
", $nRun, ($nRun == 1) ? '' : 's'); - printf("%s failure%s.
\n", $nFailures, ($nFailures == 1) ? '' : 's'); - if ($nFailures == 0) - return; - - print("

    \n"); - $failures = $this->getFailures(); - while (list($i, $failure) = each($failures)) { - $failedTestName = $failure->getTestName(); - printf("
  1. %s\n", $failedTestName); - - $exceptions = $failure->getExceptions(); - print("
      "); - while (list($na, $exception) = each($exceptions)) - printf("
    • %s\n", $exception->getMessage()); - print("
    "); - } - print("
\n"); - } - - function _startTest($test) { - printf("%s: ", $test->name()); - flush(); - } - - function _endTest($test) { - $outcome = $test->failed() - ? "FAIL" - : "Pass"; - printf("$outcome
\n"); - flush(); - } -} - - -class TestRunner { - /* Run a suite of tests and report results. */ - function run($suite) { - $result = new TextTestResult; - $suite->run($result); - $result->report(); - } -} - -?> diff --git a/test/testemail.php b/test/testemail.php new file mode 100644 index 00000000..d96e2001 --- /dev/null +++ b/test/testemail.php @@ -0,0 +1,48 @@ +IsSMTP(); // tell the class to use SMTP + $mail->SMTPAuth = true; // enable SMTP authentication + $mail->Port = 25; // set the SMTP server port + $mail->Host = "mail.yourdomain.com"; // SMTP server + $mail->Username = "name@domain.com"; // SMTP server username + $mail->Password = "password"; // SMTP server password + + $mail->IsSendmail(); // tell the class to use Sendmail + + $mail->AddReplyTo("name@domain.com","First Last"); + + $mail->From = "name@domain.com"; + $mail->FromName = "First Last"; + + $to = "someone@example...com"; + + $mail->AddAddress($to); + + $mail->Subject = "First PHPMailer Message"; + + $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test + $mail->WordWrap = 80; // set word wrap + + $mail->MsgHTML($body); + + $mail->IsHTML(true); // send as HTML + + $mail->Send(); + echo 'Message has been sent.'; +} catch (phpmailerException $e) { + echo $e->errorMessage(); +} +?> \ No newline at end of file diff --git a/test_script/LGPLv3.txt b/test_script/LGPLv3.txt new file mode 100644 index 00000000..d74a4323 --- /dev/null +++ b/test_script/LGPLv3.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/test_script/contents.html b/test_script/contents.html new file mode 100644 index 00000000..d78ec1f1 --- /dev/null +++ b/test_script/contents.html @@ -0,0 +1,14 @@ + +
+

+
+ This is a test of PHPMailer v5.0.0 for PHP5/6.
+
+This particular example uses HTML, with a <div> tag and inline
+styles.
+
+Also note the use of the PHPMailer at the top with no specific code to handle +including it in the body of the email.
+ + + diff --git a/test_script/images/aikido.gif b/test_script/images/aikido.gif new file mode 100644 index 0000000000000000000000000000000000000000..2a9bcf4462768b1b26420adc647178b14b2f3062 GIT binary patch literal 26300 zcmeF1_fs;YYV@?~dd=iuPr z2sjT`Ld`#L|aw>Zs~==OJg z+UoK9_;$X(`^!6A6bYN&K+nZKK2y+sVW9Wh@nVJc3%$XM-1_W$^@J9d-A zrav_B^V`XCgZ-}@iz9MgWQ(M&?pY=z26p$7L?-#bM1i#)V~FSx z{Vf9eMfd&GJEysdpbRY$8UW@H2N_bq=h$=u0+b?*Ma08Jhef51n}F)X{4g66>-+*H z!dZ8iiH`h1=jfR4yXIUP;n zNj~+)^hqVrNZd$;Pm|_pHT<*&td1SR<8q;}8IL@;0#SVq5@nHAcT*F2Z=_zP+QStj zbT24Fw@eaOLOZU0mV>D4KK`(F!r2-KoegFL#*p>kVIDJcsZdtjqy|8^{PyQ*XNTJC z$DSQ4{5$x&NRki0c21~E-v2vI2SgW*zz(z-!{ zhIO_igdmf54C(AT2&0G!anGfhI#z@cIU}2(OMzi_a9m>JXDCUb4Qm)h?Vmd!kI|X$ zlV9olcSnD`wXucY{?&i?C3V`zy9;#4=jRaheIXQFQ}FMdY2AJ1_C=%FkL3hpW-p83 zbg2CA!>XZ=Si)K8MXrWH4%l5V zHIRNMthU&>6MtO&ZExn+me;|IsdjH)mz@E}LEdup^$~?E5OUJGStD>NSD{c8PKR0u z86aT(-1qqEo{a41M9EWGPkJPlXRZHR0@v#Bx?A(v#FT95{PZi=8t7liRBza#`r|@4 z|2OS{@A0(g`m4_1#RycV$72_aCTi{gPFF2a61vFXIs1O*UJ%U!RJvUGi$&H zZl$Fl0OVt~0$I`Q&@K^C!=$pMhfl_4&*64AGTWA|AsY;X|6RgZ0ZWnd&Bg|8uEY42=Xj>c@PxnAFT#L>l z70zTOY4ve;41|7me`85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U2SSM5 z2z{@xsdHCX~$E^_0Q+Ovd}T zoVw&e_pD)dusQ%q-4m+KX2xkDzo5D6PzR`4bLiA;? z>{lH2vI~e6r`)k)a5&+%B191;`#UH2*RNFH4RK&p!u8dRiP7|9>|l{gYQbuv(P)eb zo{mLBc?}oaikN&m8b6T#N*vQ4pCjhPydVaNTysY<1a@d?>=g?2M_N2=4ZxrTY74P@ zymP*Da_E8CJ%K?>oY4L>{&yEXFOau7MxS1R_=)%&V%&TI5N0aqSb3;I5iA|ZLyQM) zqJ~`T$!D{Jr$-+6j3M4FQ1J(t^QJk*q7aP>Nf*udH+IF8k{<+c9-MA`poQk|(fpc(rnTb4MhcPH1v~e$pE(GHno5)${JY8Vg(=v z_LlCoM`G*q^X4D0)#9h^xFbEO0mUU&Xldx$7U;pXl(7Q({0dm|3zAw-HqZ~Aa?0tl zEA?B6M*oUdBPCrOgKQQdZV?&S_=qEGd51{g7Wd#HvwWCSuo|hNhn3Oe8E!86&ox=H zl0C)>hEph;ixO3rKu|64mp8av$2z_W1#gFHh(cblqhXEAmNZ@xr#v42Ae2+EP?xD* z5nk~t<=jHRPI;uRei&zjVKYG{xFY*tOs8~CPFJ+?C|Pl}P#qPBK?QDJ3X@e9siSWStD?DTG(pySN!k)tieVuyAR7rD^KWO5$tpXgD$91R)uN4x~Gfoe6buaAr{&NOY}t8?B2X zP(RqmezJ@3O9S6#a)|K86gbm7I_Lh#0fV00rM;+W zL+GA_rXLke;uTJqcHxMAvzsTlV=Zw55v2(L(LuO3^32xOJEowW`{rjrHQf$+>J_!Nt|?nI03w>b5H4H&*Sx;3iaM9i{6?`y-(=9^}OE3=HBMX-j?-Vp-(Tu9jb^D eA;^6qUSCghU*BZkz + + + +PHPMailer Test Page + + + + + + + +"; + +if ( substr(phpversion(),0,1) < 5 ) { echo exit("ERROR: Wrong PHP version"); } + +$CFG['smtp_debug'] = 1; +$CFG['smtp_server'] = 'mail.yourserver.com'; +$CFG['smtp_port'] = '25'; +$CFG['smtp_authenticate'] = 'true'; +$CFG['smtp_username'] = 'name@yourserver.com'; +$CFG['smtp_password'] = 'yourpassword'; + +if ( $_POST['submit'] == "Submit" ) { + + class phpmailerAppException extends Exception { + public function errorMessage() { + $errorMsg = '' . $this->getMessage() . "
"; + return $errorMsg; + } + } + + try { + $to = $_POST['To_Email']; + if(filter_var($to, FILTER_VALIDATE_EMAIL) === FALSE) { + throw new phpmailerAppException("Email address " . $to . " is invalid -- aborting!
"); + } + } catch (phpmailerAppException $e) { + echo $e->errorMessage(); + return false; + } + + require_once("../class.phpmailer.php"); + + $mail = new PHPMailer(); + + if ( $_POST['Message'] == '' ) { + $body = $mail->getFile('contents.html'); + $body = eregi_replace("[\]",'',$body); + } else { + $body = $_POST['Message']; + } + + if ( $_POST['test_type'] == "smtp" ) { + $mail->IsSMTP(); // telling the class to use SMTP + $mail->SMTPDebug = $_POST['smtp_debug']; + $mail->SMTPAuth = $_POST['smtp_authenticate']; // enable SMTP authentication + $mail->Port = $_POST['smtp_port']; // set the SMTP port + $mail->Host = $_POST['smtp_server']; // SMTP server + $mail->Username = $_POST['authenticate_username']; // SMTP account username + $mail->Password = $_POST['authenticate_password']; // SMTP account password + } elseif ( $_POST['test_type'] == "mail" ) { + $mail->IsMail(); // telling the class to use PHP's Mail() + } elseif ( $_POST['test_type'] == "sendmail" ) { + $mail->IsSendmail(); // telling the class to use Sendmail + } elseif ( $_POST['test_type'] == "qmail" ) { + $mail->IsQmail(); // telling the class to use Qmail + } + + if ( $_POST['From_Name'] != '' ) { + $mail->AddReplyTo($_POST['From_Email'],$_POST['From_Name']); + $mail->From = $_POST['From_Email']; + $mail->FromName = $_POST['From_Name']; + } else { + $mail->AddReplyTo($_POST['From_Email']); + $mail->From = $_POST['From_Email']; + $mail->FromName = $_POST['From_Email']; + } + + if ( $_POST['To_Name'] != '' ) { + $mail->AddAddress($to,$_POST['To_Name']); + } else { + $mail->AddAddress($to); + } + + if ( $_POST['bcc_Email'] != '' ) { + $indiBCC = explode(" ", $_POST['bcc_Email']); + foreach ($indiBCC as $key => $value) { + $mail->AddBCC($value); + } + } + + if ( $_POST['cc_Email'] != '' ) { + $indiCC = explode(" ", $_POST['cc_Email']); + foreach ($indiCC as $key => $value) { + $mail->AddCC($value); + } + } + + $mail->Subject = $_POST['Subject'] . ' (PHPMailer test using ' . strtoupper($_POST['test_type']) . ')'; + + require_once('../class.html2text.inc.php'); + $h2t =& new html2text($body); + $mail->AltBody = $h2t->get_text(); + //$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test + $mail->WordWrap = 80; // set word wrap + + $mail->MsgHTML($body); + + // $mail->IsHTML(true); // send as HTML + + $mail->AddAttachment("images/aikido.gif", "aikido.gif"); // optional name + $mail->AddAttachment("images/phpmailer.gif", "phpmailer.gif"); // optional name + + try { + if ( !$mail->Send() ) { + $error = "Unable to send to: " . $to . "
"; + throw new phpmailerAppException($error); + } else { + echo 'Message has been sent using ' . strtoupper($_POST['test_type']) . "

"; + } + } + catch (phpmailerAppException $e) { + $errorMsg[] = $e->errorMessage(); + } + + if ( count($errorMsg) > 0 ) { + foreach ($errorMsg as $key => $value) { + $thisError = $key + 1; + echo $thisError . ': ' . $value; + } + } + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Script:
+
+class phpmailerAppException extends Exception {
+  public function errorMessage() {
+    $errorMsg = '' . $this->getMessage() . "
"; + return $errorMsg; + } +} + +try { + $to = ; + if(filter_var($to, FILTER_VALIDATE_EMAIL) === FALSE) { + throw new phpmailerAppException("Email address " . $to . " is invalid -- aborting!
"); + } +} catch (phpmailerAppException $e) { + echo $e->errorMessage(); + return false; +} + +require_once("../class.phpmailer.php"); + +$mail = new PHPMailer(); + +getFile(\'contents.html\');' . "\n"; + echo '$body = eregi_replace("[\]",\'\',$body);' . "\n"; +} else { + echo '$body = ' . $_POST['Message'] . "\n"; +} + +echo "\n"; + +if ( $_POST['test_type'] == "smtp" ) { + echo '$mail->IsSMTP(); // telling the class to use SMTP' . "\n"; + echo '$mail->SMTPDebug = ' . $_POST['smtp_debug'] . "\n"; + echo '$mail->SMTPAuth = ' . $_POST['smtp_authenticate']; // enable SMTP authentication' . "\n"; + echo '$mail->Port = ' . $_POST['smtp_port']; // set the SMTP port' . "\n"; + echo '$mail->Host = ' . $_POST['smtp_server']; // SMTP server' . "\n"; + echo '$mail->Username = ' . $_POST['authenticate_username']; // SMTP account username' . "\n"; + echo '$mail->Password = ' . $_POST['authenticate_password']; // SMTP account password' . "\n"; +} elseif ( $_POST['test_type'] == "mail" ) { + echo '$mail->IsMail(); // telling the class to use PHP\'s Mail()' . "\n"; +} elseif ( $_POST['test_type'] == "sendmail" ) { + echo '$mail->IsSendmail(); // telling the class to use Sendmail' . "\n"; +} elseif ( $_POST['test_type'] == "qmail" ) { + echo '$mail->IsQmail(); // telling the class to use Qmail' . "\n"; +} +?> + +$mail->AddReplyTo('',''); + +$mail->From = ''; +$mail->FromName = ''; + + +$mail->AddAddress('',''); + +$mail->AddAddress(''); + $value) { +echo '$mail->AddBCC(\'' . $value . '\');
'; + } +} + +if ( $_POST['cc_Email'] != '' ) { + $indiCC = explode(" ", $_POST['cc_Email']); + foreach ($indiCC as $key => $value) { +echo '$mail->AddCC(\'' . $value . '\');
'; + } +} +?> + +$mail->Subject = (PHPMailer test using ) + +require_once('../class.html2text.inc.php'); +$h2t =& new html2text($body); +$mail->AltBody = $h2t->get_text(); +$mail->WordWrap = 80; // set word wrap + +$mail->MsgHTML($body); + +$mail->AddAttachment("images/aikido.gif", "aikido.gif"); // optional name +$mail->AddAttachment("images/phpmailer.gif", "phpmailer.gif"); // optional name + +try { + if ( !$mail->Send() ) { + $error = "Unable to send to: " . $to . "
"; + throw new phpmailerAppException($error); + } else { + echo 'Message has been sent using

'; + } +} catch (phpmailerAppException $e) { + $errorMsg[] = $e->errorMessage(); +} + +if ( count($errorMsg) > 0 ) { + foreach ($errorMsg as $key => $value) { + $thisError = $key + 1; + echo $thisError . ': ' . $value; + } +} +
+ + + + + +
+ + + + + +
Message

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
From Name
From Email Address
To Name
To Email Address
cc Email Addresses (separate with commas)
bcc Email Addresses (separate with commas)
Subject
Message
If blank, will use content.html
+
Mail Test Specs

+ + + + + +
Test Type + + + + + + + + + + + + + + + + +
>Mail()
>Sendmail
>Qmail
>SMTP
+
+ If SMTP test:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SMTP Debug ?
SMTP Server
SMTP Port
SMTP Authenticate ? value="">
Authenticate Username
Authenticate Password
+
+
+ Test will include two attachments, plus one of the attachments is used as an inline graphic in the message body.
+
+ +
+ \ No newline at end of file diff --git a/test_script/scripts/clipboard.swf b/test_script/scripts/clipboard.swf new file mode 100644 index 0000000000000000000000000000000000000000..1b4d90a0fb838b38828bb2bb7f74c6629fd200c2 GIT binary patch literal 1361 zcmV-X1+Mx-S5pZa2LJ$goPAY&Y!pQlpV_b3-TUm}^X0f<&rEX&Y!- zauV@_vU_)Py)ApUWp7*B8VsPJiAGFNK>4FKkPyQkC1}JT#u^DBO2jKc3GfG)m^Ofk zs3=N6oxQ8o3UM-$nL$E532LObqcsxE{WFsO3;V4dFe?0)> zgCA)Zu=dGSgza-j~MBmh1>=YHvhW zjM$S(8ar~Rn40d@ltH0g?^m$}uWf!Q!%kH< z#xP^(x+!Y95+m+Yab4_H3?+$4u(V@Vt}~XDzL_;iqL{^o zp&OJavdxwNF<%uW+>lhbv~>tJx&D)vV-^K@4-n>gIL}Cuo^)MK^j2@Q5=E@(E?&c#M%&R zN2~)uCxR{n-3aC(n2%rqf`tecA?Oi`AoGNKe;%BVkBlB`FLik`TjxQHxw+$uc$EF~c!W)_K#E)2;kuZ3;AC~kD(D%158!=faIH7g*#&hCJlDj!{@^#Oh z&YnA!snInzdhQjh`|(Qhx29Y7cdBDm2OEziuibn3#L~q}Ki^y5KlPSqKlipTm^gFf zNMdBlx9#e9;OyPW9qD~{$8PeEH?Qm5Q+2lM%JJZp!X>x%IyQ5xfRV{0N=) literal 0 HcmV?d00001 diff --git a/test_script/scripts/shBrushBash.js b/test_script/scripts/shBrushBash.js new file mode 100644 index 00000000..378df939 --- /dev/null +++ b/test_script/scripts/shBrushBash.js @@ -0,0 +1,59 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Bash = function() +{ + var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne gt lt ge le'; + var commands = 'alias apropos awk bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' + + 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' + + 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' + + 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' + + 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' + + 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' + + 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' + + 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' + + 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' + + 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' + + 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' + + 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' + + 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' + + 'vi watch wc whereis which who whoami Wget xargs yes' + ; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands + ]; +} + +SyntaxHighlighter.brushes.Bash.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Bash.aliases = ['bash', 'shell']; + diff --git a/test_script/scripts/shBrushCSharp.js b/test_script/scripts/shBrushCSharp.js new file mode 100644 index 00000000..dc6304cb --- /dev/null +++ b/test_script/scripts/shBrushCSharp.js @@ -0,0 +1,64 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.CSharp = function() +{ + var keywords = 'abstract as base bool break byte case catch char checked class const ' + + 'continue decimal default delegate do double else enum event explicit ' + + 'extern false finally fixed float for foreach get goto if implicit in int ' + + 'interface internal is lock long namespace new null object operator out ' + + 'override params private protected public readonly ref return sbyte sealed set ' + + 'short sizeof stackalloc static string struct switch this throw true try ' + + 'typeof uint ulong unchecked unsafe ushort using virtual void while'; + + function fixComments(match, regexInfo) + { + var css = (match[0].indexOf("///") == 0) + ? 'color1' + : 'comments' + ; + + return [new SyntaxHighlighter.Match(match[0], match.index, css)]; + } + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // c# keyword + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); +}; + +SyntaxHighlighter.brushes.CSharp.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp']; + diff --git a/test_script/scripts/shBrushCpp.js b/test_script/scripts/shBrushCpp.js new file mode 100644 index 00000000..146a3dfc --- /dev/null +++ b/test_script/scripts/shBrushCpp.js @@ -0,0 +1,99 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Cpp = function() +{ + // Copyright 2006 Shin, YoungJin + + var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' + + 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' + + 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' + + 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' + + 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' + + 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' + + 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' + + 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' + + 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' + + 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' + + 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' + + 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' + + 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' + + 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' + + 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' + + 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' + + 'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' + + 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' + + 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' + + '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' + + 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' + + 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' + + 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' + + 'va_list wchar_t wctrans_t wctype_t wint_t signed'; + + var keywords = 'break case catch class const __finally __exception __try ' + + 'const_cast continue private public protected __declspec ' + + 'default delete deprecated dllexport dllimport do dynamic_cast ' + + 'else enum explicit extern if for friend goto inline ' + + 'mutable naked namespace new noinline noreturn nothrow ' + + 'register reinterpret_cast return selectany ' + + 'sizeof static static_cast struct switch template this ' + + 'thread throw true false try typedef typeid typename union ' + + 'using uuid virtual void volatile whcar_t while'; + + var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' + + 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + + 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + + 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' + + 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' + + 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + + 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + + 'fwrite getc getchar gets perror printf putc putchar puts remove ' + + 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + + 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + + 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + + 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + + 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + + 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + + 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + + 'clock ctime difftime gmtime localtime mktime strftime time'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /^ *#.*/gm, css: 'preprocessor' }, + { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' }, + { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' } + ]; +}; + +SyntaxHighlighter.brushes.Cpp.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Cpp.aliases = ['cpp', 'c']; diff --git a/test_script/scripts/shBrushCss.js b/test_script/scripts/shBrushCss.js new file mode 100644 index 00000000..ebfc3399 --- /dev/null +++ b/test_script/scripts/shBrushCss.js @@ -0,0 +1,93 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.CSS = function() +{ + function getKeywordsCSS(str) + { + return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; + }; + + function getValuesCSS(str) + { + return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; + }; + + var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + + 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + + 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + + 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + + 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + + 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + + 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + + 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + + 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + + 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + + 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + + 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + + 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + + 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; + + var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ + 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ + 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+ + 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ + 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ + 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ + 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ + 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ + 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ + 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ + 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ + 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ + 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ + 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; + + var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors + { regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes + { regex: /!important/g, css: 'color3' }, // !important + { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values + { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts + ]; + + this.forHtmlScript({ + left: /(<|<)\s*style.*?(>|>)/gi, + right: /(<|<)\/\s*style\s*(>|>)/gi + }); +}; + +SyntaxHighlighter.brushes.CSS.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.CSS.aliases = ['css']; diff --git a/test_script/scripts/shBrushDelphi.js b/test_script/scripts/shBrushDelphi.js new file mode 100644 index 00000000..e46d0748 --- /dev/null +++ b/test_script/scripts/shBrushDelphi.js @@ -0,0 +1,57 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Delphi = function() +{ + var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' + + 'case char class comp const constructor currency destructor div do double ' + + 'downto else end except exports extended false file finalization finally ' + + 'for function goto if implementation in inherited int64 initialization ' + + 'integer interface is label library longint longword mod nil not object ' + + 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' + + 'pint64 pointer private procedure program property pshortstring pstring ' + + 'pvariant pwidechar pwidestring protected public published raise real real48 ' + + 'record repeat set shl shortint shortstring shr single smallint string then ' + + 'threadvar to true try type unit until uses val var varirnt while widechar ' + + 'widestring with word write writeln xor'; + + this.regexList = [ + { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *) + { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { } + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags + { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345 + { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3 + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword + ]; +}; + +SyntaxHighlighter.brushes.Delphi.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Delphi.aliases = ['delphi', 'pascal']; diff --git a/test_script/scripts/shBrushDiff.js b/test_script/scripts/shBrushDiff.js new file mode 100644 index 00000000..558fe6e8 --- /dev/null +++ b/test_script/scripts/shBrushDiff.js @@ -0,0 +1,43 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Diff = function() +{ + this.regexList = [ + { regex: /^\+\+\+.*$/gm, css: 'color2' }, + { regex: /^\-\-\-.*$/gm, css: 'color2' }, + { regex: /^\s.*$/gm, css: 'color1' }, + { regex: /^@@.*@@$/gm, css: 'variable' }, + { regex: /^\+[^\+]{1}.*$/gm, css: 'string' }, + { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' } + ]; +}; + +SyntaxHighlighter.brushes.Diff.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Diff.aliases = ['diff', 'patch']; diff --git a/test_script/scripts/shBrushGroovy.js b/test_script/scripts/shBrushGroovy.js new file mode 100644 index 00000000..22001c5c --- /dev/null +++ b/test_script/scripts/shBrushGroovy.js @@ -0,0 +1,69 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Groovy = function() +{ + // Contributed by Andres Almiray + // http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter + + var keywords = 'as assert break case catch class continue def default do else extends finally ' + + 'if in implements import instanceof interface new package property return switch ' + + 'throw throws try while public protected private static'; + var types = 'void boolean byte char short int long float double'; + var constants = 'null'; + var methods = 'allProperties count get size '+ + 'collect each eachProperty eachPropertyName eachWithIndex find findAll ' + + 'findIndexOf grep inject max min reverseEach sort ' + + 'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' + + 'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' + + 'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' + + 'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' + + 'transformChar transformLine withOutputStream withPrintWriter withStream ' + + 'withStreams withWriter withWriterAppend write writeLine '+ + 'dump inspect invokeMethod print println step times upto use waitForOrKill '+ + 'getText'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /""".*"""/g, css: 'string' }, // GStrings + { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword + { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type + { regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants + { regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); +} + +SyntaxHighlighter.brushes.Groovy.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Groovy.aliases = ['groovy']; diff --git a/test_script/scripts/shBrushJScript.js b/test_script/scripts/shBrushJScript.js new file mode 100644 index 00000000..26c94100 --- /dev/null +++ b/test_script/scripts/shBrushJScript.js @@ -0,0 +1,51 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.JScript = function() +{ + var keywords = 'abstract boolean break byte case catch char class const continue debugger ' + + 'default delete do double else enum export extends false final finally float ' + + 'for function goto if implements import in instanceof int interface long native ' + + 'new null package private protected public return short static super switch ' + + 'synchronized this throw throws transient true try typeof var void volatile while with'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags); +}; + +SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript']; diff --git a/test_script/scripts/shBrushJava.js b/test_script/scripts/shBrushJava.js new file mode 100644 index 00000000..6208f6fa --- /dev/null +++ b/test_script/scripts/shBrushJava.js @@ -0,0 +1,55 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Java = function() +{ + var keywords = 'abstract assert boolean break byte case catch char class const ' + + 'continue default do double else enum extends ' + + 'false final finally float for goto if implements import ' + + 'instanceof int interface long native new null ' + + 'package private protected public return ' + + 'short static strictfp super switch synchronized this throw throws true ' + + 'transient try void volatile while'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers + { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno + { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); +}; + +SyntaxHighlighter.brushes.Java.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Java.aliases = ['java']; diff --git a/test_script/scripts/shBrushPerl.js b/test_script/scripts/shBrushPerl.js new file mode 100644 index 00000000..efa4bc24 --- /dev/null +++ b/test_script/scripts/shBrushPerl.js @@ -0,0 +1,74 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Perl = function() +{ + // Contributed by David Simmons-Duffin and Marty Kube + + var funcs = + 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' + + 'chroot close closedir connect cos crypt defined delete each endgrent ' + + 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' + + 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' + + 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' + + 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' + + 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' + + 'getservbyname getservbyport getservent getsockname getsockopt glob ' + + 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' + + 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' + + 'oct open opendir ord pack pipe pop pos print printf prototype push ' + + 'quotemeta rand read readdir readline readlink readpipe recv rename ' + + 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' + + 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' + + 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' + + 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' + + 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' + + 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' + + 'undef unlink unpack unshift utime values vec wait waitpid warn write'; + + var keywords = + 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' + + 'for foreach goto if import last local my next no our package redo ref ' + + 'require return sub tie tied unless untie until use wantarray while'; + + this.regexList = [ + { regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' }, + { regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, + { regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' }, + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); +} + +SyntaxHighlighter.brushes.Perl.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Perl.aliases = ['perl', 'Perl', 'pl']; \ No newline at end of file diff --git a/test_script/scripts/shBrushPhp.js b/test_script/scripts/shBrushPhp.js new file mode 100644 index 00000000..9dd28fd8 --- /dev/null +++ b/test_script/scripts/shBrushPhp.js @@ -0,0 +1,91 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Php = function() +{ + var funcs = 'abs acos acosh addcslashes addslashes ' + + 'array_change_key_case array_chunk array_combine array_count_values array_diff '+ + 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+ + 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+ + 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+ + 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+ + 'array_push array_rand array_reduce array_reverse array_search array_shift '+ + 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+ + 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+ + 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+ + 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+ + 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+ + 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+ + 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+ + 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+ + 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+ + 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+ + 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+ + 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+ + 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+ + 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+ + 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+ + 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+ + 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+ + 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+ + 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+ + 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+ + 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+ + 'parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir '+ + 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+ + 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+ + 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+ + 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+ + 'strtoupper strtr strval substr substr_compare'; + + var keywords = 'and or xor array as break case ' + + 'cfunction class const continue declare default die do else ' + + 'elseif enddeclare endfor endforeach endif endswitch endwhile ' + + 'extends for foreach function include include_once global if ' + + 'new old_function return static switch use require require_once ' + + 'var while abstract interface public implements extends private protected throw'; + + var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\$\w+/g, css: 'variable' }, // variables + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions + { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); +}; + +SyntaxHighlighter.brushes.Php.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Php.aliases = ['php']; diff --git a/test_script/scripts/shBrushPlain.js b/test_script/scripts/shBrushPlain.js new file mode 100644 index 00000000..6a6f2d69 --- /dev/null +++ b/test_script/scripts/shBrushPlain.js @@ -0,0 +1,35 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Plain = function() +{ +}; + +SyntaxHighlighter.brushes.Plain.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Plain.aliases = ['text', 'plain']; diff --git a/test_script/scripts/shBrushPython.js b/test_script/scripts/shBrushPython.js new file mode 100644 index 00000000..f6d3af23 --- /dev/null +++ b/test_script/scripts/shBrushPython.js @@ -0,0 +1,56 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Python = function() +{ + // Contributed by Gheorghe Milas + + var keywords = 'and assert break class continue def del elif else ' + + 'except exec finally for from global if import in is ' + + 'lambda not or pass print raise return try yield while'; + + var special = 'None True False self cls class_'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, + { regex: /^\s*@\w+/gm, css: 'decorator' }, + { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' }, + { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' }, + { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' }, + { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' }, + { regex: /\b\d+\.?\w*/g, css: 'value' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, + { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' } + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); +}; + +SyntaxHighlighter.brushes.Python.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Python.aliases = ['py', 'python']; diff --git a/test_script/scripts/shBrushRuby.js b/test_script/scripts/shBrushRuby.js new file mode 100644 index 00000000..bbf965a4 --- /dev/null +++ b/test_script/scripts/shBrushRuby.js @@ -0,0 +1,57 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Ruby = function() +{ + // Contributed by Erik Peterson. + + var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + + 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + + 'self super then throw true undef unless until when while yield'; + + var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + + 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + + 'ThreadGroup Thread Time TrueClass'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants + { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols + { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); +}; + +SyntaxHighlighter.brushes.Ruby.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Ruby.aliases = ['ruby', 'rails', 'ror']; diff --git a/test_script/scripts/shBrushScala.js b/test_script/scripts/shBrushScala.js new file mode 100644 index 00000000..cb508008 --- /dev/null +++ b/test_script/scripts/shBrushScala.js @@ -0,0 +1,53 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Scala = function() +{ + // Contributed by Yegor Jbanov and David Bernard. + + var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' + + 'override try lazy for var catch throw type extends class while with new final yield abstract ' + + 'else do if return protected private this package false'; + + var keyops = '[_:=><%#@]+'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings + { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword + ]; +} + +SyntaxHighlighter.brushes.Scala.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Scala.aliases = ['scala']; diff --git a/test_script/scripts/shBrushSql.js b/test_script/scripts/shBrushSql.js new file mode 100644 index 00000000..3499ff68 --- /dev/null +++ b/test_script/scripts/shBrushSql.js @@ -0,0 +1,68 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Sql = function() +{ + var funcs = 'abs avg case cast coalesce convert count current_timestamp ' + + 'current_user day isnull left lower month nullif replace right ' + + 'session_user space substring sum system_user upper user year'; + + var keywords = 'absolute action add after alter as asc at authorization begin bigint ' + + 'binary bit by cascade char character check checkpoint close collate ' + + 'column commit committed connect connection constraint contains continue ' + + 'create cube current current_date current_time cursor database date ' + + 'deallocate dec decimal declare default delete desc distinct double drop ' + + 'dynamic else end end-exec escape except exec execute false fetch first ' + + 'float for force foreign forward free from full function global goto grant ' + + 'group grouping having hour ignore index inner insensitive insert instead ' + + 'int integer intersect into is isolation key last level load local max min ' + + 'minute modify move name national nchar next no numeric of off on only ' + + 'open option order out output partial password precision prepare primary ' + + 'prior privileges procedure public read real references relative repeatable ' + + 'restrict return returns revoke rollback rollup rows rule schema scroll ' + + 'second section select sequence serializable set size smallint static ' + + 'statistics table temp temporary then time timestamp to top transaction ' + + 'translation trigger true truncate uncommitted union unique update values ' + + 'varchar varying view when where with work'; + + var operators = 'all and any between cross in join like not null or outer some'; + + this.regexList = [ + { regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments + { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions + { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword + ]; +}; + +SyntaxHighlighter.brushes.Sql.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Sql.aliases = ['sql']; + diff --git a/test_script/scripts/shBrushVb.js b/test_script/scripts/shBrushVb.js new file mode 100644 index 00000000..9e84549e --- /dev/null +++ b/test_script/scripts/shBrushVb.js @@ -0,0 +1,58 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Vb = function() +{ + var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' + + 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' + + 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' + + 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' + + 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' + + 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' + + 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' + + 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' + + 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' + + 'Overloads Overridable Overrides ParamArray Preserve Private Property ' + + 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' + + 'Return Select Set Shadows Shared Short Single Static Step Stop String ' + + 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' + + 'Variant When While With WithEvents WriteOnly Xor'; + + this.regexList = [ + { regex: /'.*$/gm, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); +}; + +SyntaxHighlighter.brushes.Vb.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Vb.aliases = ['vb', 'vbnet']; diff --git a/test_script/scripts/shBrushXml.js b/test_script/scripts/shBrushXml.js new file mode 100644 index 00000000..11a5b5c6 --- /dev/null +++ b/test_script/scripts/shBrushXml.js @@ -0,0 +1,71 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +SyntaxHighlighter.brushes.Xml = function() +{ + function process(match, regexInfo) + { + var constructor = SyntaxHighlighter.Match, + code = match[0], + tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), + result = [] + ; + + if (match.attributes != null) + { + var attributes, + regex = new XRegExp('(? [\\w:\\-\\.]+)' + + '\\s*=\\s*' + + '(? ".*?"|\'.*?\'|\\w+)', + 'xg'); + + while ((attributes = regex.exec(code)) != null) + { + result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); + result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); + } + } + + if (tag != null) + result.push( + new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') + ); + + return result; + } + + this.regexList = [ + { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // + { regex: new XRegExp('(\\<|<)!--\\s*.*?\\s*--(\\>|>)', 'gm'), css: 'comments' }, // + { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } + ]; +}; + +SyntaxHighlighter.brushes.Xml.prototype = new SyntaxHighlighter.Highlighter(); +SyntaxHighlighter.brushes.Xml.aliases = ['xml', 'xhtml', 'xslt', 'html', 'xhtml']; diff --git a/test_script/scripts/shCore.js b/test_script/scripts/shCore.js new file mode 100644 index 00000000..e531557f --- /dev/null +++ b/test_script/scripts/shCore.js @@ -0,0 +1,30 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('f(!1o.31){p 31=h(){p l={5S:{"1e-1c":"","73-2E":1,"2a-1P":u,"1I":u,"6T-6S":U,"1F-1P":4,"5F":O,"5x":U,"1q":U,"5v":O,"6i-6p":U,"6J":O},Q:{5D:u,5i:16,5k:16,7P:O,7I:"5L",1b:{4e:"91 1i",3Y:"92 1i",5l:"93 90 6K",6X:"8Z I 8W 1X 8X 6K 8Y",3u:"3u",6h:"?",1u:"31\\n\\n",5Z:"94\'t 95 7J C: ",7z:"9b 9c\'t 9a C 2j-2n 99: ",6B:"<2j 8G=\\"2y://7A.7E.7o/8D/8E\\"><70><8F 2y-8L=\\"8M-8S\\" 5h=\\"2c/2j; 8T=8R-8\\" /><36>8Q 31<2R 1f=\\"2a-7T:8N,\'7h 8O 8P\',7h,7L;9d-53:#9e;53:#9D;2a-1P:9E;2c-8i:85;\\">3184 2.0.9O (9M 9L 6H)
2y://6a.4a9w I 9k 9l.9m 9j-6H 9i 9f."},7j:O},1p:{59:u,3q:u,3o:u,5j:{}},30:{},8a:{9g:/\\/\\*[\\s\\S]*?\\*\\//4M,9h:/\\/\\/.*$/4M,9n:/#.*$/4M,9o:/"(?:\\.|(\\\\\\")|[^\\""\\n])*"/g,9u:/\'(?:\\.|(\\\\\\\')|[^\\\'\'\\n])*\'/g,9v:/"(?:\\.|(\\\\\\")|[^\\""])*"/g,9t:/\'(?:\\.|(\\\\\\\')|[^\\\'\'])*\'/g,3e:/\\w+:\\/\\/[\\w-.\\/?%&=]*/g,9s:{E:/(&1C;|<)\\?=?/g,17:/\\?(&2m;|>)/g},9p:{E:/(&1C;|<)%=?/g,17:/%(&2m;|>)/g},9q:{E:/(&1C;|<)\\s*2n.*?(&2m;|>)/47,17:/(&1C;|<)\\/\\s*2n\\s*(&2m;|>)/47}},1q:{15:h(32){p 38=J.1t("37"),4L=l.1q.77;38.Y="1q";C(p 2N 1X 4L){p 6j=4L[2N],4G=R 6j(32),22=4G.15();32.5E[2N]=4G;f(22==u){1V}f(9r(22)=="9P"){22=l.1q.6C(22,32.1j,2N)}22.Y+="8w "+2N;38.1z(22)}q 38},6C:h(4v,6O,4w){p a=J.1t("a"),5e=a.1f,4F=l.Q,57=4F.5i,5c=4F.5k;a.2q="#"+4w;a.36=4v;a.5P=6O;a.6c=4w;a.1r=4v;f(5z(57)==O){5e.1N=57+"5H"}f(5z(5c)==O){5e.2u=5c+"5H"}a.8q=h(e){8j{l.1q.6f(c,e||1o.6g,c.5P,c.6c)}8m(e){l.B.1u(e.6F)}q O};q a},6f:h(7i,7a,5T,7O,72){p 4Y=l.1p.5j[5T],45;f(4Y==u||(45=4Y.5E[7O])==u){q u}q 45.2h(7i,7a,72)},77:{4e:h(4p){c.15=h(){f(4p.T("5v")!=U){q}q l.Q.1b.4e};c.2h=h(4q,8v,8B){p z=4p.z;4q.71.51(4q);z.Y=z.Y.D("5t","")}},3Y:h(8g){c.15=h(){q l.Q.1b.3Y};c.2h=h(8p,8o,8t){p 33=l.B.3d(8g.5r).D(/"+33+"");2b.J.4N()}},5l:h(4S){p 3x,8y,5M=4S.1j;c.15=h(){p 2A=l.Q;f(2A.5D==u){q u}h 1L(5C){p 5s="";C(p 5A 1X 5C){5s+="<8z 1c=\'"+5A+"\' 1W=\'"+5C[5A]+"\'/>"}q 5s};h 2p(43){p 5p="";C(p 5o 1X 43){5p+=" "+5o+"=\'"+43[5o]+"\'"}q 5p};p 48={1N:2A.5i,2u:2A.5k,1j:5M+"ai",6z:"bu/x-74-79",36:l.Q.1b.5l},46={bl:"bm",bx:"bA",bz:"5P="+5M,bF:"O"},4t=2A.5D,35;f(/aQ/i.1R(61.6b)){35="<8h"+2p({aT:"bd:bf-b9-b5-b4-b7",b8:"2y://ba.be.4a/bb/74/bc/79/b3.b2#84=9,0,0,0"})+2p(48)+">"+1L(46)+1L({aU:4t})+""}F{35=""}3x=J.1t("z");3x.1r=35;q 3x};c.2h=h(aV,aW,4R){p 68=4R.b1;6V(68){2J"7C":p 5d=l.B.2W(l.B.3d(4S.5r).D(/&1C;/g,"<").D(/&2m;/g,">").D(/&b0;/g,"&"));f(1o.6e){1o.6e.aZ("2c",5d)}F{q l.B.2W(5d)}2J"aX":l.B.1u(l.Q.1b.6X);2B;2J"aY":l.B.1u(4R.6F);2B}}},bh:h(4I){c.15=h(){q l.Q.1b.3u};c.2h=h(bg,by,bB){p 25=J.1t("bG"),1J=u;f(l.1p.3o!=u){J.2R.51(l.1p.3o)}l.1p.3o=25;25.1f.bC="bE:bD;1N:6m;2u:6m;E:-6l;4z:-6l;";J.2R.1z(25);1J=25.4J.J;6t(1J,1o.J);1J.3t(""+4I.z.1r+"");1J.4N();25.4J.4A();25.4J.3u();h 6t(6A,6s){p 2S=6s.7M("4K");C(p i=0;i<2S.v;i++){f(2S[i].6r.bk()=="6q"&&/bi\\.12$/.1R(2S[i].2q)){6A.3t("<4K 6z=\\"2c/12\\" 6r=\\"6q\\" 2q=\\""+2S[i].2q+"\\">")}}}}},bj:h(bo){c.15=h(){q l.Q.1b.6h};c.2h=h(bv,bt){p 2b=l.B.4y("","4P",bq,bs,"6n=0"),1J=2b.J;1J.3t(l.Q.1b.6B);1J.4N();2b.4A()}}}},B:{5m:h(6R){q 6R+3z.aN(3z.aa()*ab).2f()},5u:h(4E,4x){p 3l={},1S;C(1S 1X 4E){3l[1S]=4E[1S]}C(1S 1X 4x){3l[1S]=4x[1S]}q 3l},7w:h(4u){6V(4u){2J"U":q U;2J"O":q O}q 4u},4y:h(3e,6M,4D,4C,2I){p x=(6N.1N-4D)/2,y=(6N.2u-4C)/2;2I+=", E="+x+", 4z="+y+", 1N="+4D+", 2u="+4C;2I=2I.D(/^,/,"");p 4Q=1o.9Q(3e,6M,2I);4Q.4A();q 4Q},78:h(1A,29,23){f(1A.6D){1A["e"+29+23]=23;1A[29+23]=h(){1A["e"+29+23](1o.6g)};1A.6D("a6"+29,1A[29+23])}F{1A.a7(29,23,O)}},1u:h(A){1u(l.Q.1b.1u+A)},4c:h(5a,5Y){p 2k=l.1p.59,3j=u;f(2k==u){2k={};C(p 55 1X l.30){p 3g=l.30[55].ac;f(3g==u){1V}C(p i=0;i<3g.v;i++){2k[3g[i]]=55}}l.1p.59=2k}3j=l.30[2k[5a]];f(3j==u&&5Y!=O){l.B.1u(l.Q.1b.5Z+5a)}q 3j},42:h(A,60){p 2T=A.21("\\n");C(p i=0;i<2T.v;i++){2T[i]=60(2T[i])}q 2T.4h("\\n")},6x:h(){p z=J.1t("z"),3h=J.1t("z"),6d=10,i=1;28(i<=aO){f(i%6d===0){z.1r+=i;i+=(i+"").v}F{z.1r+="&ah;";i++}}3h.Y="5F 2E";3h.1z(z);q 3h},6U:h(A){q A.D(/^[ ]*[\\n]+|[\\n]*[ ]*$/g,"")},7d:h(A){p 3i,4V={},5b=R M("^\\\\[(?<54>(.*?))\\\\]$"),69=R M("(?<1c>[\\\\w-]+)"+"\\\\s*:\\\\s*"+"(?<1W>"+"[\\\\w-%#]+|"+"\\\\[.*?\\\\]|"+"\\".*?\\"|"+"\'.*?\'"+")\\\\s*;?","g");28((3i=69.N(A))!=u){p 2g=3i.1W.D(/^[\'"]|[\'"]$/g,"");f(2g!=u&&5b.1R(2g)){p m=5b.N(2g);2g=m.54.v>0?m.54.21(/\\s*,\\s*/):[]}4V[3i.1c]=2g}q 4V},80:h(A,12){f(A==u||A.v==0||A=="\\n"){q A}A=A.D(/"+2i+""})}q A},7f:h(66,67){p 2Z=66.2f();28(2Z.v<67){2Z="0"+2Z}q 2Z},5y:h(){p 3b=J.1t("z"),3f,3a=0,52=J.2R,1j=l.B.5m("5y"),2O="",4W="";3b.1r=2O+"6L\\">"+2O+"26\\">"+2O+"2E\\">"+2O+"5h"+"\\"><1T 1e=\\"7V\\"><1T 1j=\\""+1j+"\\">&1O;"+4W+4W+2Q+2Q+2Q+2Q;52.1z(3b);3f=J.a5(1j);f(/a4/i.1R(61.6b)){p 5Q=1o.9V(3f,u);3a=7l(5Q.9W("1N"))}F{3a=3f.9U}52.51(3b);q 3a},6Q:h(7R,6Y){p 1F="";C(p i=0;i<6Y;i++){1F+=" "}q 7R.D(/\\t/g,1F)},6P:h(2P,41){p 9T=2P.21("\\n"),1F="\\t",5f="";C(p i=0;i<50;i++){5f+=" "}h 7X(3c,18,7Z){q 3c.1M(0,18)+5f.1M(0,7Z)+3c.1M(18+1,3c.v)};2P=l.B.42(2P,h(20){f(20.1h(1F)==-1){q 20}p 18=0;28((18=20.1h(1F))!=-1){p 7U=41-18%41;20=7X(20,18,7U)}q 20});q 2P},3d:h(A){q(l.Q.7P==U)?A.D(/|&1C;br\\s*\\/?&2m;/47,"\\n"):A},3P:h(A){q A.D(/\\s*$/g,"").D(/^\\s*/,"")},2W:h(A){p 1Q=l.B.3d(A).21("\\n"),9X=R 5B(),7S=/^\\s*/,24=9Y;C(p i=0;i<1Q.v&&24>0;i++){p 3V=1Q[i];f(l.B.3P(3V).v==0){1V}p 3S=7S.N(3V);f(3S==u){q A}24=3z.24(3S[0].v,24)}f(24>0){C(p i=0;i<1Q.v;i++){1Q[i]=1Q[i].1M(24)}}q 1Q.4h("\\n")},7B:h(2L,2K){f(2L.H<2K.H){q-1}F{f(2L.H>2K.H){q 1}F{f(2L.v<2K.v){q-1}F{f(2L.v>2K.v){q 1}}}}q 0},2D:h(8d,2G){h 8e(3W,81){q[R l.4i(3W[0],3W.H,81.12)]};p a2=0,3X=u,3y=[],8c=2G.4m?2G.4m:8e;28((3X=2G.3D.N(8d))!=u){3y=3y.2H(8c(3X,2G))}q 3y},6o:h(8f){q 8f.D(l.8a.3e,h(m){q""+m+""})}},1I:h(7c,4l){h 88(4s){p 49=[];C(p i=0;i<4s.v;i++){49.K(4s[i])}q 49};p 3m=4l?[4l]:88(J.7M(l.Q.7I)),7g="1r",2t=u;f(3m.v===0){q}C(p i=0;i<3m.v;i++){p 2F=3m[i],2s=l.B.7d(2F.Y),2Y;2s=l.B.5u(7c,2s);2Y=2s["7J"];f(2Y==u){1V}f(2s["2j-2n"]=="U"){2t=R l.44(2Y)}F{p 4o=l.B.4c(2Y);f(4o){2t=R 4o()}F{1V}}2t.1I(2F[7g],2s);p 2l=2t.z;f(l.Q.7j){2l=J.1t("a0");2l.1W=2t.z.1r;2l.1f.1N="aj";2l.1f.2u="aE"}2F.71.aF(2l,2F)}},aD:h(76){l.B.78(1o,"aC",h(){l.1I(76)})}};l.4i=h(4j,75,12){c.1W=4j;c.H=75;c.v=4j.v;c.12=12};l.4i.Z.2f=h(){q c.1W};l.44=h(4g){p 1H=l.B.4c(4g),4f=R l.30.aA(),aB=u;f(1H==u){q}1H=R 1H();c.4X=4f;f(1H.3K==u){l.B.1u(l.Q.1b.7z+4g);q}4f.4B.K({3D:1H.3K.I,4m:7F});h 39(4d,7G){C(p j=0;j<4d.v;j++){4d[j].H+=7G}};h 7F(14,aH){p 7x=14.I,1E=[],4k=1H.4B,7p=14.H+14.E.v,2X=1H.3K,1n;C(p i=0;i<4k.v;i++){1n=l.B.2D(7x,4k[i]);39(1n,7p);1E=1E.2H(1n)}f(2X.E!=u&&14.E!=u){1n=l.B.2D(14.E,2X.E);39(1n,14.H);1E=1E.2H(1n)}f(2X.17!=u&&14.17!=u){1n=l.B.2D(14.17,2X.17);39(1n,14.H+14[0].aM(14.17));1E=1E.2H(1n)}q 1E}};l.44.Z.1I=h(7u,7t){c.4X.1I(7u,7t);c.z=c.4X.z};l.87=h(){};l.87.Z={T:h(7v,7n){p 5J=c.1L[7v];q l.B.7w(5J==u?7n:5J)},15:h(7y){q J.1t(7y)},7m:h(5G){C(p i=0;i2V.H)&&(5G.H<2V.H+2V.v)){q U}}q O},6v:h(3v,7D){p 2e=[];f(3v!=u){C(p i=0;i<3v.v;i++){2e=2e.2H(l.B.2D(7D,3v[i]))}}2e=2e.aL(l.B.7B);q 2e},6u:h(){C(p i=0;i"+""+82+"."+"<1T 1e=\\"5h\\">"+(1D!=u?""+1D.D(/\\s/g,"&1O;")+"":"")+"<1T 1e=\\"7V\\" 1f=\\"5n-E: "+2w+"5H !aq;\\">"+1s+""+""+""}q 2C},6w:h(5N,5K){p 18=0,3n="",3r=l.B.80;C(p i=0;i<5K.v;i++){p 1y=5K[i];f(1y===u||1y.v===0){1V}3n+=3r(5N.1M(18,1y.H-18),"63")+3r(1y.1W,1y.12);18=1y.H+1y.v}3n+=3r(5N.1M(18),"63");q 3n},1I:h(1g,5R){p am=l.Q,3p=l.1p,z,34;c.1L={};c.z=u;c.26=u;c.I=u;c.2d=u;c.5E={};c.1j=l.B.5m("ar");3p.5j[c.1j]=c;f(1g===u){1g=""}f(3p.3q===u){3p.3q=l.B.5y()}c.1L=l.B.5u(l.5S,5R||{});f(c.T("6J")==U){c.1L.1q=c.1L.5x=O}c.z=z=c.15("37");c.26=c.15("37");c.26.Y="26";z.Y="6L";z.1j=c.1j;f(c.T("5v")){z.Y+=" 5t"}f(c.T("5x")==O){z.Y+=" ax"}z.Y+=" "+c.T("1e-1c");z.1f.av=c.T("2a-1P","");c.5r=1g;c.I=l.B.6U(1g).D(/\\r/g," ");34=c.T("1F-1P");c.I=c.T("6T-6S")==U?l.B.6P(c.I,34):l.B.6Q(c.I,34);c.I=l.B.2W(c.I);f(c.T("1q")){c.2d=c.15("37");c.2d.Y="2d";c.2d.1z(l.1q.15(c));z.1z(c.2d)}f(c.T("5F")){z.1z(l.B.6x())}z.1z(c.26);c.1Y=c.6v(c.4B,c.I);c.6u();1g=c.6w(c.I,c.1Y);1g=c.6k(l.B.3P(1g));f(c.T("6i-6p")){1g=l.B.6o(1g)}c.26.1r=1g},au:h(A){A=A.D(/^\\s+|\\s+$/g,"").D(/\\s+/g,"\\\\b|\\\\b");q"\\\\b"+A+"\\\\b"},at:h(2z){c.3K={E:{3D:2z.E,12:"2n"},17:{3D:2z.17,12:"2n"},I:R M("(?"+2z.E.1i+")"+"(?.*?)"+"(?<17>"+2z.17.1i+")","aw")}}};q l}()}f(!5B.1h){5B.Z.1h=h(5V,3J){3J=3z.as(3J||0,0);C(p i=3J;i|[65]{[^}]+})[\\S\\s]?|\\((?=\\?(?!#|<[\\w$]+>)))+|(\\()(?:\\?(?:(#)[^)]*\\)|<([$\\w]+)>))?|\\\\(?:k<([\\w$]+)>|[65]{([^}]+)})|(\\[\\^?)|([\\S\\s])/g,al:/(?:[^$]+|\\$(?![1-9$&`\']|{[$\\w]+}))+|\\$(?:([1-9]\\d*|[$&`\'])|{([$\\w]+)})/g,3F:/^(?:\\s+|#.*)+/,3R:/^(?:[?*+]|{\\d+(?:,\\d*)?})/,7H:/&&\\[\\^?/g,7q:/]/g},7N=h(5I,7Y,7K){C(p i=7K||0;i<5I.v;i++){f(5I[i]===7Y){q i}}q-1},7k=/()??/.N("")[1]!==3A,3L={};M=h(1d,1U){f(1d 4T V){f(1U!==3A){3G 62("56\'t 58 an 6G ao 5X V ap ay")}q 1d.3I()}p 1U=1U||"",7s=1U.1h("s")>-1,7r=1U.1h("x")>-1,4b=O,3C=[],13=[],11=1G.11,G,3N,3O,3E,3B;11.L=0;28(G=2v.N.2x(11,1d)){f(G[2]){f(!1G.3R.1R(1d.19(11.L))){13.K("(?:)")}}F{f(G[1]){3C.K(G[3]||u);f(G[3]){4b=U}13.K("(")}F{f(G[4]){3E=7N(3C,G[4]);13.K(3E>-1?"\\\\"+(3E+1)+(5z(1d.5O(11.L))?"":"(?:)"):G[0])}F{f(G[5]){13.K(3L.6Z?3L.6Z.7C(G[5],G[0].5O(1)==="P"):G[0])}F{f(G[6]){f(1d.5O(11.L)==="]"){13.K(G[6]==="["?"(?!)":"[\\\\S\\\\s]");11.L++}F{3N=M.6E("&&"+1d.19(G.H),1G.7H,1G.7q,"",{5W:"\\\\"})[0];13.K(G[6]+3N+"]");11.L+=3N.v+1}}F{f(G[7]){f(7s&&G[7]==="."){13.K("[\\\\S\\\\s]")}F{f(7r&&1G.3F.1R(G[7])){3O=2v.N.2x(1G.3F,1d.19(11.L-1))[0].v;f(!1G.3R.1R(1d.19(11.L-1+3O))){13.K("(?:)")}11.L+=3O-1}F{13.K(G[7])}}}F{13.K(G[0])}}}}}}}3B=V(13.4h(""),2v.D.2x(1U,/[aG]+/g,""));3B.1v={1i:1d,2o:4b?3C:u};q 3B};M.ak=h(1c,o){3L[1c]=o};V.Z.N=h(A){p 1a=2v.N.2x(c,A),1c,i,5g;f(1a){f(7k&&1a.v>1){5g=R V("^"+c.1i+"$(?!\\\\s)",c.3U());2v.D.2x(1a[0],5g,h(){C(i=1;i<7b.v-2;i++){f(7b[i]===3A){1a[i]=3A}}})}f(c.1v&&c.1v.2o){C(i=1;i<1a.v;i++){1c=c.1v.2o[i-1];f(1c){1a[1c]=1a[i]}}}f(c.3H&&c.L>(1a.H+1a[0].v)){c.L--}}q 1a}})()}V.Z.3U=h(){q(c.3H?"g":"")+(c.9Z?"i":"")+(c.6W?"m":"")+(c.3F?"x":"")+(c.a1?"y":"")};V.Z.3I=h(7Q){p 3T=R M(c.1i,(7Q||"")+c.3U());f(c.1v){3T.1v={1i:c.1v.1i,2o:c.1v.2o?c.1v.2o.19(0):u}}q 3T};V.Z.2x=h(a3,A){q c.N(A)};V.Z.9S=h(9R,7W){q c.N(7W[0])};M.3Z=h(4r,4Z){p 40="/"+4r+"/"+(4Z||"");q M.3Z[40]||(M.3Z[40]=R M(4r,4Z))};M.3M=h(A){q A.D(/[-[\\]{}()*+?.\\\\^$|,#\\s]/g,"\\\\$&")};M.6E=h(A,E,W,1k,2M){p 2M=2M||{},2U=2M.5W,X=2M.af,1k=1k||"",4O=1k.1h("g")>-1,6y=1k.1h("i")>-1,5U=1k.1h("m")>-1,4H=1k.1h("y")>-1,1k=1k.D(/y/g,""),E=E 4T V?(E.3H?E:E.3I("g")):R M(E,"g"+1k),W=W 4T V?(W.3H?W:W.3I("g")):R M(W,"g"+1k),1K=[],2r=0,1m=0,1l=0,1x=0,27,1Z,1w,1B,3Q,4n;f(2U){f(2U.v>1){3G ae("56\'t 58 ag ad 5X 3M 6I")}f(5U){3G 62("56\'t 58 3M 6I 6G a8 a9 6W aP")}3Q=M.3M(2U);4n=R V("^(?:"+3Q+"[\\\\S\\\\s]|(?:(?!"+E.1i+"|"+W.1i+")[^"+3Q+"])+)+",6y?"i":"")}28(U){E.L=W.L=1l+(2U?(4n.N(A.19(1l))||[""])[0].v:0);1w=E.N(A);1B=W.N(A);f(1w&&1B){f(1w.H<=1B.H){1B=u}F{1w=u}}f(1w||1B){1m=(1w||1B).H;1l=(1w?E:W).L}F{f(!2r){2B}}f(4H&&!2r&&1m>1x){2B}f(1w){f(!2r++){27=1m;1Z=1l}}F{f(1B&&2r){f(!--2r){f(X){f(X[0]&&27>1x){1K.K([X[0],A.19(1x,27),1x,27])}f(X[1]){1K.K([X[1],A.19(27,1Z),27,1Z])}f(X[2]){1K.K([X[2],A.19(1Z,1m),1Z,1m])}f(X[3]){1K.K([X[3],A.19(1m,1l),1m,1l])}}F{1K.K(A.19(1Z,1m))}1x=1l;f(!4O){2B}}}F{E.L=W.L=0;3G b6("bw bp 8l 8u 8A")}}f(1m===1l){1l++}}f(4O&&!4H&&X&&X[0]&&A.v>1x){1K.K([X[0],A.19(1x),1x,A.v])}E.L=W.L=0;q 1K};',62,725,'||||||||||||this|||if||function||||sh||||var|return||||null|length||||div|str|utils|for|replace|left|else|_109|index|code|document|push|lastIndex|XRegExp|exec|false||config|new||getParam|true|RegExp|_121|vN|className|prototype||part|css|_107|_c3|create||right|pos|slice|_111|strings|name|_101|class|style|_ed|indexOf|source|id|_122|_12d|_12c|_ca|window|vars|toolbar|innerHTML|_e0|createElement|alert|_x|_131|_12e|_ec|appendChild|obj|_132|lt|_e5|_c6|tab|lib|_bd|highlight|doc|_12a|params|substr|width|nbsp|size|_97|test|_4b|span|_102|continue|value|in|matches|_130|_91|split|_8|_57|min|_3c|lines|_12f|while|_56|font|wnd|text|bar|_d7|toString|_6e|execute|_75|html|_5b|_b7|gt|script|captureNames|attributes|href|_12b|_b4|_b1|height|_f8|_e1|call|http|_f4|_28|break|_da|getMatches|line|_b3|_a1|concat|_51|case|m2|m1|_123|_5|_80|_88|_81|body|_40|_62|_124|_d4|unindent|_c9|_b5|_7a|brushes|SyntaxHighlighter|_2|_22|_f2|_32|title|DIV|_3|offsetMatches|_7d|_7b|_8e|fixForBlogger|url|_7c|_5e|_65|_6a|_5c|_76|_4a|_af|_e9|printFrame|_f0|spaceWidth|_ea|_dc|write|print|_d5|_db|_25|_a6|Math|undefined|_10d|_106|regex|_10c|extended|throw|global|addFlags|_f6|htmlScript|_100|escape|cc|len|trim|_133|quantifier|_9d|_116|getNativeFlags|_9c|_a2|_a5|viewSource|cache|key|_89|eachLine|_2c|HtmlScript|_18|_30|gi|_2f|_ad|com|_105|findBrush|_c0|expandSource|_be|_bc|join|Match|_b9|_c7|_ab|func|esc|_b6|_19|_1a|_11b|_ac|swf|_4c|_9|_b|_49|popup|top|focus|regexList|_50|_4f|_48|_e|_7|_129|_38|contentWindow|link|_4|gm|close|_126|_blank|win|_35|_24|instanceof|_73|_6b|_82|xmlBrush|_17|_11c||removeChild|_7e|color|values|_5d|can|_f|supply|discoveredBrushes|_59|_6c|_10|_37|_d|_8c|r2|content|toolbarItemWidth|highlighters|toolbarItemHeight|copyToClipboard|guid|margin|_2e|_2d|String|originalCode|_2a|collapsed|merge|collapse|_e2|gutter|measureSpace|isNaN|_2b|Array|_29|clipboardSwf|toolbarCommands|ruler|_d2|px|_fb|_d0|_e7|pre|_27|_e6|charAt|highlighterId|_83|_ee|defaults|_14|_128|_f5|escapeChar|one|_5a|noBrush|_61|navigator|TypeError|plain|match|pP|_78|_79|_36|_6d|alexgorbatchev|userAgent|commandName|_66|clipboardData|executeCommand|event|help|auto|_6|createDisplayLines|500px|0px|scrollbars|processUrls|links|stylesheet|rel|_3f|copyStyles|removeNestedMatches|findMatches|processMatches|createRuler|_127|type|_3e|aboutDialog|createButton|attachEvent|matchRecursive|message|when|2009|character|light|clipboard|syntaxhighlighter|_4e|screen|_a|processSmartTabs|processTabs|_47|tabs|smart|trimFirstAndLastLines|switch|multiline|copyToClipboardConfirmation|_85|unicode|head|parentNode|_16|first|shockwave|_ba|_b8|items|addEvent|flash|_13|arguments|_aa|parseParams|_dd|padNumber|_b0|Times|_12|debug|_ff|parseInt|isMatchNested|_cf|org|_c8|classRight|_104|_103|_cd|_cc|_ce|toBoolean|_c5|_d1|brushNotHtmlScript|www|matchesSortCallback|get|_d6|w3|process|_c1|classLeft|tagName|brush|_fd|serif|getElementsByTagName|_fa|_15|bloggerMode|_115|_84|_99|family|_93|block|args|insertSpaces|_fc|_90|decorate|_a3|_e3|_e4|version|center|xhtml1|Highlighter|toArray|_de|regexLib|DTD|_a7|_a0|defaultAdd|_a8|_1e|object|align|try|resizable|contains|catch|400|_20|_1f|onclick|750|menubar|_21|unbalanced|_1b|item|location|_26|param|delimiters|_1c|sans|1999|xhtml|meta|xmlns|dtd|EN|TR|transitional|equiv|Content|Georgia|New|Roman|About|utf|Type|charset|Transitional|XHTML|is|your|now|The|to|expand|view|copy|Can|find|DOCTYPE|PUBLIC|W3C|option|configured|Brush|wasn|background|fff|Gorbatchev|multiLineCComments|singleLineCComments|Alex|2004|syntax|highlighter|Copyright|singleLinePerlComments|doubleQuotedString|aspScriptTags|scriptScriptTags|typeof|phpScriptTags|multiLineSingleQuotedString|singleQuotedString|multiLineDoubleQuotedString|JavaScript|none|Helvetica|xx|large|Arial|Geneva|000|1em|3em|75em|bottom|target|0099FF|decoration|01|March|4em|296|string|open|_119|apply|_8a|offsetWidth|getComputedStyle|getPropertyValue|_98|1000|ignoreCase|textarea|sticky|_a4|_117|opera|getElementById|on|addEventListener|using|the|random|1000000|aliases|than|SyntaxError|valueNames|more|middot|_clipboard|70em|addPlugin|replaceVar|_ef|flags|constructing|from|important|highlighter_|max|forHtmlScript|getKeywords|fontSize|sgi|nogutter|another|spaces|Xml|_bf|load|all|30em|replaceChild|sx|_c4|highlighted|number|alt|sort|lastIndexOf|round|150|flag|msie|src|embed|classid|movie|_33|_34|ok|error|setData|amp|command|cab|swflash|96b8|11cf|Error|444553540000|codebase|ae6d|download|pub|cabs|clsid|macromedia|d27cdb6e|_39|printSource|shCore|about|toLowerCase|allowScriptAccess|always|printing|_42|data|500||250|_44|application|_43|subject|wmode|_3a|flashVars|transparent|_3b|cssText|absolute|position|menu|IFRAME'.split('|'),0,{})) diff --git a/test_script/scripts/shLegacy.js b/test_script/scripts/shLegacy.js new file mode 100644 index 00000000..66f4892f --- /dev/null +++ b/test_script/scripts/shLegacy.js @@ -0,0 +1,30 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1 y={d:{}};y.d={F:6(S,l,q,k,m,n){6 J(z,Y){1 V=16 15("^"+Y+"\\\\[(?\\\\w+)\\\\]$","14"),x=2;h(1 i=0;i. + */ +// +// Begin anonymous function. This is used to contain local scope variables without polutting global scope. +// +if (!window.SyntaxHighlighter) var SyntaxHighlighter = function() { + +// Shortcut object which will be assigned to the SyntaxHighlighter variable. +// This is a shorthand for local reference in order to avoid long namespace +// references to SyntaxHighlighter.whatever... +var sh = { + defaults : { + /** Additional CSS class names to be added to highlighter elements. */ + 'class-name' : '', + + /** First line number. */ + 'first-line' : 1, + + /** Font size of the SyntaxHighlighter block. */ + 'font-size' : null, + + /** Lines to highlight. */ + 'highlight' : null, + + /** Enables or disables smart tabs. */ + 'smart-tabs' : true, + + /** Gets or sets tab size. */ + 'tab-size' : 4, + + /** Enables or disables ruler. */ + 'ruler' : false, + + /** Enables or disables gutter. */ + 'gutter' : true, + + /** Enables or disables toolbar. */ + 'toolbar' : true, + + /** Forces code view to be collapsed. */ + 'collapse' : false, + + /** Enables or disables automatic links. */ + 'auto-links' : true, + + /** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */ + 'light' : false + }, + + config : { + /** Path to the copy to clipboard SWF file. */ + clipboardSwf : null, + + /** Width of an item in the toolbar. */ + toolbarItemWidth : 16, + + /** Height of an item in the toolbar. */ + toolbarItemHeight : 16, + + /** Blogger mode flag. */ + bloggerMode : false, + + /** Name of the tag that SyntaxHighlighter will automatically look for. */ + tagName : 'pre', + + strings : { + expandSource : 'expand source', + viewSource : 'view source', + copyToClipboard : 'copy to clipboard', + copyToClipboardConfirmation : 'The code is in your clipboard now', + print : 'print', + help : '?', + alert: 'SyntaxHighlighter\n\n', + noBrush : 'Can\'t find brush for: ', + brushNotHtmlScript : 'Brush wasn\'t configured for html-script option: ', + + // this is populated by the build script + aboutDialog : 'About SyntaxHighlighter
SyntaxHighlighter
version 2.0.296 (March 01 2009)
JavaScript code syntax highlighter.
Copyright 2004-2009 Alex Gorbatchev.
' + }, + + /** If true, output will show HTML produces instead. */ + debug : false + }, + + /** Internal 'global' variables. */ + vars : { + discoveredBrushes : null, + spaceWidth : null, + printFrame : null, + highlighters : {} + }, + + /** This object is populated by user included external brush files. */ + brushes : {}, + + /** Common regular expressions. */ + regexLib : { + multiLineCComments : /\/\*[\s\S]*?\*\//gm, + singleLineCComments : /\/\/.*$/gm, + singleLinePerlComments : /#.*$/gm, + doubleQuotedString : /"(?:\.|(\\\")|[^\""\n])*"/g, + singleQuotedString : /'(?:\.|(\\\')|[^\''\n])*'/g, + multiLineDoubleQuotedString : /"(?:\.|(\\\")|[^\""])*"/g, + multiLineSingleQuotedString : /'(?:\.|(\\\')|[^\''])*'/g, + url : /\w+:\/\/[\w-.\/?%&=]*/g, + + /** tags. */ + phpScriptTags : { left: /(<|<)\?=?/g, right: /\?(>|>)/g }, + + /** <%= %> tags. */ + aspScriptTags : { left: /(<|<)%=?/g, right: /%(>|>)/g }, + + /** tags. */ + scriptScriptTags : { left: /(<|<)\s*script.*?(>|>)/gi, right: /(<|<)\/\s*script\s*(>|>)/gi } + }, + + toolbar : { + /** + * Creates new toolbar for a highlighter. + * @param {Highlighter} highlighter Target highlighter. + */ + create : function(highlighter) + { + var div = document.createElement('DIV'), + items = sh.toolbar.items + ; + + div.className = 'toolbar'; + + for (var name in items) + { + var constructor = items[name], + command = new constructor(highlighter), + element = command.create() + ; + + highlighter.toolbarCommands[name] = command; + + if (element == null) + continue; + + if (typeof(element) == 'string') + element = sh.toolbar.createButton(element, highlighter.id, name); + + element.className += 'item ' + name; + div.appendChild(element); + } + + return div; + }, + + /** + * Create a standard anchor button for the toolbar. + * @param {String} label Label text to display. + * @param {String} highlighterId Highlighter ID that this button would belong to. + * @param {String} commandName Command name that would be executed. + * @return {Element} Returns an 'A' element. + */ + createButton : function(label, highlighterId, commandName) + { + var a = document.createElement('a'), + style = a.style, + config = sh.config, + width = config.toolbarItemWidth, + height = config.toolbarItemHeight + ; + + a.href = '#' + commandName; + a.title = label; + a.highlighterId = highlighterId; + a.commandName = commandName; + a.innerHTML = label; + + if (isNaN(width) == false) + style.width = width + 'px'; + + if (isNaN(height) == false) + style.height = height + 'px'; + + a.onclick = function(e) + { + try + { + sh.toolbar.executeCommand( + this, + e || window.event, + this.highlighterId, + this.commandName + ); + } + catch(e) + { + sh.utils.alert(e.message); + } + + return false; + }; + + return a; + }, + + /** + * Executes a toolbar command. + * @param {Element} sender Sender element. + * @param {MouseEvent} event Original mouse event object. + * @param {String} highlighterId Highlighter DIV element ID. + * @param {String} commandName Name of the command to execute. + * @return {Object} Passes out return value from command execution. + */ + executeCommand : function(sender, event, highlighterId, commandName, args) + { + var highlighter = sh.vars.highlighters[highlighterId], + command + ; + + if (highlighter == null || (command = highlighter.toolbarCommands[commandName]) == null) + return null; + + return command.execute(sender, event, args); + }, + + /** Collection of toolbar items. */ + items : { + expandSource : function(highlighter) + { + this.create = function() + { + if (highlighter.getParam('collapse') != true) + return; + + return sh.config.strings.expandSource; + }; + + this.execute = function(sender, event, args) + { + var div = highlighter.div; + + sender.parentNode.removeChild(sender); + div.className = div.className.replace('collapsed', ''); + }; + }, + + /** + * Command to open a new window and display the original unformatted source code inside. + */ + viewSource : function(highlighter) + { + this.create = function() + { + return sh.config.strings.viewSource; + }; + + this.execute = function(sender, event, args) + { + var code = sh.utils.fixForBlogger(highlighter.originalCode).replace(/' + code + ''); + wnd.document.close(); + }; + }, + + /** + * Command to copy the original source code in to the clipboard. + * Uses Flash method if clipboardSwf is configured. + */ + copyToClipboard : function(highlighter) + { + var flashDiv, flashSwf, + highlighterId = highlighter.id + ; + + this.create = function() + { + var config = sh.config; + + // disable functionality if running locally + if (config.clipboardSwf == null) + return null; + + function params(list) + { + var result = ''; + + for (var name in list) + result += ""; + + return result; + }; + + function attributes(list) + { + var result = ''; + + for (var name in list) + result += " " + name + "='" + list[name] + "'"; + + return result; + }; + + var args1 = { + width : config.toolbarItemWidth, + height : config.toolbarItemHeight, + id : highlighterId + '_clipboard', + type : 'application/x-shockwave-flash', + title : sh.config.strings.copyToClipboard + }, + + // these arguments are used in IE's collection + args2 = { + allowScriptAccess : 'always', + wmode : 'transparent', + flashVars : 'highlighterId=' + highlighterId, + menu : 'false' + }, + swf = config.clipboardSwf, + html + ; + + if (/msie/i.test(navigator.userAgent)) + { + html = '' + + params(args2) + + params({ movie : swf }) + + '' + ; + } + else + { + html = '' + ; + } + + flashDiv = document.createElement('div'); + flashDiv.innerHTML = html; + + return flashDiv; + }; + + this.execute = function(sender, event, args) + { + var command = args.command; + + switch (command) + { + case 'get': + var code = sh.utils.unindent( + sh.utils.fixForBlogger(highlighter.originalCode) + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/&/g, '&') + ); + + if(window.clipboardData) + // will fall through to the confirmation because there isn't a break + window.clipboardData.setData('text', code); + else + return sh.utils.unindent(code); + + case 'ok': + sh.utils.alert(sh.config.strings.copyToClipboardConfirmation); + break; + + case 'error': + sh.utils.alert(args.message); + break; + } + }; + }, + + /** Command to print the colored source code. */ + printSource : function(highlighter) + { + this.create = function() + { + return sh.config.strings.print; + }; + + this.execute = function(sender, event, args) + { + var iframe = document.createElement('IFRAME'), + doc = null + ; + + // make sure there is never more than one hidden iframe created by SH + if (sh.vars.printFrame != null) + document.body.removeChild(sh.vars.printFrame); + + sh.vars.printFrame = iframe; + + // this hides the iframe + iframe.style.cssText = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;'; + + document.body.appendChild(iframe); + doc = iframe.contentWindow.document; + + copyStyles(doc, window.document); + doc.write('
' + highlighter.div.innerHTML + '
'); + doc.close(); + + iframe.contentWindow.focus(); + iframe.contentWindow.print(); + + function copyStyles(destDoc, sourceDoc) + { + var links = sourceDoc.getElementsByTagName('link'); + + for(var i = 0; i < links.length; i++) + if(links[i].rel.toLowerCase() == 'stylesheet' && /shCore\.css$/.test(links[i].href)) + destDoc.write(''); + }; + }; + }, + + /** Command to display the about dialog window. */ + about : function(highlighter) + { + this.create = function() + { + return sh.config.strings.help; + }; + + this.execute = function(sender, event) + { + var wnd = sh.utils.popup('', '_blank', 500, 250, 'scrollbars=0'), + doc = wnd.document + ; + + doc.write(sh.config.strings.aboutDialog); + doc.close(); + wnd.focus(); + }; + } + } + }, + + utils : { + guid : function(prefix) + { + return prefix + Math.round(Math.random() * 1000000).toString(); + }, + + /** + * Merges two objects. Values from obj2 override values in obj1. + * Function is NOT recursive and works only for one dimensional objects. + * @param {Object} obj1 First object. + * @param {Object} obj2 Second object. + * @return {Object} Returns combination of both objects. + */ + merge: function(obj1, obj2) + { + var result = {}, name; + + for (name in obj1) + result[name] = obj1[name]; + + for (name in obj2) + result[name] = obj2[name]; + + return result; + }, + + /** + * Attempts to convert string to boolean. + * @param {String} value Input string. + * @return {Boolean} Returns true if input was "true", false if input was "false" and value otherwise. + */ + toBoolean: function(value) + { + switch (value) + { + case "true": + return true; + + case "false": + return false; + } + + return value; + }, + + /** + * Opens up a centered popup window. + * @param {String} url URL to open in the window. + * @param {String} name Popup name. + * @param {int} width Popup width. + * @param {int} height Popup height. + * @param {String} options window.open() options. + * @return {Window} Returns window instance. + */ + popup: function(url, name, width, height, options) + { + var x = (screen.width - width) / 2, + y = (screen.height - height) / 2 + ; + + options += ', left=' + x + + ', top=' + y + + ', width=' + width + + ', height=' + height + ; + options = options.replace(/^,/, ''); + + var win = window.open(url, name, options); + win.focus(); + return win; + }, + + /** + * Adds event handler to the target object. + * @param {Object} obj Target object. + * @param {String} type Name of the event. + * @param {Function} func Handling function. + */ + addEvent: function(obj, type, func) + { + if (obj.attachEvent) + { + obj['e' + type + func] = func; + obj[type + func] = function() + { + obj['e' + type + func](window.event); + } + obj.attachEvent('on' + type, obj[type + func]); + } + else + { + obj.addEventListener(type, func, false); + } + }, + + /** + * Displays an alert. + * @param {String} str String to display. + */ + alert: function(str) + { + alert(sh.config.strings.alert + str) + }, + + /** + * Finds a brush by its alias. + * + * @param {String} alias Brush alias. + * @param {Boolean} alert Suppresses the alert if false. + * @return {Brush} Returns bursh constructor if found, null otherwise. + */ + findBrush: function(alias, alert) + { + var brushes = sh.vars.discoveredBrushes, + result = null + ; + + if (brushes == null) + { + brushes = {}; + + // Find all brushes + for (var brush in sh.brushes) + { + var aliases = sh.brushes[brush].aliases; + + if (aliases == null) + continue; + + for (var i = 0; i < aliases.length; i++) + brushes[aliases[i]] = brush; + } + + sh.vars.discoveredBrushes = brushes; + } + + result = sh.brushes[brushes[alias]]; + + if (result == null && alert != false) + sh.utils.alert(sh.config.strings.noBrush + alias); + + return result; + }, + + /** + * Executes a callback on each line and replaces each line with result from the callback. + * @param {Object} str Input string. + * @param {Object} callback Callback function taking one string argument and returning a string. + */ + eachLine: function(str, callback) + { + var lines = str.split('\n'); + + for (var i = 0; i < lines.length; i++) + lines[i] = callback(lines[i]); + + return lines.join('\n'); + }, + + /** + * Creates rules looking div. + */ + createRuler: function() + { + var div = document.createElement('div'), + ruler = document.createElement('div'), + showEvery = 10, + i = 1 + ; + + while (i <= 150) + { + if (i % showEvery === 0) + { + div.innerHTML += i; + i += (i + '').length; + } + else + { + div.innerHTML += '·'; + i++; + } + } + + ruler.className = 'ruler line'; + ruler.appendChild(div); + + return ruler; + }, + + /** + * This is a special trim which only removes first and last empty lines + * and doesn't affect valid leading space on the first line. + * + * @param {String} str Input string + * @return {String} Returns string without empty first and last lines. + */ + trimFirstAndLastLines: function(str) + { + return str.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g, ''); + }, + + /** + * Parses key/value pairs into hash object. + * + * Understands the following formats: + * - name: word; + * - name: [word, word]; + * - name: "string"; + * - name: 'string'; + * + * For example: + * name1: value; name2: [value, value]; name3: 'value' + * + * @param {String} str Input string. + * @return {Object} Returns deserialized object. + */ + parseParams: function(str) + { + var match, + result = {}, + arrayRegex = new XRegExp("^\\[(?(.*?))\\]$"), + regex = new XRegExp( + "(?[\\w-]+)" + + "\\s*:\\s*" + + "(?" + + "[\\w-%#]+|" + // word + "\\[.*?\\]|" + // [] array + '".*?"|' + // "" string + "'.*?'" + // '' string + ")\\s*;?", + "g" + ) + ; + + while ((match = regex.exec(str)) != null) + { + var value = match.value + .replace(/^['"]|['"]$/g, '') // strip quotes from end of strings + ; + + // try to parse array value + if (value != null && arrayRegex.test(value)) + { + var m = arrayRegex.exec(value); + value = m.values.length > 0 ? m.values.split(/\s*,\s*/) : []; + } + + result[match.name] = value; + } + + return result; + }, + + /** + * Wraps each line of the string into tag with given style applied to it. + * + * @param {String} str Input string. + * @param {String} css Style name to apply to the string. + * @return {String} Returns input string with each line surrounded by tag. + */ + decorate: function(str, css) + { + if (str == null || str.length == 0 || str == '\n') + return str; + + str = str.replace(/... to them so that + // leading spaces aren't included. + if (css != null) + str = sh.utils.eachLine(str, function(line) + { + if (line.length == 0) + return ''; + + var spaces = ''; + + line = line.replace(/^( | )+/, function(s) + { + spaces = s; + return ''; + }); + + if (line.length == 0) + return spaces; + + return spaces + '' + line + ''; + }); + + return str; + }, + + /** + * Pads number with zeros until it's length is the same as given length. + * + * @param {Number} number Number to pad. + * @param {Number} length Max string length with. + * @return {String} Returns a string padded with proper amount of '0'. + */ + padNumber : function(number, length) + { + var result = number.toString(); + + while (result.length < length) + result = '0' + result; + + return result; + }, + + /** + * Measures width of a single space character. + * @return {Number} Returns width of a single space character. + */ + measureSpace : function() + { + var container = document.createElement('div'), + span, + result = 0, + body = document.body, + id = sh.utils.guid('measureSpace'), + + // variable names will be compressed, so it's better than a plain string + divOpen = '
' + + divOpen + 'lines">' + + divOpen + 'line">' + + divOpen + 'content' + + '"> ' + closeSpan + closeSpan + + closeDiv + + closeDiv + + closeDiv + + closeDiv + ; + + body.appendChild(container); + span = document.getElementById(id); + + if (/opera/i.test(navigator.userAgent)) + { + var style = window.getComputedStyle(span, null); + result = parseInt(style.getPropertyValue("width")); + } + else + { + result = span.offsetWidth; + } + + body.removeChild(container); + + return result; + }, + + /** + * Replaces tabs with spaces. + * + * @param {String} code Source code. + * @param {Number} tabSize Size of the tab. + * @return {String} Returns code with all tabs replaces by spaces. + */ + processTabs : function(code, tabSize) + { + var tab = ''; + + for (var i = 0; i < tabSize; i++) + tab += ' '; + + return code.replace(/\t/g, tab); + }, + + /** + * Replaces tabs with smart spaces. + * + * @param {String} code Code to fix the tabs in. + * @param {Number} tabSize Number of spaces in a column. + * @return {String} Returns code with all tabs replaces with roper amount of spaces. + */ + processSmartTabs : function(code, tabSize) + { + var lines = code.split('\n'), + tab = '\t', + spaces = '' + ; + + // Create a string with 1000 spaces to copy spaces from... + // It's assumed that there would be no indentation longer than that. + for (var i = 0; i < 50; i++) + spaces += ' '; // 20 spaces * 50 + + // This function inserts specified amount of spaces in the string + // where a tab is while removing that given tab. + function insertSpaces(line, pos, count) + { + return line.substr(0, pos) + + spaces.substr(0, count) + + line.substr(pos + 1, line.length) // pos + 1 will get rid of the tab + ; + }; + + // Go through all the lines and do the 'smart tabs' magic. + code = sh.utils.eachLine(code, function(line) + { + if (line.indexOf(tab) == -1) + return line; + + var pos = 0; + + while ((pos = line.indexOf(tab)) != -1) + { + // This is pretty much all there is to the 'smart tabs' logic. + // Based on the position within the line and size of a tab, + // calculate the amount of spaces we need to insert. + var spaces = tabSize - pos % tabSize; + line = insertSpaces(line, pos, spaces); + } + + return line; + }); + + return code; + }, + + fixForBlogger : function(str) + { + return (sh.config.bloggerMode == true) ? str.replace(/|<br\s*\/?>/gi, '\n') : str; + }, + + /** + * Removes all white space at the begining and end of a string. + * + * @param {String} str String to trim. + * @return {String} Returns string without leading and following white space characters. + */ + trim: function(str) + { + return str.replace(/\s*$/g, '').replace(/^\s*/, ''); + }, + + /** + * Unindents a block of text by the lowest common indent amount. + * @param {String} str Text to unindent. + * @return {String} Returns unindented text block. + */ + unindent: function(str) + { + var lines = sh.utils.fixForBlogger(str).split('\n'), + indents = new Array(), + regex = /^\s*/, + min = 1000 + ; + + // go through every line and check for common number of indents + for (var i = 0; i < lines.length && min > 0; i++) + { + var line = lines[i]; + + if (sh.utils.trim(line).length == 0) + continue; + + var matches = regex.exec(line); + + // In the event that just one line doesn't have leading white space + // we can't unindent anything, so bail completely. + if (matches == null) + return str; + + min = Math.min(matches[0].length, min); + } + + // trim minimum common number of white space from the begining of every line + if (min > 0) + for (var i = 0; i < lines.length; i++) + lines[i] = lines[i].substr(min); + + return lines.join('\n'); + }, + + /** + * Callback method for Array.sort() which sorts matches by + * index position and then by length. + * + * @param {Match} m1 Left object. + * @param {Match} m2 Right object. + * @return {Number} Returns -1, 0 or -1 as a comparison result. + */ + matchesSortCallback: function(m1, m2) + { + // sort matches by index first + if(m1.index < m2.index) + return -1; + else if(m1.index > m2.index) + return 1; + else + { + // if index is the same, sort by length + if(m1.length < m2.length) + return -1; + else if(m1.length > m2.length) + return 1; + } + + return 0; + }, + + /** + * Executes given regular expression on provided code and returns all + * matches that are found. + * + * @param {String} code Code to execute regular expression on. + * @param {Object} regex Regular expression item info from regexList collection. + * @return {Array} Returns a list of Match objects. + */ + getMatches: function(code, regexInfo) + { + function defaultAdd(match, regexInfo) + { + return [new sh.Match(match[0], match.index, regexInfo.css)]; + }; + + var index = 0, + match = null, + result = [], + func = regexInfo.func ? regexInfo.func : defaultAdd + ; + + while((match = regexInfo.regex.exec(code)) != null) + result = result.concat(func(match, regexInfo)); + + return result; + }, + + processUrls: function(code) + { + return code.replace(sh.regexLib.url, function(m) + { + return '' + m + ''; + }); + } + }, // end of utils + + /** + * Shorthand to highlight all elements on the page that are marked as + * SyntaxHighlighter source code. + * + * @param {Object} globalParams Optional parameters which override element's + * parameters. Only used if element is specified. + * + * @param {Object} element Optional element to highlight. If none is + * provided, all elements in the current document + * are highlighted. + */ + highlight : function(globalParams, element) + { + function toArray(source) + { + var result = []; + + for (var i = 0; i < source.length; i++) + result.push(source[i]); + + return result; + }; + + var elements = element ? [element] : toArray(document.getElementsByTagName(sh.config.tagName)), + propertyName = 'innerHTML', + highlighter = null + ; + + if (elements.length === 0) + return; + + for (var i = 0; i < elements.length; i++) + { + var target = elements[i], + params = sh.utils.parseParams(target.className), + brushName + ; + + // local params take precedence over globals + params = sh.utils.merge(globalParams, params); + brushName = params['brush']; + + if (brushName == null) + continue; + + // Instantiate a brush + if (params['html-script'] == 'true') + { + highlighter = new sh.HtmlScript(brushName); + } + else + { + var brush = sh.utils.findBrush(brushName); + + if (brush) + highlighter = new brush(); + else + continue; + } + + highlighter.highlight(target[propertyName], params); + + var result = highlighter.div; + + if (sh.config.debug) + { + result = document.createElement('textarea'); + result.value = highlighter.div.innerHTML; + result.style.width = '70em'; + result.style.height = '30em'; + } + + target.parentNode.replaceChild(result, target); + } + }, + + /** + * Main entry point for the SyntaxHighlighter. + * @param {Object} params Optional params to apply to all highlighted elements. + */ + all : function(params) + { + sh.utils.addEvent( + window, + 'load', + function() { sh.highlight(params); } + ); + } +}; // end of sh + +/** Match object */ +sh.Match = function(value, index, css) +{ + this.value = value; + this.index = index; + this.length = value.length; + this.css = css; +}; + +sh.Match.prototype.toString = function() +{ + return this.value; +}; + +/** + * Simulates HTML code with a scripting language embedded. + * + * @param {String} scriptBrushName Brush name of the scripting language. + */ +sh.HtmlScript = function(scriptBrushName) +{ + var scriptBrush = sh.utils.findBrush(scriptBrushName), + xmlBrush = new sh.brushes.Xml(), + bracketsRegex = null + ; + + if (scriptBrush == null) + return; + + scriptBrush = new scriptBrush(); + this.xmlBrush = xmlBrush; + + if (scriptBrush.htmlScript == null) + { + sh.utils.alert(sh.config.strings.brushNotHtmlScript + scriptBrushName); + return; + } + + xmlBrush.regexList.push( + { regex: scriptBrush.htmlScript.code, func: process } + ); + + function offsetMatches(matches, offset) + { + for (var j = 0; j < matches.length; j++) + matches[j].index += offset; + } + + function process(match, info) + { + var code = match.code, + matches = [], + regexList = scriptBrush.regexList, + offset = match.index + match.left.length, + htmlScript = scriptBrush.htmlScript, + result + ; + + for (var i = 0; i < regexList.length; i++) + { + result = sh.utils.getMatches(code, regexList[i]); + offsetMatches(result, offset); + matches = matches.concat(result); + } + + if (htmlScript.left != null && match.left != null) + { + result = sh.utils.getMatches(match.left, htmlScript.left); + offsetMatches(result, match.index); + matches = matches.concat(result); + } + + if (htmlScript.right != null && match.right != null) + { + result = sh.utils.getMatches(match.right, htmlScript.right); + offsetMatches(result, match.index + match[0].lastIndexOf(match.right)); + matches = matches.concat(result); + } + + return matches; + } +}; + +sh.HtmlScript.prototype.highlight = function(code, params) +{ + this.xmlBrush.highlight(code, params); + this.div = this.xmlBrush.div; +} + +/** + * Main Highlither class. + * @constructor + */ +sh.Highlighter = function() +{ +}; + +sh.Highlighter.prototype = { + /** + * Returns value of the parameter passed to the highlighter. + * @param {String} name Name of the parameter. + * @param {Object} defaultValue Default value. + * @return {Object} Returns found value or default value otherwise. + */ + getParam : function(name, defaultValue) + { + var result = this.params[name]; + return sh.utils.toBoolean(result == null ? defaultValue : result); + }, + + /** + * Shortcut to document.createElement(). + * @param {String} name Name of the element to create (DIV, A, etc). + * @return {HTMLElement} Returns new HTML element. + */ + create: function(name) + { + return document.createElement(name); + }, + + /** + * Checks if one match is inside another. + * @param {Match} match Match object to check. + * @return {Boolean} Returns true if given match was inside another, false otherwise. + */ + isMatchNested: function(match) + { + for (var i = 0; i < this.matches.length; i++) + { + var item = this.matches[i]; + + if (item === null) + continue; + + if ((match.index > item.index) && (match.index < item.index + item.length)) + return true; + } + + return false; + }, + + /** + * Applies all regular expression to the code and stores all found + * matches in the `this.matches` array. + * @param {Array} regexList List of regular expressions. + * @param {String} code Source code. + * @return {Array} Returns list of matches. + */ + findMatches: function(regexList, code) + { + var result = []; + + if (regexList != null) + for (var i = 0; i < regexList.length; i++) + result = result.concat(sh.utils.getMatches(code, regexList[i])); + + // sort the matches + result = result.sort(sh.utils.matchesSortCallback); + + return result; + }, + + /** + * Checks to see if any of the matches are inside of other matches. + * This process would get rid of highligted strings inside comments, + * keywords inside strings and so on. + */ + removeNestedMatches: function() + { + for (var i = 0; i < this.matches.length; i++) + if (this.isMatchNested(this.matches[i])) + this.matches[i] = null; + }, + + /** + * Splits block of text into individual DIV lines. + * @param {String} code Code to highlight. + * @return {String} Returns highlighted code in HTML form. + */ + createDisplayLines : function(code) + { + var lines = code.split(/\n/g), + firstLine = parseInt(this.getParam('first-line')), + padLength = (firstLine + lines.length).toString().length, + highlightedLines = this.getParam('highlight', []) + ; + + code = ''; + + for (var i = 0; i < lines.length; i++) + { + var line = lines[i], + indent = /^( |\s)+/.exec(line), + lineClass = 'line alt' + (i % 2 == 0 ? 1 : 2), + lineNumber = sh.utils.padNumber(firstLine + i, padLength), + highlighted = highlightedLines.indexOf((firstLine + i).toString()) != -1, + spaces = null + ; + + if (indent != null) + { + spaces = indent[0].toString(); + line = line.substr(spaces.length); + spaces = spaces.replace(/ /g, ' '); + indent = sh.vars.spaceWidth * spaces.length; + } + else + { + indent = 0; + } + + line = sh.utils.trim(line); + + if (line.length == 0) + line = ' '; + + if (highlighted) + lineClass += ' highlighted'; + + code += + '
' + + '' + lineNumber + '.' + + '' + + (spaces != null ? '' + spaces.replace(/\s/g, ' ') + '' : '') + + '' + line + '' + + '' + + '
' + ; + } + + return code; + }, + + /** + * Finds all matches in the source code. + * @param {String} code Source code to process matches in. + * @param {Array} matches Discovered regex matches. + * @return {String} Returns formatted HTML with processed mathes. + */ + processMatches: function(code, matches) + { + var pos = 0, + result = '', + decorate = sh.utils.decorate // make an alias to save some bytes + ; + + // Finally, go through the final list of matches and pull the all + // together adding everything in between that isn't a match. + for (var i = 0; i < matches.length; i++) + { + var match = matches[i]; + + if (match === null || match.length === 0) + continue; + + result += decorate(code.substr(pos, match.index - pos), 'plain') + + decorate(match.value, match.css) + ; + + pos = match.index + match.length; + } + + // don't forget to add whatever's remaining in the string + result += decorate(code.substr(pos), 'plain'); + + return result; + }, + + /** + * Highlights the code and returns complete HTML. + * @param {String} code Code to highlight. + * @param {Object} params Parameters object. + */ + highlight: function(code, params) + { + var conf = sh.config, + vars = sh.vars, + div, + tabSize + ; + + this.params = {}; + this.div = null; + this.lines = null; + this.code = null; + this.bar = null; + this.toolbarCommands = {}; + this.id = sh.utils.guid('highlighter_'); + + // register this instance in the highlighters list + vars.highlighters[this.id] = this; + + if (code === null) + code = ''; + + // Measure width of a single space. + if (vars.spaceWidth === null) + vars.spaceWidth = sh.utils.measureSpace(); + + // local params take precedence over defaults + this.params = sh.utils.merge(sh.defaults, params || {}); + + // process light mode + if (this.getParam('light') == true) + this.params.toolbar = this.params.gutter = false; + + this.div = div = this.create('DIV'); + this.lines = this.create('DIV'); + this.lines.className = 'lines'; + + div.className = 'syntaxhighlighter'; + div.id = this.id; + + if (this.getParam('collapse')) + div.className += ' collapsed'; + + if (this.getParam('gutter') == false) + div.className += ' nogutter'; + + div.className += ' ' + this.getParam('class-name'); + div.style.fontSize = this.getParam('font-size', ''); // IE7 can't take null + + this.originalCode = code; + this.code = sh.utils.trimFirstAndLastLines(code) + .replace(/\r/g, ' ') // IE lets these buggers through + ; + + tabSize = this.getParam('tab-size'); + + // replace tabs with spaces + this.code = this.getParam('smart-tabs') == true + ? sh.utils.processSmartTabs(this.code, tabSize) + : sh.utils.processTabs(this.code, tabSize) + ; + + this.code = sh.utils.unindent(this.code); + + // add controls toolbar + if (this.getParam('toolbar')) + { + this.bar = this.create('DIV'); + this.bar.className = 'bar'; + this.bar.appendChild(sh.toolbar.create(this)); + div.appendChild(this.bar); + } + + // add columns ruler + if (this.getParam('ruler')) + div.appendChild(sh.utils.createRuler()); + + div.appendChild(this.lines); + + this.matches = this.findMatches(this.regexList, this.code); + this.removeNestedMatches(); + + code = this.processMatches(this.code, this.matches); + + // finally, split all lines so that they wrap well + code = this.createDisplayLines(sh.utils.trim(code)); + + // finally, process the links + if (this.getParam('auto-links')) + code = sh.utils.processUrls(code); + + this.lines.innerHTML = code; + }, + + /** + * Converts space separated list of keywords into a regular expression string. + * @param {String} str Space separated keywords. + * @return {String} Returns regular expression string. + */ + getKeywords: function(str) + { + str = str + .replace(/^\s+|\s+$/g, '') + .replace(/\s+/g, '\\b|\\b') + ; + + return '\\b' + str + '\\b'; + }, + + /** + * Makes a brush compatible with the `html-script` functionality. + * @param {Object} regexGroup Object containing `left` and `right` regular expressions. + */ + forHtmlScript: function(regexGroup) + { + this.htmlScript = { + left : { regex: regexGroup.left, css: 'script' }, + right : { regex: regexGroup.right, css: 'script' }, + code : new XRegExp( + "(?" + regexGroup.left.source + ")" + + "(?.*?)" + + "(?" + regexGroup.right.source + ")", + "sgi" + ) + }; + } +}; // end of Highlighter + +return sh; +}(); // end of anonymous function + +if (!Array.indexOf) + /** + * Finds an index of element in the array. + * @ignore + * @param {Object} searchElement + * @param {Number} fromIndex + * @return {Number} Returns index of element if found; -1 otherwise. + */ + Array.prototype.indexOf = function (searchElement, fromIndex) + { + fromIndex = Math.max(fromIndex || 0, 0); + + for (var i = fromIndex; i < this.length; i++) + if(this[i] == searchElement) + return i; + + return -1; + }; + +/** + * XRegExp 0.6.1 + * (c) 2007-2008 Steven Levithan + * + * MIT License + * + * provides an augmented, cross-browser implementation of regular expressions + * including support for additional modifiers and syntax. several convenience + * methods and a recursive-construct parser are also included. + */ + +// prevent running twice, which would break references to native globals +if (!window.XRegExp) { +// anonymous function to avoid global variables +(function () { +// copy various native globals for reference. can't use the name ``native`` +// because it's a reserved JavaScript keyword. +var real = { + exec: RegExp.prototype.exec, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split + }, + /* regex syntax parsing with support for all the necessary cross- + browser and context issues (escapings, character classes, etc.) */ + lib = { + part: /(?:[^\\([#\s.]+|\\(?!k<[\w$]+>|[pP]{[^}]+})[\S\s]?|\((?=\?(?!#|<[\w$]+>)))+|(\()(?:\?(?:(#)[^)]*\)|<([$\w]+)>))?|\\(?:k<([\w$]+)>|[pP]{([^}]+)})|(\[\^?)|([\S\s])/g, + replaceVar: /(?:[^$]+|\$(?![1-9$&`']|{[$\w]+}))+|\$(?:([1-9]\d*|[$&`'])|{([$\w]+)})/g, + extended: /^(?:\s+|#.*)+/, + quantifier: /^(?:[?*+]|{\d+(?:,\d*)?})/, + classLeft: /&&\[\^?/g, + classRight: /]/g + }, + indexOf = function (array, item, from) { + for (var i = from || 0; i < array.length; i++) + if (array[i] === item) return i; + return -1; + }, + brokenExecUndef = /()??/.exec("")[1] !== undefined, + plugins = {}; + +/** + * Accepts a pattern and flags, returns a new, extended RegExp object. + * differs from a native regex in that additional flags and syntax are + * supported and browser inconsistencies are ameliorated. + * @ignore + */ +XRegExp = function (pattern, flags) { + if (pattern instanceof RegExp) { + if (flags !== undefined) + throw TypeError("can't supply flags when constructing one RegExp from another"); + return pattern.addFlags(); // new copy + } + + var flags = flags || "", + singleline = flags.indexOf("s") > -1, + extended = flags.indexOf("x") > -1, + hasNamedCapture = false, + captureNames = [], + output = [], + part = lib.part, + match, cc, len, index, regex; + + part.lastIndex = 0; // in case the last XRegExp compilation threw an error (unbalanced character class) + + while (match = real.exec.call(part, pattern)) { + // comment pattern. this check must come before the capturing group check, + // because both match[1] and match[2] will be non-empty. + if (match[2]) { + // keep tokens separated unless the following token is a quantifier + if (!lib.quantifier.test(pattern.slice(part.lastIndex))) + output.push("(?:)"); + // capturing group + } else if (match[1]) { + captureNames.push(match[3] || null); + if (match[3]) + hasNamedCapture = true; + output.push("("); + // named backreference + } else if (match[4]) { + index = indexOf(captureNames, match[4]); + // keep backreferences separate from subsequent literal numbers + // preserve backreferences to named groups that are undefined at this point as literal strings + output.push(index > -1 ? + "\\" + (index + 1) + (isNaN(pattern.charAt(part.lastIndex)) ? "" : "(?:)") : + match[0] + ); + // unicode element (requires plugin) + } else if (match[5]) { + output.push(plugins.unicode ? + plugins.unicode.get(match[5], match[0].charAt(1) === "P") : + match[0] + ); + // character class opening delimiter ("[" or "[^") + // (non-native unicode elements are not supported within character classes) + } else if (match[6]) { + if (pattern.charAt(part.lastIndex) === "]") { + // for cross-browser compatibility with ECMA-262 v3 behavior, + // convert [] to (?!) and [^] to [\S\s]. + output.push(match[6] === "[" ? "(?!)" : "[\\S\\s]"); + part.lastIndex++; + } else { + // parse the character class with support for inner escapes and + // ES4's infinitely nesting intersection syntax ([&&[^&&[]]]). + cc = XRegExp.matchRecursive("&&" + pattern.slice(match.index), lib.classLeft, lib.classRight, "", {escapeChar: "\\"})[0]; + output.push(match[6] + cc + "]"); + part.lastIndex += cc.length + 1; + } + // dot ("."), pound sign ("#"), or whitespace character + } else if (match[7]) { + if (singleline && match[7] === ".") { + output.push("[\\S\\s]"); + } else if (extended && lib.extended.test(match[7])) { + len = real.exec.call(lib.extended, pattern.slice(part.lastIndex - 1))[0].length; + // keep tokens separated unless the following token is a quantifier + if (!lib.quantifier.test(pattern.slice(part.lastIndex - 1 + len))) + output.push("(?:)"); + part.lastIndex += len - 1; + } else { + output.push(match[7]); + } + } else { + output.push(match[0]); + } + } + + regex = RegExp(output.join(""), real.replace.call(flags, /[sx]+/g, "")); + regex._x = { + source: pattern, + captureNames: hasNamedCapture ? captureNames : null + }; + return regex; +}; + +/** + * Barebones plugin support for now (intentionally undocumented) + * @ignore + * @param {Object} name + * @param {Object} o + */ +XRegExp.addPlugin = function (name, o) { + plugins[name] = o; +}; + +/** + * Adds named capture support, with values returned as ``result.name``. + * + * Also fixes two cross-browser issues, following the ECMA-262 v3 spec: + * - captured values for non-participating capturing groups should be returned + * as ``undefined``, rather than the empty string. + * - the regex's ``lastIndex`` should not be incremented after zero-length + * matches. + * @ignore + */ +RegExp.prototype.exec = function (str) { + var match = real.exec.call(this, str), + name, i, r2; + if (match) { + // fix browsers whose exec methods don't consistently return + // undefined for non-participating capturing groups + if (brokenExecUndef && match.length > 1) { + // r2 doesn't need /g or /y, but they shouldn't hurt + r2 = new RegExp("^" + this.source + "$(?!\\s)", this.getNativeFlags()); + real.replace.call(match[0], r2, function () { + for (i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) match[i] = undefined; + } + }); + } + // attach named capture properties + if (this._x && this._x.captureNames) { + for (i = 1; i < match.length; i++) { + name = this._x.captureNames[i - 1]; + if (name) match[name] = match[i]; + } + } + // fix browsers that increment lastIndex after zero-length matches + if (this.global && this.lastIndex > (match.index + match[0].length)) + this.lastIndex--; + } + return match; +}; +})(); // end anonymous function +} // end if(!window.XRegExp) + +/** + * intentionally undocumented + * @ignore + */ +RegExp.prototype.getNativeFlags = function () { + return (this.global ? "g" : "") + + (this.ignoreCase ? "i" : "") + + (this.multiline ? "m" : "") + + (this.extended ? "x" : "") + + (this.sticky ? "y" : ""); +}; + +/** + * Accepts flags; returns a new XRegExp object generated by recompiling + * the regex with the additional flags (may include non-native flags). + * The original regex object is not altered. + * @ignore + */ +RegExp.prototype.addFlags = function (flags) { + var regex = new XRegExp(this.source, (flags || "") + this.getNativeFlags()); + if (this._x) { + regex._x = { + source: this._x.source, + captureNames: this._x.captureNames ? this._x.captureNames.slice(0) : null + }; + } + return regex; +}; + +/** + * Accepts a context object and string; returns the result of calling + * ``exec`` with the provided string. the context is ignored but is + * accepted for congruity with ``Function.prototype.call``. + * @ignore + */ +RegExp.prototype.call = function (context, str) { + return this.exec(str); +}; + +/** + * Accepts a context object and arguments array; returns the result of + * calling ``exec`` with the first value in the arguments array. the context + * is ignored but is accepted for congruity with ``Function.prototype.apply``. + * @ignore + */ +RegExp.prototype.apply = function (context, args) { + return this.exec(args[0]); +}; + +/** + * Accepts a pattern and flags; returns an XRegExp object. if the pattern + * and flag combination has previously been cached, the cached copy is + * returned, otherwise the new object is cached. + * @ignore + */ +XRegExp.cache = function (pattern, flags) { + var key = "/" + pattern + "/" + (flags || ""); + return XRegExp.cache[key] || (XRegExp.cache[key] = new XRegExp(pattern, flags)); +}; + +/** + * Accepts a string; returns the string with regex metacharacters escaped. + * the returned string can safely be used within a regex to match a literal + * string. escaped characters are [, ], {, }, (, ), -, *, +, ?, ., \, ^, $, + * |, #, [comma], and whitespace. + * @ignore + */ +XRegExp.escape = function (str) { + return str.replace(/[-[\]{}()*+?.\\^$|,#\s]/g, "\\$&"); +}; + +/** + * Accepts a string to search, left and right delimiters as regex pattern + * strings, optional regex flags (may include non-native s, x, and y flags), + * and an options object which allows setting an escape character and changing + * the return format from an array of matches to a two-dimensional array of + * string parts with extended position data. returns an array of matches + * (optionally with extended data), allowing nested instances of left and right + * delimiters. use the g flag to return all matches, otherwise only the first + * is returned. if delimiters are unbalanced within the subject data, an error + * is thrown. + * + * This function admittedly pushes the boundaries of what can be accomplished + * sensibly without a "real" parser. however, by doing so it provides flexible + * and powerful recursive parsing capabilities with minimal code weight. + * + * Warning: the ``escapeChar`` option is considered experimental and might be + * changed or removed in future versions of XRegExp. + * + * unsupported features: + * - backreferences within delimiter patterns when using ``escapeChar``. + * - although providing delimiters as regex objects adds the minor feature of + * independent delimiter flags, it introduces other limitations and is only + * intended to be done by the ``XRegExp`` constructor (which can't call + * itself while building a regex). + * + * @ignore + */ +XRegExp.matchRecursive = function (str, left, right, flags, options) { + var options = options || {}, + escapeChar = options.escapeChar, + vN = options.valueNames, + flags = flags || "", + global = flags.indexOf("g") > -1, + ignoreCase = flags.indexOf("i") > -1, + multiline = flags.indexOf("m") > -1, + sticky = flags.indexOf("y") > -1, + /* sticky mode has its own handling in this function, which means you + can use flag "y" even in browsers which don't support it natively */ + flags = flags.replace(/y/g, ""), + left = left instanceof RegExp ? (left.global ? left : left.addFlags("g")) : new XRegExp(left, "g" + flags), + right = right instanceof RegExp ? (right.global ? right : right.addFlags("g")) : new XRegExp(right, "g" + flags), + output = [], + openTokens = 0, + delimStart = 0, + delimEnd = 0, + lastOuterEnd = 0, + outerStart, innerStart, leftMatch, rightMatch, escaped, esc; + + if (escapeChar) { + if (escapeChar.length > 1) throw SyntaxError("can't supply more than one escape character"); + if (multiline) throw TypeError("can't supply escape character when using the multiline flag"); + escaped = XRegExp.escape(escapeChar); + /* Escape pattern modifiers: + /g - not needed here + /i - included + /m - **unsupported**, throws error + /s - handled by XRegExp when delimiters are provided as strings + /x - handled by XRegExp when delimiters are provided as strings + /y - not needed here; supported by other handling in this function + */ + esc = new RegExp( + "^(?:" + escaped + "[\\S\\s]|(?:(?!" + left.source + "|" + right.source + ")[^" + escaped + "])+)+", + ignoreCase ? "i" : "" + ); + } + + while (true) { + /* advance the starting search position to the end of the last delimiter match. + a couple special cases are also covered: + - if using an escape character, advance to the next delimiter's starting position, + skipping any escaped characters + - first time through, reset lastIndex in case delimiters were provided as regexes + */ + left.lastIndex = right.lastIndex = delimEnd + + (escapeChar ? (esc.exec(str.slice(delimEnd)) || [""])[0].length : 0); + + leftMatch = left.exec(str); + rightMatch = right.exec(str); + + // only keep the result which matched earlier in the string + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) + rightMatch = null; + else leftMatch = null; + } + + /* paths*: + leftMatch | rightMatch | openTokens | result + 1 | 0 | 1 | ... + 1 | 0 | 0 | ... + 0 | 1 | 1 | ... + 0 | 1 | 0 | throw + 0 | 0 | 1 | throw + 0 | 0 | 0 | break + * - does not include the sticky mode special case + - the loop ends after the first completed match if not in global mode + */ + + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = (leftMatch ? left : right).lastIndex; + } else if (!openTokens) { + break; + } + + if (sticky && !openTokens && delimStart > lastOuterEnd) + break; + + if (leftMatch) { + if (!openTokens++) { + outerStart = delimStart; + innerStart = delimEnd; + } + } else if (rightMatch && openTokens) { + if (!--openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) + output.push([vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart]); + if (vN[1]) output.push([vN[1], str.slice(outerStart, innerStart), outerStart, innerStart]); + if (vN[2]) output.push([vN[2], str.slice(innerStart, delimStart), innerStart, delimStart]); + if (vN[3]) output.push([vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd]); + } else { + output.push(str.slice(innerStart, delimStart)); + } + lastOuterEnd = delimEnd; + if (!global) + break; + } + } else { + // reset lastIndex in case delimiters were provided as regexes + left.lastIndex = right.lastIndex = 0; + throw Error("subject data contains unbalanced delimiters"); + } + + // if the delimiter matched an empty string, advance delimEnd to avoid an infinite loop + if (delimStart === delimEnd) + delimEnd++; + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) + output.push([vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length]); + + // reset lastIndex in case delimiters were provided as regexes + left.lastIndex = right.lastIndex = 0; + + return output; +}; diff --git a/test_script/src/shLegacy.js b/test_script/src/shLegacy.js new file mode 100644 index 00000000..7859029a --- /dev/null +++ b/test_script/src/shLegacy.js @@ -0,0 +1,172 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/ + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate + * + * @version + * 2.0.296 (March 01 2009) + * + * @copyright + * Copyright (C) 2004-2009 Alex Gorbatchev. + * + * @license + * This file is part of SyntaxHighlighter. + * + * SyntaxHighlighter is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SyntaxHighlighter is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SyntaxHighlighter. If not, see . + */ +var dp = { + SyntaxHighlighter : {} +}; + +dp.SyntaxHighlighter = { + parseParams: function( + input, + showGutter, + showControls, + collapseAll, + firstLine, + showColumns + ) + { + function getValue(list, name) + { + var regex = new XRegExp('^' + name + '\\[(?\\w+)\\]$', 'gi'), + match = null + ; + + for (var i = 0; i < list.length; i++) + if ((match = regex.exec(list[i])) != null) + return match.value; + + return null; + }; + + function defaultValue(value, def) + { + return value != null ? value : def; + }; + + function asString(value) + { + return value != null ? value.toString() : null; + }; + + var parts = input.split(':'), + brushName = parts[0], + options = {}, + straight = { 'true' : 'true' } + reverse = { 'true' : 'false' }, + result = null, + defaults = SyntaxHighlighter.defaults + ; + + for (var i in parts) + options[parts[i]] = 'true'; + + showGutter = asString(defaultValue(showGutter, defaults.gutter)); + showControls = asString(defaultValue(showControls, defaults.toolbar)); + collapseAll = asString(defaultValue(collapseAll, defaults.collapse)); + showColumns = asString(defaultValue(showColumns, defaults.ruler)); + firstLine = asString(defaultValue(firstLine, defaults['first-line'])); + + result = { + brush : brushName, + gutter : defaultValue(reverse[options.nogutter], showGutter), + toolbar : defaultValue(reverse[options.nocontrols], showControls), + collapse : defaultValue(straight[options.collapse], collapseAll), + ruler : defaultValue(straight[options.showcolumns], showColumns), + 'first-line' : defaultValue(getValue(parts, 'firstline'), firstLine) + }; + + return result; + }, + + HighlightAll: function( + name, + showGutter /* optional */, + showControls /* optional */, + collapseAll /* optional */, + firstLine /* optional */, + showColumns /* optional */ + ) + { + function findValue() + { + var a = arguments; + + for (var i = 0; i < a.length; i++) + { + if (a[i] === null) + continue; + + if (typeof(a[i]) == 'string' && a[i] != '') + return a[i] + ''; + + if (typeof(a[i]) == 'object' && a[i].value != '') + return a[i].value + ''; + } + + return null; + }; + + function findTagsByName(list, name, tagName) + { + var tags = document.getElementsByTagName(tagName); + + for (var i = 0; i < tags.length; i++) + if (tags[i].getAttribute('name') == name) + list.push(tags[i]); + } + + var elements = [], + highlighter = null, + registered = {}, + propertyName = 'innerHTML' + ; + + // for some reason IE doesn't find
 by name, however it does see them just fine by tag name... 
+		findTagsByName(elements, name, 'pre');
+		findTagsByName(elements, name, 'textarea');
+
+		if (elements.length === 0)
+			return;
+		
+		for (var i = 0; i < elements.length; i++)
+		{
+			var element = elements[i],
+				params = findValue(
+					element.attributes['class'], element.className, 
+					element.attributes['language'], element.language
+					),
+				language = ''
+				;
+			
+			if (params === null) 
+				continue;
+
+			params = dp.SyntaxHighlighter.parseParams(
+				params,
+				showGutter, 
+				showControls, 
+				collapseAll, 
+				firstLine, 
+				showColumns
+				);
+
+			SyntaxHighlighter.highlight(params, element);
+		}
+	}
+};
diff --git a/test_script/styles/help.png b/test_script/styles/help.png
new file mode 100644
index 0000000000000000000000000000000000000000..5c870176d4dea68aab9e51166cc3d7a582f326d6
GIT binary patch
literal 786
zcmV+t1MU2YP)$XgYMs^AIOw1Qr{*Wn)N-{9ma}x2(<~`9Go1=*>YR!KZvrBS
zCd!u}@M0og%Ev@_;Z?Kk>Wwv=%h_57zmt2<_1msz_niYE=YRNPpd%02TK9oK1z
z>ooPno}v^sikz_|1XHFx_L%~;ljh7i(jiay5F0x*+(9aXXFCl?AdQj5XlQ65%sEv+
ztfe?|YcjPN*@yYtE~ImQh{l|#A6Z8iu>pf43Rj52CzU_dMQm|S2xR62YjQOn+z8WH
zaK=!}ggOZi{4pB7SQ=xC0n|vXP_Bkx_a)FeNd}w8U97BNbSWxa^QW-li9BZ#M1!_xE*?wzt^GcoeoL*JGLSe_+l-JT2#2tz!z&^
z_s5anq&^nBklIMwRvcoP3%qs%%Ea?1c{_*V*Xj&~uLu-2Dp1fUN4<0zMo$EH>*U83
zm_9;Vt%-bE{_J_!If!1y=c+`QVZ>0_BPy
z+%^pgnv`f8H)Z%0&Tp8&u*MCIC4igNW5MeWM_DHpDNi)Zxz|9XboOnitwFq$ETN=X
zj-tkCJnz**Y4k#6_Ty^B=hWo~L!47r`HoP=x&3T1)JLr2t2+#fHgNuvOO$0ks
zMIj=HnnBRUR?tKXG11rxCU4&7dG4NbuvR2_mEvc)n?Cow;~Wve|KR^>9@p5l)|QB+
z$jmun3q#x>;ss-PW_mnr2MHVzLAl1RW&0?VkixF*4t!St0YVb2wnKdU(kmOHiL;aW
zK8Xte%(k>MVGG$E4no6dcNnb>BhVHHGD&1pv4YZ68kE2V03t5#PCEFm7=ad$6)+3B
zTCmn*?A?=u(o~ET7~-7g0)ZB=6|lumi4}B}MLgy~Ysy6)Q5%Al7|05&1z3Jpu>cF8
z3?VXs*3<}%h3`5Wld)N2zJnk%Agw<~3k)sPTLFd=F5;d8-bj-09SkQuynfflNcZLN
z!^_37fdZvzrq=9~mp*($%mcDRKC&qvaaZuX+C=AT6O*~tHl>0mcP<_q>-z%$xO(@!
zYluq5a8VQI$S@4?r*v;gPo!QQ%pX3A#>xx4t=w-L6COWx?aj&`f+!YePsFtj=hOQR
zP3=E2j@9L7s8;T^&s?u(Hdpu?CubjMrGn{t_37>9$|AD)QE08weJlKn8|OyjL~7oP
zC8mPT`jzuH*Dh^I0048RGafUIT)4H~*m8m>egI0iH=(LB%b@@O002ovPDHLkV1lw0
B3^~*-1fljz_B$LUvK}k?BNXe#Y!m=zM!!V#}8bncK5m;8VP
zw86G*RI63?Cd%b9bX|ueNlZ|wR6rj|r_)VIP@r2imh3?SN+^{|kY%~8B{maJ@F*OK
z&VH9LwOeGt#DRjj0~v~8`>iO7!Ybi;zE$va`A^T#yW`y44;k^#O~K5*jD=qcUhPSc
zvyy~q;5H_1WT1l~cqje9yfa+l!hu6xjdOJ8s;8E^+=QQ$tw
p?%p!Hy#YapB=@+^9(46X{{RQg%9y;OKjr`c002ovPDHLkV1g7l326WT

literal 0
HcmV?d00001

diff --git a/test_script/styles/page_white_copy.png b/test_script/styles/page_white_copy.png
new file mode 100644
index 0000000000000000000000000000000000000000..a9f31a278e17993d8d4e13beac2f9d5f7b42d08f
GIT binary patch
literal 309
zcmV-50m}Y~P)^msfbTI
z9jQ^EwMRD5xNEm*sJPjH^k)@gXT@kl5ii6#6jNXX`Yb0kVgq(zut?ZfbRr+DS=
z>q{33dTpWN$tl6c7nxE)4Qur1GCxuUnp5Y
z5HK(>u&W4&EXz<>UtfnPivJ`O3Zb4K8yl-}7K;Uh5XR!-B2uXo6E#Dr&Ck!D<$0b5
zXEK?PNF*3;w;Rc15`MqGDN4rSaGd2kJ3GNmOiaM%^D*ppJL2&;mX?;95{t!PwOY^e
z?d|R0=pOKTy$qMj1$rk8qtS@b(NQ*LUtb@(y1JlNtJzsS-`3U!Ze(Pn>hXBkfzr6}
z{3Vv(2AlG1;RQN6I#_mYZVs)jt>6p>!_3go(6&ye1Mdo>SRyz&A^1T#%t=UROW6Bf
zz^9CeqErU&3`3<-Da~6HQ^UW&yCT)$Cu

literal 0
HcmV?d00001

diff --git a/test_script/styles/shCore.css b/test_script/styles/shCore.css
new file mode 100644
index 00000000..62e81519
--- /dev/null
+++ b/test_script/styles/shCore.css
@@ -0,0 +1,321 @@
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
+ *
+ * @version
+ * 2.0.296 (March 01 2009)
+ * 
+ * @copyright
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
+ *
+ * @license
+ * This file is part of SyntaxHighlighter.
+ * 
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with SyntaxHighlighter.  If not, see .
+ */
+.syntaxhighlighter,
+.syntaxhighlighter div,
+.syntaxhighlighter code,
+.syntaxhighlighter span
+{
+	margin: 0 !important;
+	padding: 0 !important;
+	border: 0 !important;
+	outline: 0 !important;
+	background: none !important;
+	text-align: left !important;
+	float: none !important;
+	vertical-align: baseline !important;
+	position: static !important;
+	left: auto !important;
+	top: auto !important;
+	right: auto !important;
+	bottom: auto !important;
+	height: auto !important;
+	width: auto !important;
+	line-height: 1.1em !important;
+	font-family: "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
+	font-weight: normal !important;
+	font-style: normal !important;
+	font-size: 1em !important;
+}
+
+.syntaxhighlighter
+{
+	width: 100% !important;
+	margin: 1em 0 1em 0 !important;
+	padding: 1px !important; /* adds a little border on top and bottom */
+	position: relative !important;
+}
+
+.syntaxhighlighter .bold {
+	font-weight: bold !important;
+}
+
+.syntaxhighlighter .italic {
+	font-style: italic !important;
+}
+
+.syntaxhighlighter .line .number
+{
+	float: left !important; 
+	width: 3em !important; 
+	padding-right: .3em !important;
+	text-align: right !important;
+	display: block !important;
+}
+
+/* Disable numbers when no gutter option is set */
+.syntaxhighlighter.nogutter .line .number
+{
+	display: none !important;
+}
+
+.syntaxhighlighter .line .content
+{
+	margin-left: 3.3em !important; 
+	padding-left: .5em !important;
+	display: block !important;
+}
+
+.syntaxhighlighter .line .content .block
+{
+	display: block !important;
+	padding-left: 1.5em !important;
+	text-indent: -1.5em !important;
+}
+
+.syntaxhighlighter .line .content .spaces
+{
+	display: none !important;
+}
+
+/* Disable border and margin on the lines when no gutter option is set */
+.syntaxhighlighter.nogutter .line .content
+{
+	margin-left: 0 !important; 
+	border-left: none !important;
+}
+
+.syntaxhighlighter .bar
+{
+}
+
+.syntaxhighlighter.collapsed .bar
+{
+
+}
+
+.syntaxhighlighter.nogutter .ruler
+{
+	margin-left: 0 !important;
+	padding-left: 0 !important;
+}
+
+.syntaxhighlighter .ruler
+{
+	padding: 0 0 .5em .5em !important;
+	margin-left: 3.3em !important;
+	overflow: hidden !important;
+}
+
+/* Adjust some properties when collapsed */
+
+.syntaxhighlighter.collapsed .lines,
+.syntaxhighlighter.collapsed .ruler
+{
+	display: none !important;
+}
+
+/* Styles for the toolbar */
+
+.syntaxhighlighter .toolbar
+{
+	position: absolute !important;
+	right: 0px !important;
+	top: 0px !important;
+	font-size: 1px !important;
+	padding: 8px 8px 8px 0 !important; /* in px because images don't scale with ems */
+}
+
+.syntaxhighlighter.collapsed .toolbar
+{
+	font-size: 80% !important;
+	padding: .2em 0 .5em .5em !important;
+	position: static !important;
+}
+
+.syntaxhighlighter .toolbar a.item,
+.syntaxhighlighter .toolbar .item
+{
+	display: block !important;
+	float: left !important;
+	margin-left: 8px !important;
+	background-repeat: no-repeat !important;
+	overflow: hidden !important;
+	text-indent: -5000px !important;
+}
+
+.syntaxhighlighter.collapsed .toolbar .item
+{
+	display: none !important;
+}
+
+.syntaxhighlighter.collapsed .toolbar .item.expandSource
+{
+	background-image: url(magnifier.png) !important;
+	display: inline !important;
+	text-indent: 0 !important;
+	width: auto !important;
+	float: none !important;
+	height: 16px !important;
+	padding-left: 20px !important;
+}
+
+.syntaxhighlighter .toolbar .item.viewSource
+{
+	background-image: url(page_white_code.png) !important;
+}
+
+.syntaxhighlighter .toolbar .item.printSource
+{
+	background-image: url(printer.png) !important;
+}
+
+.syntaxhighlighter .toolbar .item.copyToClipboard
+{
+	text-indent: 0 !important;
+	background: none !important;
+	overflow: visible !important;
+}
+
+.syntaxhighlighter .toolbar .item.about
+{
+	background-image: url(help.png) !important;
+}
+
+/** 
+ * Print view.
+ * Colors are based on the default theme without background.
+ */
+
+.syntaxhighlighter.printing,
+.syntaxhighlighter.printing .line.alt1 .content,
+.syntaxhighlighter.printing .line.alt2 .content,
+.syntaxhighlighter.printing .line.highlighted .number,
+.syntaxhighlighter.printing .line.highlighted.alt1 .content,
+.syntaxhighlighter.printing .line.highlighted.alt2 .content,
+.syntaxhighlighter.printing .line .content .block
+{
+	background: none !important;
+}
+
+/* Gutter line numbers */
+.syntaxhighlighter.printing .line .number
+{
+	color: #bbb !important;
+}
+
+/* Add border to the lines */
+.syntaxhighlighter.printing .line .content
+{
+	color: #000 !important;
+}
+
+/* Toolbar when visible */
+.syntaxhighlighter.printing .toolbar,
+.syntaxhighlighter.printing .ruler
+{
+	display: none !important;
+}
+
+.syntaxhighlighter.printing a
+{
+	text-decoration: none !important;
+}
+
+.syntaxhighlighter.printing .plain,
+.syntaxhighlighter.printing .plain a
+{ 
+	color: #000 !important;
+}
+
+.syntaxhighlighter.printing .comments,
+.syntaxhighlighter.printing .comments a
+{ 
+	color: #008200 !important;
+}
+
+.syntaxhighlighter.printing .string,
+.syntaxhighlighter.printing .string a
+{
+	color: blue !important; 
+}
+
+.syntaxhighlighter.printing .keyword
+{ 
+	color: #069 !important; 
+	font-weight: bold !important; 
+}
+
+.syntaxhighlighter.printing .preprocessor 
+{ 
+	color: gray !important; 
+}
+
+.syntaxhighlighter.printing .variable 
+{ 
+	color: #a70 !important; 
+}
+
+.syntaxhighlighter.printing .value
+{ 
+	color: #090 !important; 
+}
+
+.syntaxhighlighter.printing .functions
+{ 
+	color: #ff1493 !important; 
+}
+
+.syntaxhighlighter.printing .constants
+{ 
+	color: #0066CC !important; 
+}
+
+.syntaxhighlighter.printing .script
+{
+	font-weight: bold !important;
+}
+
+.syntaxhighlighter.printing .color1,
+.syntaxhighlighter.printing .color1 a
+{ 
+	color: #808080 !important; 
+}
+
+.syntaxhighlighter.printing .color2,
+.syntaxhighlighter.printing .color2 a
+{ 
+	color: #ff1493 !important; 
+}
+
+.syntaxhighlighter.printing .color3,
+.syntaxhighlighter.printing .color3 a
+{ 
+	color: red !important; 
+}
diff --git a/test_script/styles/shThemeDefault.css b/test_script/styles/shThemeDefault.css
new file mode 100644
index 00000000..a4b2f820
--- /dev/null
+++ b/test_script/styles/shThemeDefault.css
@@ -0,0 +1,191 @@
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
+ *
+ * @version
+ * 2.0.296 (March 01 2009)
+ * 
+ * @copyright
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
+ *
+ * @license
+ * This file is part of SyntaxHighlighter.
+ * 
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with SyntaxHighlighter.  If not, see .
+ */
+/************************************
+ * Default Syntax Highlighter theme.
+ * 
+ * Interface elements.
+ ************************************/
+
+.syntaxhighlighter
+{
+	background-color: #E7E5DC !important;
+}
+
+/* Highlighed line number */
+.syntaxhighlighter .line.highlighted .number
+{
+	background-color: #6CE26C !important;
+	color: black !important;
+}
+
+/* Highlighed line */
+.syntaxhighlighter .line.highlighted.alt1 .content,
+.syntaxhighlighter .line.highlighted.alt2 .content
+{
+	background-color: #6CE26C !important;
+}
+
+/* Gutter line numbers */
+.syntaxhighlighter .line .number
+{
+	color: #5C5C5C !important;
+}
+
+/* Add border to the lines */
+.syntaxhighlighter .line .content
+{
+	border-left: 3px solid #6CE26C !important;
+	color: #000 !important;
+}
+
+.syntaxhighlighter.printing .line .content 
+{
+	border: 0 !important;
+}
+
+/* First line */
+.syntaxhighlighter .line.alt1 .content
+{
+	background-color: #fff !important;
+}
+
+/* Second line */
+.syntaxhighlighter .line.alt2 .content
+{
+	background-color: #F8F8F8 !important;
+}
+
+.syntaxhighlighter .line .content .block
+{
+	background: url(wrapping.png) 0 1.1em no-repeat !important;
+}
+
+.syntaxhighlighter .ruler
+{
+	color: silver !important;
+	background-color: #F8F8F8 !important;
+	border-left: 3px solid #6CE26C !important;
+}
+
+.syntaxhighlighter.nogutter .ruler
+{
+	border: 0 !important;
+}
+
+.syntaxhighlighter .toolbar
+{
+	background-color: #F8F8F8 !important;
+	border: #E7E5DC solid 1px !important;
+}
+
+.syntaxhighlighter .toolbar a
+{
+	color: #a0a0a0 !important;
+}
+
+.syntaxhighlighter .toolbar a:hover
+{
+	color: red !important;
+}
+
+/************************************
+ * Actual syntax highlighter colors.
+ ************************************/
+.syntaxhighlighter .plain,
+.syntaxhighlighter .plain a
+{ 
+	color: #000 !important;
+}
+
+.syntaxhighlighter .comments,
+.syntaxhighlighter .comments a
+{ 
+	color: #008200 !important;
+}
+
+.syntaxhighlighter .string,
+.syntaxhighlighter .string a
+{
+	color: blue !important; 
+}
+
+.syntaxhighlighter .keyword
+{ 
+	color: #069 !important; 
+	font-weight: bold !important; 
+}
+
+.syntaxhighlighter .preprocessor 
+{ 
+	color: gray !important; 
+}
+
+.syntaxhighlighter .variable 
+{ 
+	color: #a70 !important; 
+}
+
+.syntaxhighlighter .value
+{ 
+	color: #090 !important; 
+}
+
+.syntaxhighlighter .functions
+{ 
+	color: #ff1493 !important; 
+}
+
+.syntaxhighlighter .constants
+{ 
+	color: #0066CC !important; 
+}
+
+.syntaxhighlighter .script
+{ 
+	background-color: yellow !important;
+}
+
+.syntaxhighlighter .color1,
+.syntaxhighlighter .color1 a
+{ 
+	color: #808080 !important; 
+}
+
+.syntaxhighlighter .color2,
+.syntaxhighlighter .color2 a
+{ 
+	color: #ff1493 !important; 
+}
+
+.syntaxhighlighter .color3,
+.syntaxhighlighter .color3 a
+{ 
+	color: red !important; 
+}
diff --git a/test_script/styles/shThemeDjango.css b/test_script/styles/shThemeDjango.css
new file mode 100644
index 00000000..12433540
--- /dev/null
+++ b/test_script/styles/shThemeDjango.css
@@ -0,0 +1,193 @@
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
+ *
+ * @version
+ * 2.0.296 (March 01 2009)
+ * 
+ * @copyright
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
+ *
+ * @license
+ * This file is part of SyntaxHighlighter.
+ * 
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with SyntaxHighlighter.  If not, see .
+ */
+/**
+ * Django SyntaxHighlighter theme
+ */
+
+/************************************
+ * Interface elements.
+ ************************************/
+
+.syntaxhighlighter
+{
+	background-color: #0B2F20 !important;
+}
+
+/* Gutter line numbers */
+.syntaxhighlighter .line .number
+{
+	color: #497958 !important;
+}
+
+/* Add border to the lines */
+.syntaxhighlighter .line .content
+{
+	border-left: 3px solid #41A83E !important;
+	color: #B9BDB6 !important;
+}
+
+.syntaxhighlighter.printing .line .content 
+{
+	border: 0 !important;
+}
+
+/* First line */
+.syntaxhighlighter .line.alt1 .content
+{
+}
+
+/* Second line */
+.syntaxhighlighter .line.alt2 .content
+{
+	background-color: #0a2b1d !important;
+}
+
+.syntaxhighlighter .line .content .block
+{
+	background: url(wrapping.png) 0 1.1em no-repeat !important;
+}
+
+/* Highlighed line number */
+.syntaxhighlighter .line.highlighted .number
+{
+	background-color: #336442 !important;
+	color: #fff !important;
+}
+
+/* Highlighed line */
+.syntaxhighlighter .line.highlighted.alt1 .content,
+.syntaxhighlighter .line.highlighted.alt2 .content
+{
+	background-color: #336442 !important;
+}
+
+.syntaxhighlighter .ruler
+{
+	color: #C4B14A !important;
+	background-color: #245032 !important;
+	border-left: 3px solid #41A83E !important;
+}
+
+.syntaxhighlighter.nogutter .ruler
+{
+	border: 0 !important;
+}
+
+.syntaxhighlighter .toolbar
+{
+	background-color: #245032 !important;
+	border: #0B2F20 solid 1px !important;
+}
+
+.syntaxhighlighter .toolbar a
+{
+	color: #C4B14A !important;
+}
+
+.syntaxhighlighter .toolbar a:hover
+{
+	color: #FFE862 !important;
+}
+
+/************************************
+ * Actual syntax highlighter colors.
+ ************************************/
+.syntaxhighlighter .plain,
+.syntaxhighlighter .plain a
+{
+	color: #F8F8F8 !important;
+}
+
+.syntaxhighlighter .comments,
+.syntaxhighlighter .comments a
+{ 
+	color: #336442 !important;
+	font-style: italic !important;
+}
+
+.syntaxhighlighter .string,
+.syntaxhighlighter .string a
+{
+	color: #9DF39F !important; 
+}
+
+.syntaxhighlighter .keyword
+{ 
+	color: #96DD3B !important; 
+	font-weight: bold !important;
+}
+
+.syntaxhighlighter .preprocessor 
+{ 
+	color: #91BB9E !important; 
+}
+
+.syntaxhighlighter .variable 
+{ 
+	color: #FFAA3E !important; 
+}
+
+.syntaxhighlighter .value
+{ 
+	color: #F7E741 !important; 
+}
+
+.syntaxhighlighter .functions
+{ 
+	color: #FFAA3E !important; 
+}
+
+.syntaxhighlighter .constants
+{ 
+	color: #E0E8FF !important; 
+}
+
+.syntaxhighlighter .script
+{ 
+	background-color: #497958 !important;
+}
+
+.syntaxhighlighter .color1,
+.syntaxhighlighter .color1 a
+{ 
+	color: #EB939A !important; 
+}
+
+.syntaxhighlighter .color2,
+.syntaxhighlighter .color2 a
+{ 
+	color: #91BB9E !important; 
+}
+
+.syntaxhighlighter .color3,
+.syntaxhighlighter .color3 a
+{ 
+	color: #EDEF7D !important; 
+}
diff --git a/test_script/styles/shThemeEmacs.css b/test_script/styles/shThemeEmacs.css
new file mode 100644
index 00000000..d1710a6e
--- /dev/null
+++ b/test_script/styles/shThemeEmacs.css
@@ -0,0 +1,192 @@
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
+ *
+ * @version
+ * 2.0.296 (March 01 2009)
+ * 
+ * @copyright
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
+ *
+ * @license
+ * This file is part of SyntaxHighlighter.
+ * 
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with SyntaxHighlighter.  If not, see .
+ */
+/**
+ * Emacs SyntaxHighlighter theme based on theme by Joshua Emmons
+ * http://www.skia.net/
+ */
+
+/************************************
+ * Interface elements.
+ ************************************/
+
+.syntaxhighlighter
+{
+	background-color: #000000 !important;
+}
+
+/* Gutter line numbers */
+.syntaxhighlighter .line .number
+{
+	color: #D3D3D3 !important;
+}
+
+/* Add border to the lines */
+.syntaxhighlighter .line .content
+{
+	border-left: 3px solid #990000 !important;
+	color: #B9BDB6 !important;
+}
+
+.syntaxhighlighter.printing .line .content 
+{
+	border: 0 !important;
+}
+
+/* First line */
+.syntaxhighlighter .line.alt1 .content
+{
+}
+
+/* Second line */
+.syntaxhighlighter .line.alt2 .content
+{
+	background-color: #0f0f0f !important;
+}
+
+.syntaxhighlighter .line .content .block
+{
+	background: url(wrapping.png) 0 1.1em no-repeat !important;
+}
+
+/* Highlighed line number */
+.syntaxhighlighter .line.highlighted .number
+{
+	background-color: #435A5F !important;
+	color: #fff !important;
+}
+
+/* Highlighed line */
+.syntaxhighlighter .line.highlighted.alt1 .content,
+.syntaxhighlighter .line.highlighted.alt2 .content
+{
+	background-color: #435A5F !important;
+}
+
+.syntaxhighlighter .ruler
+{
+	color: silver !important;
+	background-color: #000000 !important;
+	border-left: 3px solid #990000 !important;
+}
+
+.syntaxhighlighter.nogutter .ruler
+{
+	border: 0 !important;
+}
+
+.syntaxhighlighter .toolbar
+{
+	background-color: #000000 !important;
+	border: #000000 solid 1px !important;
+}
+
+.syntaxhighlighter .toolbar a
+{
+	color: #646763 !important;
+}
+
+.syntaxhighlighter .toolbar a:hover
+{
+	color: #9CCFF4 !important;
+}
+
+/************************************
+ * Actual syntax highlighter colors.
+ ************************************/
+.syntaxhighlighter .plain,
+.syntaxhighlighter .plain a
+{ 
+	color: #D3D3D3 !important;
+}
+
+.syntaxhighlighter .comments,
+.syntaxhighlighter .comments a
+{ 
+	color: #FF7D27 !important;
+}
+
+.syntaxhighlighter .string,
+.syntaxhighlighter .string a
+{
+	color: #FF9E7B !important; 
+}
+
+.syntaxhighlighter .keyword
+{ 
+	color: #00FFFF !important; 
+}
+
+.syntaxhighlighter .preprocessor 
+{ 
+	color: #AEC4DE !important; 
+}
+
+.syntaxhighlighter .variable 
+{ 
+	color: #FFAA3E !important; 
+}
+
+.syntaxhighlighter .value
+{ 
+	color: #090 !important; 
+}
+
+.syntaxhighlighter .functions
+{ 
+	color: #81CEF9 !important; 
+}
+
+.syntaxhighlighter .constants
+{ 
+	color: #FF9E7B !important; 
+}
+
+.syntaxhighlighter .script
+{ 
+	background-color: #990000 !important;
+}
+
+.syntaxhighlighter .color1,
+.syntaxhighlighter .color1 a
+{ 
+	color: #EBDB8D !important; 
+}
+
+.syntaxhighlighter .color2,
+.syntaxhighlighter .color2 a
+{ 
+	color: #FF7D27 !important; 
+}
+
+.syntaxhighlighter .color3,
+.syntaxhighlighter .color3 a
+{ 
+	color: #AEC4DE !important; 
+}
diff --git a/test_script/styles/shThemeFadeToGrey.css b/test_script/styles/shThemeFadeToGrey.css
new file mode 100644
index 00000000..0d036c1c
--- /dev/null
+++ b/test_script/styles/shThemeFadeToGrey.css
@@ -0,0 +1,193 @@
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
+ *
+ * @version
+ * 2.0.296 (March 01 2009)
+ * 
+ * @copyright
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
+ *
+ * @license
+ * This file is part of SyntaxHighlighter.
+ * 
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with SyntaxHighlighter.  If not, see .
+ */
+/**
+ * Fade to Grey SyntaxHighlighter theme based on theme by Brasten Sager
+ * http://www.ibrasten.com/
+ */
+
+/************************************
+ * Interface elements.
+ ************************************/
+
+.syntaxhighlighter
+{
+	background-color: #121212 !important;
+}
+
+/* Gutter line numbers */
+.syntaxhighlighter .line .number
+{
+	color: #C3C3C3 !important;
+}
+
+/* Add border to the lines */
+.syntaxhighlighter .line .content
+{
+	border-left: 3px solid #3185B9 !important;
+	color: #B9BDB6 !important;
+}
+
+.syntaxhighlighter.printing .line .content 
+{
+	border: 0 !important;
+}
+
+/* First line */
+.syntaxhighlighter .line.alt1 .content
+{
+}
+
+/* Second line */
+.syntaxhighlighter .line.alt2 .content
+{
+	background-color: #000000 !important;
+}
+
+.syntaxhighlighter .line .content .block
+{
+	background: url(wrapping.png) 0 1.1em no-repeat !important;
+}
+
+/* Highlighed line number */
+.syntaxhighlighter .line.highlighted .number
+{
+	background-color: #3A3A00 !important;
+	color: #fff !important;
+}
+
+/* Highlighed line */
+.syntaxhighlighter .line.highlighted.alt1 .content,
+.syntaxhighlighter .line.highlighted.alt2 .content
+{
+	background-color: #3A3A00 !important;
+}
+
+.syntaxhighlighter .ruler
+{
+	color: silver !important;
+	border-left: 3px solid #3185B9 !important;
+}
+
+.syntaxhighlighter.nogutter .ruler
+{
+	border: 0 !important;
+}
+
+.syntaxhighlighter .toolbar
+{
+	background-color: #000000 !important;
+	border: #000000 solid 1px !important;
+}
+
+.syntaxhighlighter .toolbar a
+{
+	color: #808080 !important;
+}
+
+.syntaxhighlighter .toolbar a:hover
+{
+	color: #96DAFF !important;
+}
+
+/************************************
+ * Actual syntax highlighter colors.
+ ************************************/
+.syntaxhighlighter .plain,
+.syntaxhighlighter .plain a
+{ 
+	color: #FFFFFF !important;
+}
+
+.syntaxhighlighter .comments,
+.syntaxhighlighter .comments a
+{ 
+	color: #696854 !important;
+}
+
+.syntaxhighlighter .string,
+.syntaxhighlighter .string a
+{
+	color: #E3E658 !important; 
+}
+
+.syntaxhighlighter .keyword
+{ 
+	color: #D01D33 !important; 
+}
+
+.syntaxhighlighter .preprocessor 
+{ 
+	color: #435A5F !important; 
+}
+
+.syntaxhighlighter .variable 
+{ 
+	color: #898989 !important; 
+}
+
+.syntaxhighlighter .value
+{ 
+	color: #090 !important; 
+}
+
+.syntaxhighlighter .functions
+{ 
+	color: #AAAAAA !important;
+	font-weight: bold !important;
+}
+
+.syntaxhighlighter .constants
+{ 
+	color: #96DAFF !important; 
+}
+
+.syntaxhighlighter .script
+{ 
+	background-color: #C3C3C3 !important;
+	color: #000 !important;
+}
+
+.syntaxhighlighter .color1,
+.syntaxhighlighter .color1 a
+{ 
+	color: #FFC074 !important; 
+}
+
+.syntaxhighlighter .color2,
+.syntaxhighlighter .color2 a
+{ 
+	color: #4A8CDB !important; 
+}
+
+.syntaxhighlighter .color3,
+.syntaxhighlighter .color3 a
+{ 
+	color: #96DAFF !important; 
+}
diff --git a/test_script/styles/shThemeMidnight.css b/test_script/styles/shThemeMidnight.css
new file mode 100644
index 00000000..f49a7b3e
--- /dev/null
+++ b/test_script/styles/shThemeMidnight.css
@@ -0,0 +1,192 @@
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
+ *
+ * @version
+ * 2.0.296 (March 01 2009)
+ * 
+ * @copyright
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
+ *
+ * @license
+ * This file is part of SyntaxHighlighter.
+ * 
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with SyntaxHighlighter.  If not, see .
+ */
+/**
+ * Midnight SyntaxHighlighter theme based on theme by J.D. Myers
+ * http://webdesign.lsnjd.com/
+ */
+
+/************************************
+ * Interface elements.
+ ************************************/
+
+.syntaxhighlighter
+{
+	background-color: #0F192A !important;
+}
+
+/* Gutter line numbers */
+.syntaxhighlighter .line .number
+{
+	color: #38566F !important;
+}
+
+/* Add border to the lines */
+.syntaxhighlighter .line .content
+{
+	border-left: 3px solid #435A5F !important;
+	color: #B9BDB6 !important;
+}
+
+.syntaxhighlighter.printing .line .content 
+{
+	border: 0 !important;
+}
+
+/* First line */
+.syntaxhighlighter .line.alt1 .content
+{
+	background-color: #0F192A !important;
+}
+
+/* Second line */
+.syntaxhighlighter .line.alt2 .content
+{
+	background-color: #0F192A !important;
+}
+
+.syntaxhighlighter .line .content .block
+{
+	background: url(wrapping.png) 0 1.1em no-repeat !important;
+}
+
+/* Highlighed line number */
+.syntaxhighlighter .line.highlighted .number
+{
+	background-color: #253E5A !important;
+	color: #fff !important;
+}
+
+/* Highlighed line */
+.syntaxhighlighter .line.highlighted.alt1 .content,
+.syntaxhighlighter .line.highlighted.alt2 .content
+{
+	background-color: #253E5A !important;
+}
+
+.syntaxhighlighter .ruler
+{
+	color: #38566F !important;
+	background-color: #0F192A !important;
+	border-left: 3px solid #435A5F !important;
+}
+
+.syntaxhighlighter.nogutter .ruler
+{
+	border: 0 !important;
+}
+
+.syntaxhighlighter .toolbar
+{
+	background-color: #0F192A !important;
+}
+
+.syntaxhighlighter .toolbar a
+{
+	color: #38566F !important;
+}
+
+.syntaxhighlighter .toolbar a:hover
+{
+	color: #8AA6C1 !important;
+}
+
+/************************************
+ * Actual syntax highlighter colors.
+ ************************************/
+.syntaxhighlighter .plain,
+.syntaxhighlighter .plain a
+{ 
+	color: #D1EDFF !important;
+}
+
+.syntaxhighlighter .comments,
+.syntaxhighlighter .comments a
+{ 
+	color: #428BDD !important;
+}
+
+.syntaxhighlighter .string,
+.syntaxhighlighter .string a
+{
+	color: #1DC116 !important; 
+}
+
+.syntaxhighlighter .keyword
+{ 
+	color: #B43D3D !important; 
+}
+
+.syntaxhighlighter .preprocessor 
+{ 
+	color: #8AA6C1 !important; 
+}
+
+.syntaxhighlighter .variable 
+{ 
+	color: #FFAA3E !important; 
+}
+
+.syntaxhighlighter .value
+{ 
+	color: #F7E741 !important; 
+}
+
+.syntaxhighlighter .functions
+{ 
+	color: #FFAA3E !important; 
+}
+
+.syntaxhighlighter .constants
+{ 
+	color: #E0E8FF !important; 
+}
+
+.syntaxhighlighter .script
+{ 
+	background-color: #404040 !important;
+}
+
+.syntaxhighlighter .color1,
+.syntaxhighlighter .color1 a
+{ 
+	color: #F8BB00 !important; 
+}
+
+.syntaxhighlighter .color2,
+.syntaxhighlighter .color2 a
+{ 
+	color: #FFFFFF !important; 
+}
+
+.syntaxhighlighter .color3,
+.syntaxhighlighter .color3 a
+{ 
+	color: #FFAA3E !important; 
+}
diff --git a/test_script/styles/shThemeRDark.css b/test_script/styles/shThemeRDark.css
new file mode 100644
index 00000000..618554b9
--- /dev/null
+++ b/test_script/styles/shThemeRDark.css
@@ -0,0 +1,192 @@
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
+ *
+ * @version
+ * 2.0.296 (March 01 2009)
+ * 
+ * @copyright
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
+ *
+ * @license
+ * This file is part of SyntaxHighlighter.
+ * 
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with SyntaxHighlighter.  If not, see .
+ */
+/**
+ * RDark SyntaxHighlighter theme based on theme by Radu Dineiu
+ * http://www.vim.org/scripts/script.php?script_id=1732
+ */
+
+/************************************
+ * Interface elements.
+ ************************************/
+
+.syntaxhighlighter
+{
+	background-color: #1B2426 !important;
+}
+
+/* Gutter line numbers */
+.syntaxhighlighter .line .number
+{
+	color: #B9BDB6 !important;
+}
+
+/* Add border to the lines */
+.syntaxhighlighter .line .content
+{
+	border-left: 3px solid #435A5F !important;
+	color: #B9BDB6 !important;
+}
+
+.syntaxhighlighter.printing .line .content 
+{
+	border: 0 !important;
+}
+
+/* First line */
+.syntaxhighlighter .line.alt1 .content
+{
+	background-color: #1B2426 !important;
+}
+
+/* Second line */
+.syntaxhighlighter .line.alt2 .content
+{
+	background-color: #1B2426 !important;
+}
+
+.syntaxhighlighter .line .content .block
+{
+	background: url(wrapping.png) 0 1.1em no-repeat !important;
+}
+
+/* Highlighed line number */
+.syntaxhighlighter .line.highlighted .number
+{
+	background-color: #435A5F !important;
+	color: #fff !important;
+}
+
+/* Highlighed line */
+.syntaxhighlighter .line.highlighted.alt1 .content,
+.syntaxhighlighter .line.highlighted.alt2 .content
+{
+	background-color: #435A5F !important;
+}
+
+.syntaxhighlighter .ruler
+{
+	color: silver !important;
+	background-color: #1B2426 !important;
+	border-left: 3px solid #435A5F !important;
+}
+
+.syntaxhighlighter.nogutter .ruler
+{
+	border: 0 !important;
+}
+
+.syntaxhighlighter .toolbar
+{
+	background-color: #1B2426 !important;
+}
+
+.syntaxhighlighter .toolbar a
+{
+	color: #646763 !important;
+}
+
+.syntaxhighlighter .toolbar a:hover
+{
+	color: #E0E8FF !important;
+}
+
+/************************************
+ * Actual syntax highlighter colors.
+ ************************************/
+.syntaxhighlighter .plain,
+.syntaxhighlighter .plain a
+{ 
+	color: #B9BDB6 !important;
+}
+
+.syntaxhighlighter .comments,
+.syntaxhighlighter .comments a
+{ 
+	color: #878A85 !important;
+}
+
+.syntaxhighlighter .string,
+.syntaxhighlighter .string a
+{
+	color: #5CE638 !important; 
+}
+
+.syntaxhighlighter .keyword
+{ 
+	color: #5BA1CF !important; 
+}
+
+.syntaxhighlighter .preprocessor 
+{ 
+	color: #435A5F !important; 
+}
+
+.syntaxhighlighter .variable 
+{ 
+	color: #FFAA3E !important; 
+}
+
+.syntaxhighlighter .value
+{ 
+	color: #090 !important; 
+}
+
+.syntaxhighlighter .functions
+{ 
+	color: #FFAA3E !important; 
+}
+
+.syntaxhighlighter .constants
+{ 
+	color: #E0E8FF !important; 
+}
+
+.syntaxhighlighter .script
+{ 
+	background-color: #435A5F !important;
+}
+
+.syntaxhighlighter .color1,
+.syntaxhighlighter .color1 a
+{ 
+	color: #E0E8FF !important; 
+}
+
+.syntaxhighlighter .color2,
+.syntaxhighlighter .color2 a
+{ 
+	color: #FFFFFF !important; 
+}
+
+.syntaxhighlighter .color3,
+.syntaxhighlighter .color3 a
+{ 
+	color: #FFAA3E !important; 
+}
diff --git a/test_script/styles/wrapping.png b/test_script/styles/wrapping.png
new file mode 100644
index 0000000000000000000000000000000000000000..6972c5e5946080ca1dec4de09d9430d3edf6c555
GIT binary patch
literal 631
zcmV--0*L*IP)`NY~_X_4^RN+9OmbDu*=G*+_}E
z3jR}&gbG0=R0#?Z-=09KI|YP8=#E5@+>uO|=1VUCOole%Li*0J2^Gy8+;b?&km6gg
zf;aDGp1r#I_V|We$e$~WifFF9R7MCMwsmwsME9<<@yx?a+v)qKuKbNe>k1{IrVt}k
zbbSs~bXr8Se}V_b4opa0GhLA`RHceaP=N}IElbSa8@d(ij1Q|4CvOirm9
+
+
+  
+  SyntaxHighlighter Build Test Page
+  
+  
+  
+  
+  
+  
+  
+
+
+
+

SyntaxHihglighter Test

+

This is a test file to insure that everything is working well.

+ +
+function test() : String
+{
+  return 10;
+}
+
+