From 9b3e13dc14d541424dafd91abfdbb0b7b0c9d97b Mon Sep 17 00:00:00 2001 From: Synchro Date: Mon, 9 Nov 2015 19:09:13 +0100 Subject: [PATCH] First draft of 5.4 --- .scrutinizer.yml | 4 - .travis.yml | 1 - PHPMailerAutoload.php | 49 - README.md | 33 +- VERSION | 2 +- changelog.md | 12 + composer.json | 18 +- composer.lock | 355 ++--- examples/code_generator.phps | 6 +- examples/exceptions.phps | 3 +- examples/gmail.phps | 3 +- examples/gmail_xoauth.phps | 3 +- examples/mail.phps | 3 +- examples/mailing_list.phps | 3 +- examples/pop_before_smtp.phps | 3 +- examples/send_file_upload.phps | 3 +- examples/sendmail.phps | 3 +- examples/signed-mail.phps | 3 +- examples/smtp.phps | 3 +- examples/smtp_check.phps | 3 +- examples/smtp_no_auth.phps | 1 + examples/ssl_options.phps | 3 +- extras/EasyPeasyICS.php | 148 --- extras/README.md | 17 - extras/htmlfilter.php | 1166 ----------------- extras/ntlm_sasl_client.php | 185 --- language/phpmailer.lang-nl.php | 2 +- src/Exception.php | 26 + .../OAuthProvider/Google.php | 9 +- class.phpmailer.php => src/PHPMailer.php | 189 +-- .../PHPMailerOAuth.php | 24 +- class.pop3.php => src/POP3.php | 4 +- class.smtp.php => src/SMTP.php | 12 +- test/bootstrap.php | 2 +- test/phpmailerLangTest.php | 13 +- test/phpmailerTest.php | 67 +- test/test_callback.php | 10 +- 37 files changed, 395 insertions(+), 1996 deletions(-) delete mode 100644 PHPMailerAutoload.php delete mode 100644 extras/EasyPeasyICS.php delete mode 100644 extras/README.md delete mode 100644 extras/htmlfilter.php delete mode 100644 extras/ntlm_sasl_client.php create mode 100644 src/Exception.php rename class.phpmaileroauthgoogle.php => src/OAuthProvider/Google.php (92%) rename class.phpmailer.php => src/PHPMailer.php (95%) rename class.phpmaileroauth.php => src/PHPMailerOAuth.php (91%) rename class.pop3.php => src/POP3.php (99%) rename class.smtp.php => src/SMTP.php (99%) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 30232809..95162c3b 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -31,10 +31,6 @@ tools: enabled: true config: standard: PSR2 - sniffs: - generic: - files: - one_class_per_file_sniff: false filter: excluded_paths: - 'docs/*' diff --git a/.travis.yml b/.travis.yml index c111d5e5..2dc59fec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ php: - 5.6 - 5.5 - 5.4 - - 5.3 - hhvm matrix: diff --git a/PHPMailerAutoload.php b/PHPMailerAutoload.php deleted file mode 100644 index eaa2e303..00000000 --- a/PHPMailerAutoload.php +++ /dev/null @@ -1,49 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2014 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -/** - * PHPMailer SPL autoloader. - * @param string $classname The name of the class to load - */ -function PHPMailerAutoload($classname) -{ - //Can't use __DIR__ as it's only in PHP 5.3+ - $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php'; - if (is_readable($filename)) { - require $filename; - } -} - -if (version_compare(PHP_VERSION, '5.1.2', '>=')) { - //SPL autoloading was introduced in PHP 5.1.2 - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { - spl_autoload_register('PHPMailerAutoload', true, true); - } else { - spl_autoload_register('PHPMailerAutoload'); - } -} else { - /** - * Fall back to traditional autoload for old PHP versions - * @param string $classname The name of the class to load - */ - function __autoload($classname) - { - PHPMailerAutoload($classname); - } -} diff --git a/README.md b/README.md index cd465484..29fafc4a 100644 --- a/README.md +++ b/README.md @@ -38,37 +38,36 @@ software availability and distribution. ## Installation & loading -PHPMailer is available via [Composer/Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), so just add this line to your `composer.json` file: +PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via composer is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: ```json -"phpmailer/phpmailer": "~5.2" +"phpmailer/phpmailer": "~5.4" ``` -or +or run ```sh composer require phpmailer/phpmailer ``` -If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package. +PHPMailer declares the namespace `PHPMailer\PHPMailer`. -Alternatively, copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration.. If you don't speak git or just want a tarball, click the 'zip' button at the top of the page in GitHub. +If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package in your `composer.json`. -If you're not using composer's autoloader, PHPMailer provides an SPL-compatible autoloader, and that is the preferred way of loading the library - just `require '/path/to/PHPMailerAutoload.php';` and everything should work. The autoloader does not throw errors if it can't find classes so it prepends itself to the SPL list, allowing your own (or your framework's) autoloader to catch errors. SPL autoloading was introduced in PHP 5.1.0, so if you are using a version older than that you will need to require/include each class manually. +Alternatively, if you're not using composer, copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each one manually. -PHPMailer does *not* declare a namespace because namespaces were only introduced in PHP 5.3. - -If you want to use Google's XOAUTH2 authentication mechanism, you need to be running at least PHP 5.4, and load the dependencies listed in `composer.json`. +If you don't speak git or just want a tarball, click the 'zip' button on the right of the project page in GitHub. ### Minimal installation -While installing the entire package manually or with composer is simple, convenient and reliable, you may want to include only vital files in your project. At the very least you will need [class.phpmailer.php](class.phpmailer.php). If you're using SMTP, you'll need [class.smtp.php](class.smtp.php), and if you're using POP-before SMTP, you'll need [class.pop3.php](class.pop3.php). For all of these, we recommend you use [the autoloader](PHPMailerAutoload.php) too as otherwise you will either have to `require` all classes manually or use some other autoloader. You can skip the [language](language/) folder if you're not showing errors to users and can make do with English-only errors. You may need the additional classes in the [extras](extras/) folder if you are using those features, including NTLM authentication and ics generation. If you're using Google XOAUTH2 you will need `class.phpmaileroauth.php` and `class.oauth.php` classes too, as well as the composer dependencies. +While installing the entire package manually or with composer is simple, convenient and reliable, you may want to include only vital files in your project. At the very least you will need [src/PHPMailer.php](src/PHPMailer.php). If you're using SMTP, you'll need [src/SMTP.php](src/SMTP.php), and if you're using POP-before SMTP, you'll need [src/POP3.php](src/POP3.php). You can skip the [language](language/) folder if you're not showing errors to users and can make do with English-only errors. If you're using Google XOAUTH2 you will need `src/PHPMailerOAuth.php` and `src/OAuthProvider/Google.php` classes, as well as the composer dependencies. Really, it's much easier to use composer! ## A Simple Example ```php send()) { } ``` -You'll find plenty more to play with in the [examples](examples/) folder. +You'll find plenty of examples to play with in the [examples](examples/) folder. They are saved with a `.phps` extension which will make them display as highlighted source in a browser, avoiding the possibility of them running in default installations. You can run them directly from a command line client, or rename them with a `.php` extension and run them via your web server. That's it. You should now be ready to use PHPMailer! @@ -121,9 +120,9 @@ We welcome corrections and new languages - if you're looking for corrections to ## Documentation -Examples of how to use PHPMailer for common scenarios can be found in the [examples](examples/) folder. If you're looking for a good starting point, we recommend you start with [the gmail example](examples/gmail.phps). +Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, this should be the first place you look as it's the most frequently updated. -There are tips and a troubleshooting guide in the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, this should be the first place you look as it's the most frequently updated. +Examples of how to use PHPMailer for common scenarios can be found in the [examples](examples/) folder. If you're looking for a good starting point, we recommend you start with [the gmail example](examples/gmail.phps). Complete generated API documentation is [available online](http://phpmailer.github.io/PHPMailer/). @@ -133,7 +132,7 @@ If the documentation doesn't cover what you need, search the [many questions on ## Tests -There is a PHPUnit test script in the [test](test/) folder. +There is a PHPUnit test script in the [test](test/) folder. PHPMailer uses PHPUnit 4.8 - we would use 5.0 but we need to run on PHP 5.4. Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer) @@ -145,13 +144,13 @@ Please submit bug reports, suggestions and pull requests to the [GitHub issue tr We're particularly interested in fixing edge-cases, expanding test coverage and updating translations. -With the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone: +If you have git clones from prior to the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone: ```sh git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git ``` -Please *don't* use the SourceForge or Google Code projects any more. +Please *don't* use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained. ## Sponsorship diff --git a/VERSION b/VERSION index ba678f2d..1e20ec35 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.2.14 \ No newline at end of file +5.4.0 \ No newline at end of file diff --git a/changelog.md b/changelog.md index 486f3289..0880c012 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,17 @@ # ChangeLog +## Version 5.4 +This is a major update that breaks backwards compatibility. +* Requires PHP 5.4 or later +* Uses the `PHPMailer\PHPMailer` namespace +* File structure simplified, classes live in the `src/` folder +* Custom autoloader has been removed, now PSR-4 compatible +* Classes renamed to make use of the namespace +* `Extras` classes have been removed - use packages from packagist.org instead +* All elements previously marked as deprecated have been removed (e.g. `ReturnPath`) + +To avoid version confusion, this release is called **5.4**, **not 5.3**! + ## Version 5.2.14 (Nov 1st 2015) * Allow addresses with IDN (Internationalized Domain Name) in PHP 5.3+, thanks to @fbonzon * Allow access to POP3 errors diff --git a/composer.json b/composer.json index 9521a12f..6e655a69 100644 --- a/composer.json +++ b/composer.json @@ -20,26 +20,20 @@ } ], "require": { - "php": ">=5.0.0" + "php": ">=5.4.0" }, "require-dev": { - "phpdocumentor/phpdocumentor": "*", - "phpunit/phpunit": "4.7.*" + "phpdocumentor/phpdocumentor": "2.*", + "phpunit/phpunit": "4.*" }, "suggest": { "league/oauth2-client": "Needed for XOAUTH2 authentication", "league/oauth2-google": "Needed for Gmail XOAUTH2" }, "autoload": { - "classmap": [ - "class.phpmailer.php", - "class.phpmaileroauth.php", - "class.phpmaileroauthgoogle.php", - "class.smtp.php", - "class.pop3.php", - "extras/EasyPeasyICS.php", - "extras/ntlm_sasl_client.php" - ] + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } }, "license": "LGPL-2.1" } diff --git a/composer.lock b/composer.lock index 15a841d8..96c54475 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "0eb36ae77d61050323a94e312176ea66", + "hash": "a8d788b755f616f054fd139407f11632", + "content-hash": "7a29f5f89d8a23ec75270d6dfcb13d2b", "packages": [], "packages-dev": [ { @@ -330,16 +331,16 @@ }, { "name": "erusev/parsedown", - "version": "1.5.4", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/erusev/parsedown.git", - "reference": "0e89e3714bda18973184d30646306bb0a482bd96" + "reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/erusev/parsedown/zipball/0e89e3714bda18973184d30646306bb0a482bd96", - "reference": "0e89e3714bda18973184d30646306bb0a482bd96", + "url": "https://api.github.com/repos/erusev/parsedown/zipball/3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7", + "reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7", "shasum": "" }, "type": "library", @@ -365,7 +366,7 @@ "markdown", "parser" ], - "time": "2015-08-03 09:24:05" + "time": "2015-10-04 16:44:32" }, { "name": "herrera-io/json", @@ -626,9 +627,9 @@ ], "authors": [ { - "name": "Johannes Schmitt", + "name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", + "homepage": "http://jmsyst.com", "role": "Developer of wrapped JMSSerializerBundle" } ], @@ -645,16 +646,16 @@ }, { "name": "justinrainbow/json-schema", - "version": "1.4.4", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "8dc9b9d85ab639ca60ab4608b34c1279d6ae7bce" + "reference": "a4bee9f4b344b66e0a0d96c7afae1e92edf385fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8dc9b9d85ab639ca60ab4608b34c1279d6ae7bce", - "reference": "8dc9b9d85ab639ca60ab4608b34c1279d6ae7bce", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/a4bee9f4b344b66e0a0d96c7afae1e92edf385fe", + "reference": "a4bee9f4b344b66e0a0d96c7afae1e92edf385fe", "shasum": "" }, "require": { @@ -675,8 +676,8 @@ } }, "autoload": { - "psr-0": { - "JsonSchema": "src/" + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" } }, "notification-url": "https://packagist.org/downloads/", @@ -707,7 +708,7 @@ "json", "schema" ], - "time": "2015-07-14 16:29:50" + "time": "2015-09-08 22:28:04" }, { "name": "kherge/version", @@ -754,16 +755,16 @@ }, { "name": "monolog/monolog", - "version": "1.17.1", + "version": "1.17.2", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "0524c87587ab85bc4c2d6f5b41253ccb930a5422" + "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/0524c87587ab85bc4c2d6f5b41253ccb930a5422", - "reference": "0524c87587ab85bc4c2d6f5b41253ccb930a5422", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bee7f0dc9c3e0b69a6039697533dca1e845c8c24", + "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24", "shasum": "" }, "require": { @@ -777,10 +778,11 @@ "aws/aws-sdk-php": "^2.4.9", "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", "php-console/php-console": "^3.1.3", "phpunit/phpunit": "~4.5", "phpunit/phpunit-mock-objects": "2.3.0", - "raven/raven": "~0.11", + "raven/raven": "^0.13", "ruflin/elastica": ">=0.90 <3.0", "swiftmailer/swiftmailer": "~5.3", "videlalvaro/php-amqplib": "~2.4" @@ -826,7 +828,7 @@ "logging", "psr-3" ], - "time": "2015-08-31 09:17:37" + "time": "2015-10-14 12:51:02" }, { "name": "nikic/php-parser", @@ -907,9 +909,9 @@ ], "authors": [ { - "name": "Johannes Schmitt", + "name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", + "homepage": "http://jmsyst.com", "role": "Developer of wrapped JMSSerializerBundle" } ], @@ -1311,16 +1313,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "2.2.2", + "version": "2.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c" + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2d7c03c0e4e080901b8f33b2897b0577be18a13c", - "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", "shasum": "" }, "require": { @@ -1369,7 +1371,7 @@ "testing", "xunit" ], - "time": "2015-08-04 03:42:39" + "time": "2015-10-06 15:47:00" }, { "name": "phpunit/php-file-iterator", @@ -1502,16 +1504,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.6", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3ab72c62e550370a6cd5dc873e1a04ab57562f5b" + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3ab72c62e550370a6cd5dc873e1a04ab57562f5b", - "reference": "3ab72c62e550370a6cd5dc873e1a04ab57562f5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "shasum": "" }, "require": { @@ -1547,20 +1549,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-08-16 08:51:00" + "time": "2015-09-15 10:49:45" }, { "name": "phpunit/phpunit", - "version": "4.7.7", + "version": "4.8.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9b97f9d807b862c2de2a36e86690000801c85724" + "reference": "625f8c345606ed0f3a141dfb88f4116f0e22978e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b97f9d807b862c2de2a36e86690000801c85724", - "reference": "9b97f9d807b862c2de2a36e86690000801c85724", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/625f8c345606ed0f3a141dfb88f4116f0e22978e", + "reference": "625f8c345606ed0f3a141dfb88f4116f0e22978e", "shasum": "" }, "require": { @@ -1570,7 +1572,7 @@ "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpspec/prophecy": "~1.3,>=1.3.1", + "phpspec/prophecy": "^1.3.1", "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", @@ -1578,7 +1580,7 @@ "phpunit/phpunit-mock-objects": "~2.3", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", - "sebastian/environment": "~1.2", + "sebastian/environment": "~1.3", "sebastian/exporter": "~1.2", "sebastian/global-state": "~1.0", "sebastian/version": "~1.0", @@ -1593,7 +1595,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.7.x-dev" + "dev-master": "4.8.x-dev" } }, "autoload": { @@ -1619,20 +1621,20 @@ "testing", "xunit" ], - "time": "2015-07-13 11:28:34" + "time": "2015-10-23 06:48:33" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.7", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "5e2645ad49d196e020b85598d7c97e482725786a" + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5e2645ad49d196e020b85598d7c97e482725786a", - "reference": "5e2645ad49d196e020b85598d7c97e482725786a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", "shasum": "" }, "require": { @@ -1675,7 +1677,7 @@ "mock", "xunit" ], - "time": "2015-08-19 09:14:08" + "time": "2015-10-02 06:51:40" }, { "name": "pimple/pimple", @@ -1712,7 +1714,9 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" } ], "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", @@ -1995,16 +1999,16 @@ }, { "name": "sebastian/global-state", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { @@ -2042,7 +2046,7 @@ "keywords": [ "global state" ], - "time": "2014-10-06 09:23:50" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/recursion-context", @@ -2180,25 +2184,22 @@ }, { "name": "symfony/config", - "version": "v2.7.3", + "version": "v2.7.6", "source": { "type": "git", - "url": "https://github.com/symfony/Config.git", - "reference": "6c905bbed1e728226de656e4c07d620dfe9e80d9" + "url": "https://github.com/symfony/config.git", + "reference": "831f88908b51b9ce945f5e6f402931d1ac544423" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/6c905bbed1e728226de656e4c07d620dfe9e80d9", - "reference": "6c905bbed1e728226de656e4c07d620dfe9e80d9", + "url": "https://api.github.com/repos/symfony/config/zipball/831f88908b51b9ce945f5e6f402931d1ac544423", + "reference": "831f88908b51b9ce945f5e6f402931d1ac544423", "shasum": "" }, "require": { "php": ">=5.3.9", "symfony/filesystem": "~2.3" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -2226,20 +2227,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" + "time": "2015-10-11 09:39:48" }, { "name": "symfony/console", - "version": "v2.7.3", + "version": "v2.7.6", "source": { "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "d6cf02fe73634c96677e428f840704bfbcaec29e" + "url": "https://github.com/symfony/console.git", + "reference": "5efd632294c8320ea52492db22292ff853a43766" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/d6cf02fe73634c96677e428f840704bfbcaec29e", - "reference": "d6cf02fe73634c96677e428f840704bfbcaec29e", + "url": "https://api.github.com/repos/symfony/console/zipball/5efd632294c8320ea52492db22292ff853a43766", + "reference": "5efd632294c8320ea52492db22292ff853a43766", "shasum": "" }, "require": { @@ -2248,7 +2249,6 @@ "require-dev": { "psr/log": "~1.0", "symfony/event-dispatcher": "~2.1", - "symfony/phpunit-bridge": "~2.7", "symfony/process": "~2.1" }, "suggest": { @@ -2283,20 +2283,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2015-07-28 15:18:12" + "time": "2015-10-20 14:38:46" }, { "name": "symfony/event-dispatcher", - "version": "v2.7.3", + "version": "v2.7.6", "source": { "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "87a5db5ea887763fa3a31a5471b512ff1596d9b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", - "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/87a5db5ea887763fa3a31a5471b512ff1596d9b8", + "reference": "87a5db5ea887763fa3a31a5471b512ff1596d9b8", "shasum": "" }, "require": { @@ -2307,7 +2307,6 @@ "symfony/config": "~2.0,>=2.0.5", "symfony/dependency-injection": "~2.6", "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", "symfony/stopwatch": "~2.3" }, "suggest": { @@ -2341,28 +2340,25 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2015-06-18 19:21:56" + "time": "2015-10-11 09:39:48" }, { "name": "symfony/filesystem", - "version": "v2.7.3", + "version": "v2.7.6", "source": { "type": "git", - "url": "https://github.com/symfony/Filesystem.git", - "reference": "2d7b2ddaf3f548f4292df49a99d19c853d43f0b8" + "url": "https://github.com/symfony/filesystem.git", + "reference": "56fd6df73be859323ff97418d97edc1d756df6df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/2d7b2ddaf3f548f4292df49a99d19c853d43f0b8", - "reference": "2d7b2ddaf3f548f4292df49a99d19c853d43f0b8", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/56fd6df73be859323ff97418d97edc1d756df6df", + "reference": "56fd6df73be859323ff97418d97edc1d756df6df", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -2390,28 +2386,25 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" + "time": "2015-10-18 20:23:18" }, { "name": "symfony/finder", - "version": "v2.7.3", + "version": "v2.7.6", "source": { "type": "git", - "url": "https://github.com/symfony/Finder.git", - "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4" + "url": "https://github.com/symfony/finder.git", + "reference": "2ffb4e9598db3c48eb6d0ae73b04bbf09280c59d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/ae0f363277485094edc04c9f3cbe595b183b78e4", - "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4", + "url": "https://api.github.com/repos/symfony/finder/zipball/2ffb4e9598db3c48eb6d0ae73b04bbf09280c59d", + "reference": "2ffb4e9598db3c48eb6d0ae73b04bbf09280c59d", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -2439,28 +2432,25 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" + "time": "2015-10-11 09:39:48" }, { "name": "symfony/process", - "version": "v2.7.3", + "version": "v2.7.6", "source": { "type": "git", - "url": "https://github.com/symfony/Process.git", - "reference": "48aeb0e48600321c272955132d7606ab0a49adb3" + "url": "https://github.com/symfony/process.git", + "reference": "4a959dd4e19c2c5d7512689413921e0a74386ec7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/48aeb0e48600321c272955132d7606ab0a49adb3", - "reference": "48aeb0e48600321c272955132d7606ab0a49adb3", + "url": "https://api.github.com/repos/symfony/process/zipball/4a959dd4e19c2c5d7512689413921e0a74386ec7", + "reference": "4a959dd4e19c2c5d7512689413921e0a74386ec7", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -2488,28 +2478,25 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2015-07-01 11:25:50" + "time": "2015-10-23 14:47:27" }, { "name": "symfony/stopwatch", - "version": "v2.7.3", + "version": "v2.7.6", "source": { "type": "git", - "url": "https://github.com/symfony/Stopwatch.git", - "reference": "b07a866719bbac5294c67773340f97b871733310" + "url": "https://github.com/symfony/stopwatch.git", + "reference": "f8ab957c17e4b85a73c4df03bdf94ee597f2bd55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/b07a866719bbac5294c67773340f97b871733310", - "reference": "b07a866719bbac5294c67773340f97b871733310", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f8ab957c17e4b85a73c4df03bdf94ee597f2bd55", + "reference": "f8ab957c17e4b85a73c4df03bdf94ee597f2bd55", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -2537,20 +2524,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2015-07-01 18:23:16" + "time": "2015-10-12 12:42:24" }, { "name": "symfony/translation", - "version": "v2.7.3", + "version": "v2.7.6", "source": { "type": "git", - "url": "https://github.com/symfony/Translation.git", - "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6" + "url": "https://github.com/symfony/translation.git", + "reference": "6ccd9289ec1c71d01a49d83480de3b5293ce30c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/c8dc34cc936152c609cdd722af317e4239d10dd6", - "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6", + "url": "https://api.github.com/repos/symfony/translation/zipball/6ccd9289ec1c71d01a49d83480de3b5293ce30c8", + "reference": "6ccd9289ec1c71d01a49d83480de3b5293ce30c8", "shasum": "" }, "require": { @@ -2562,8 +2549,7 @@ "require-dev": { "psr/log": "~1.0", "symfony/config": "~2.7", - "symfony/intl": "~2.3", - "symfony/phpunit-bridge": "~2.7", + "symfony/intl": "~2.4", "symfony/yaml": "~2.2" }, "suggest": { @@ -2598,20 +2584,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2015-07-09 16:07:40" + "time": "2015-10-27 15:38:06" }, { "name": "symfony/validator", - "version": "v2.7.3", + "version": "v2.7.6", "source": { "type": "git", - "url": "https://github.com/symfony/Validator.git", - "reference": "646df03e635a8a232804274401449ccdf5f03cad" + "url": "https://github.com/symfony/validator.git", + "reference": "df9021e689aa3d08367881e7f8917219fabe5e64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Validator/zipball/646df03e635a8a232804274401449ccdf5f03cad", - "reference": "646df03e635a8a232804274401449ccdf5f03cad", + "url": "https://api.github.com/repos/symfony/validator/zipball/df9021e689aa3d08367881e7f8917219fabe5e64", + "reference": "df9021e689aa3d08367881e7f8917219fabe5e64", "shasum": "" }, "require": { @@ -2621,12 +2607,12 @@ "require-dev": { "doctrine/annotations": "~1.0", "doctrine/cache": "~1.0", + "doctrine/common": "~2.3", "egulias/email-validator": "~1.2,>=1.2.1", "symfony/config": "~2.2", "symfony/expression-language": "~2.4", "symfony/http-foundation": "~2.1", - "symfony/intl": "~2.3", - "symfony/phpunit-bridge": "~2.7", + "symfony/intl": "~2.4", "symfony/property-access": "~2.3", "symfony/yaml": "~2.0,>=2.0.5" }, @@ -2668,28 +2654,25 @@ ], "description": "Symfony Validator Component", "homepage": "https://symfony.com", - "time": "2015-07-31 06:49:15" + "time": "2015-10-18 20:23:18" }, { "name": "symfony/yaml", - "version": "v2.7.3", + "version": "v2.7.6", "source": { "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "71340e996171474a53f3d29111d046be4ad8a0ff" + "url": "https://github.com/symfony/yaml.git", + "reference": "eca9019c88fbe250164affd107bc8057771f3f4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/71340e996171474a53f3d29111d046be4ad8a0ff", - "reference": "71340e996171474a53f3d29111d046be4ad8a0ff", + "url": "https://api.github.com/repos/symfony/yaml/zipball/eca9019c88fbe250164affd107bc8057771f3f4d", + "reference": "eca9019c88fbe250164affd107bc8057771f3f4d", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -2717,20 +2700,20 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-07-28 14:07:07" + "time": "2015-10-11 09:39:48" }, { "name": "twig/twig", - "version": "v1.21.1", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "ca8d3aa90b6a01c82e07909fe815d6b443e75a23" + "reference": "d9b6333ae8dd2c8e3fd256e127548def0bc614c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/ca8d3aa90b6a01c82e07909fe815d6b443e75a23", - "reference": "ca8d3aa90b6a01c82e07909fe815d6b443e75a23", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/d9b6333ae8dd2c8e3fd256e127548def0bc614c6", + "reference": "d9b6333ae8dd2c8e3fd256e127548def0bc614c6", "shasum": "" }, "require": { @@ -2743,7 +2726,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.21-dev" + "dev-master": "1.23-dev" } }, "autoload": { @@ -2778,32 +2761,32 @@ "keywords": [ "templating" ], - "time": "2015-08-26 08:58:31" + "time": "2015-11-05 12:49:06" }, { "name": "zendframework/zend-cache", - "version": "2.5.2", + "version": "2.5.3", "source": { "type": "git", "url": "https://github.com/zendframework/zend-cache.git", - "reference": "325afc68d4381cf8b95288ebb9b1d38dc32ed579" + "reference": "7ff9d6b922ae29dbdc53f6a62b471fb6e58565df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-cache/zipball/325afc68d4381cf8b95288ebb9b1d38dc32ed579", - "reference": "325afc68d4381cf8b95288ebb9b1d38dc32ed579", + "url": "https://api.github.com/repos/zendframework/zend-cache/zipball/7ff9d6b922ae29dbdc53f6a62b471fb6e58565df", + "reference": "7ff9d6b922ae29dbdc53f6a62b471fb6e58565df", "shasum": "" }, "require": { "php": ">=5.5", "zendframework/zend-eventmanager": "~2.5", - "zendframework/zend-serializer": "~2.5", "zendframework/zend-servicemanager": "~2.5", "zendframework/zend-stdlib": "~2.5" }, "require-dev": { "fabpot/php-cs-fixer": "1.7.*", "phpunit/phpunit": "~4.0", + "zendframework/zend-serializer": "~2.5", "zendframework/zend-session": "~2.5" }, "suggest": { @@ -2841,7 +2824,7 @@ "cache", "zf2" ], - "time": "2015-07-16 18:44:41" + "time": "2015-09-15 16:09:09" }, { "name": "zendframework/zend-config", @@ -3003,6 +2986,62 @@ ], "time": "2015-06-03 15:32:01" }, + { + "name": "zendframework/zend-hydrator", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-hydrator.git", + "reference": "f3ed8b833355140350bbed98d8a7b8b66875903f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/f3ed8b833355140350bbed98d8a7b8b66875903f", + "reference": "f3ed8b833355140350bbed98d8a7b8b66875903f", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "zendframework/zend-stdlib": "^2.5.1" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.0@dev", + "zendframework/zend-eventmanager": "^2.5.1", + "zendframework/zend-filter": "^2.5.1", + "zendframework/zend-inputfilter": "^2.5.1", + "zendframework/zend-serializer": "^2.5.1", + "zendframework/zend-servicemanager": "^2.5.1" + }, + "suggest": { + "zendframework/zend-eventmanager": "^2.5.1, to support aggregate hydrator usage", + "zendframework/zend-filter": "^2.5.1, to support naming strategy hydrator usage", + "zendframework/zend-serializer": "^2.5.1, to use the SerializableStrategy", + "zendframework/zend-servicemanager": "^2.5.1, to support hydrator plugin manager usage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev", + "dev-develop": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Hydrator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-hydrator", + "keywords": [ + "hydrator", + "zf2" + ], + "time": "2015-09-17 14:06:43" + }, { "name": "zendframework/zend-i18n", "version": "2.5.1", @@ -3277,22 +3316,24 @@ }, { "name": "zendframework/zend-stdlib", - "version": "2.6.0", + "version": "2.7.4", "source": { "type": "git", "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "a35758803fc9051ec1aff43989e679b6b451b1b4" + "reference": "cae029346a33663b998507f94962eb27de060683" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/a35758803fc9051ec1aff43989e679b6b451b1b4", - "reference": "a35758803fc9051ec1aff43989e679b6b451b1b4", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/cae029346a33663b998507f94962eb27de060683", + "reference": "cae029346a33663b998507f94962eb27de060683", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=5.5", + "zendframework/zend-hydrator": "~1.0" }, "require-dev": { + "athletic/athletic": "~0.1", "fabpot/php-cs-fixer": "1.7.*", "phpunit/phpunit": "~4.0", "zendframework/zend-config": "~2.5", @@ -3311,8 +3352,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev", - "dev-develop": "2.7-dev" + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" } }, "autoload": { @@ -3329,7 +3370,7 @@ "stdlib", "zf2" ], - "time": "2015-07-21 17:08:05" + "time": "2015-10-15 15:57:32" }, { "name": "zetacomponents/base", @@ -3452,7 +3493,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.0.0" + "php": ">=5.4.0" }, "platform-dev": [] } diff --git a/examples/code_generator.phps b/examples/code_generator.phps index 23458561..2aa773f9 100644 --- a/examples/code_generator.phps +++ b/examples/code_generator.phps @@ -4,7 +4,7 @@ * revised, updated and corrected 27/02/2013 * by matt.sturdy@gmail.com */ -require '../PHPMailerAutoload.php'; +require '../vendor/autoload.php'; $CFG['smtp_debug'] = 2; //0 == off, 1 for client output, 2 for client and server $CFG['smtp_debugoutput'] = 'html'; @@ -356,9 +356,9 @@ $example_code .= "\n}"; "; - echo exit("ERROR: Wrong PHP version. Must be PHP 5 or above."); + echo exit("ERROR: Wrong PHP version. Must be PHP 5.4 or later."); } if (count($results_messages) > 0) { diff --git a/examples/exceptions.phps b/examples/exceptions.phps index 0e941e73..5cd5e38d 100644 --- a/examples/exceptions.phps +++ b/examples/exceptions.phps @@ -2,8 +2,9 @@ /** * This example shows how to make use of PHPMailer's exceptions for error handling. */ +namespace PHPMailer\PHPMailer; -require '../PHPMailerAutoload.php'; +require '../vendor/autoload.php'; //Create a new PHPMailer instance //Passing true to the constructor enables the use of exceptions for error handling diff --git a/examples/gmail.phps b/examples/gmail.phps index b3cc02d5..a9f51696 100644 --- a/examples/gmail.phps +++ b/examples/gmail.phps @@ -2,12 +2,13 @@ /** * This example shows settings to use when sending via Google's Gmail servers. */ +namespace PHPMailer\PHPMailer; //SMTP needs accurate times, and the PHP time zone MUST be set //This should be done in your php.ini, but this is how to do it if you don't have access to that date_default_timezone_set('Etc/UTC'); -require '../PHPMailerAutoload.php'; +require '../vendor/autoload.php'; //Create a new PHPMailer instance $mail = new PHPMailer; diff --git a/examples/gmail_xoauth.phps b/examples/gmail_xoauth.phps index d64483a4..6f20aaa6 100644 --- a/examples/gmail_xoauth.phps +++ b/examples/gmail_xoauth.phps @@ -2,12 +2,13 @@ /** * This example shows settings to use when sending via Google's Gmail servers. */ +namespace PHPMailer\PHPMailer; //SMTP needs accurate times, and the PHP time zone MUST be set //This should be done in your php.ini, but this is how to do it if you don't have access to that date_default_timezone_set('Etc/UTC'); -require '../PHPMailerAutoload.php'; +require '../vendor/autoload.php'; //Load dependencies from composer //If this causes an error, run 'composer install' diff --git a/examples/mail.phps b/examples/mail.phps index 8e129f47..bda3ecbf 100644 --- a/examples/mail.phps +++ b/examples/mail.phps @@ -2,8 +2,9 @@ /** * This example shows sending a message using PHP's mail() function. */ +namespace PHPMailer\PHPMailer; -require '../PHPMailerAutoload.php'; +require '../vendor/autoload.php'; //Create a new PHPMailer instance $mail = new PHPMailer; diff --git a/examples/mailing_list.phps b/examples/mailing_list.phps index 8644bb59..9e13c15d 100644 --- a/examples/mailing_list.phps +++ b/examples/mailing_list.phps @@ -1,10 +1,11 @@ setFrom('from@example.com', 'First Last'); $mail->addAddress('whoto@example.com', 'John Doe'); diff --git a/examples/sendmail.phps b/examples/sendmail.phps index a830e495..2f872923 100644 --- a/examples/sendmail.phps +++ b/examples/sendmail.phps @@ -2,8 +2,9 @@ /** * This example shows sending a message using a local sendmail binary. */ +namespace PHPMailer\PHPMailer; -require '../PHPMailerAutoload.php'; +require '../vendor/autoload.php'; //Create a new PHPMailer instance $mail = new PHPMailer; diff --git a/examples/signed-mail.phps b/examples/signed-mail.phps index 9d70d013..d1721831 100644 --- a/examples/signed-mail.phps +++ b/examples/signed-mail.phps @@ -1,4 +1,5 @@ - * @author Manuel Reinhard - * - * Built with inspiration from - * http://stackoverflow.com/questions/1463480/how-can-i-use-php-to-dynamically-publish-an-ical-file-to-be-read-by-google-calend/1464355#1464355 - * History: - * 2010/12/17 - Manuel Reinhard - when it all started - * 2014 PHPMailer project becomes maintainer - */ - -/** - * Class EasyPeasyICS. - * Simple ICS data generator - * @package phpmailer - * @subpackage easypeasyics - */ -class EasyPeasyICS -{ - /** - * The name of the calendar - * @var string - */ - protected $calendarName; - /** - * The array of events to add to this calendar - * @var array - */ - protected $events = array(); - - /** - * Constructor - * @param string $calendarName - */ - public function __construct($calendarName = "") - { - $this->calendarName = $calendarName; - } - - /** - * Add an event to this calendar. - * @param string $start The start date and time as a unix timestamp - * @param string $end The end date and time as a unix timestamp - * @param string $summary A summary or title for the event - * @param string $description A description of the event - * @param string $url A URL for the event - * @param string $uid A unique identifier for the event - generated automatically if not provided - * @return array An array of event details, including any generated UID - */ - public function addEvent($start, $end, $summary = '', $description = '', $url = '', $uid = '') - { - if (empty($uid)) { - $uid = md5(uniqid(mt_rand(), true)) . '@EasyPeasyICS'; - } - $event = array( - 'start' => gmdate('Ymd', $start) . 'T' . gmdate('His', $start) . 'Z', - 'end' => gmdate('Ymd', $end) . 'T' . gmdate('His', $end) . 'Z', - 'summary' => $summary, - 'description' => $description, - 'url' => $url, - 'uid' => $uid - ); - $this->events[] = $event; - return $event; - } - - /** - * @return array Get the array of events. - */ - public function getEvents() - { - return $this->events; - } - - /** - * Clear all events. - */ - public function clearEvents() - { - $this->events = array(); - } - - /** - * Get the name of the calendar. - * @return string - */ - public function getName() - { - return $this->calendarName; - } - - /** - * Set the name of the calendar. - * @param $name - */ - public function setName($name) - { - $this->calendarName = $name; - } - - /** - * Render and optionally output a vcal string. - * @param bool $output Whether to output the calendar data directly (the default). - * @return string The complete rendered vlal - */ - public function render($output = true) - { - //Add header - $ics = 'BEGIN:VCALENDAR -METHOD:PUBLISH -VERSION:2.0 -X-WR-CALNAME:' . $this->calendarName . ' -PRODID:-//hacksw/handcal//NONSGML v1.0//EN'; - - //Add events - foreach ($this->events as $event) { - $ics .= ' -BEGIN:VEVENT -UID:' . $event['uid'] . ' -DTSTAMP:' . gmdate('Ymd') . 'T' . gmdate('His') . 'Z -DTSTART:' . $event['start'] . ' -DTEND:' . $event['end'] . ' -SUMMARY:' . str_replace("\n", "\\n", $event['summary']) . ' -DESCRIPTION:' . str_replace("\n", "\\n", $event['description']) . ' -URL;VALUE=URI:' . $event['url'] . ' -END:VEVENT'; - } - - //Add footer - $ics .= ' -END:VCALENDAR'; - - if ($output) { - //Output - $filename = $this->calendarName; - //Filename needs quoting if it contains spaces - if (strpos($filename, ' ') !== false) { - $filename = '"'.$filename.'"'; - } - header('Content-type: text/calendar; charset=utf-8'); - header('Content-Disposition: inline; filename=' . $filename . '.ics'); - echo $ics; - } - return $ics; - } -} diff --git a/extras/README.md b/extras/README.md deleted file mode 100644 index dac79e05..00000000 --- a/extras/README.md +++ /dev/null @@ -1,17 +0,0 @@ -#PHPMailer Extras - -These classes provide optional additional functions to PHPMailer. - -These are not loaded by the PHPMailer autoloader, so in some cases you may need to `require` them yourself before using them. - -##EasyPeasyICS - -This class was originally written by Manuel Reinhard and provides a simple means of generating ICS/vCal files that are used in sending calendar events. PHPMailer does not use it directly, but you can use it to generate content appropriate for placing in the `Ical` property of PHPMailer. The PHPMailer project is now its official home as Manuel has given permission for that and is no longer maintaining it himself. - -##htmlfilter - -This class by Konstantin Riabitsev and Jim Jagielski implements HTML filtering to remove potentially malicious tags, such as `