diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..449175a --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +## +## .gitignore -- Specifies intentionally untracked files to ignore +## =============================================================== +## +## See: http://www.kernel.org/pub/software/scm/git/docs/gitignore.html +## + +## ---------------------------------------------------------------------------- +## project specific files +## ---------------------------------------------------------------------------- + +build/ +composer.lock +composer.phar +phpunit.xml +vendor/ + +!.travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..e5bdd6d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,32 @@ +language: php + +php: + - "5.6" + - "5.5" + - "5.4" + - "5.3" + - "hhvm" + - "hhvm-nightly" + +branches: + except: + - /^draft-.*/ + +matrix: + allow_failures: + - php: hhvm + - php: hhvm-nightly + +branches: + except: + - /^draft-.*/ + +before_script: + - composer self-update + - composer require satooshi/php-coveralls:dev-master --no-update + - composer install --dev + +script: ./vendor/bin/phpunit --coverage-text + +after_script: + - php vendor/bin/coveralls -v diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3e14a62 --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +Copyright © 2014 Oscar Cubo Medina + +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, m odify, 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. + +Except as contained in this notice, the name(s) of the above copyright +holders shall not be used in advertising or otherwise to promote the sale, +use or other dealings in this Software without prior written authorization. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1de0ce --- /dev/null +++ b/README.md @@ -0,0 +1,79 @@ +Email Address +============= + +_Email Address_ is a PHP implementation of an Email Address [value object][]. + +The address is checked against +[RFC 3696](http://tools.ietf.org/html/rfc3696 "RFC 3696: Application Techniques for Checking and Transformation of Names"), +[RFC 1123](http://tools.ietf.org/html/rfc1123 "RFC 1123: Requirements for Internet Hosts — Application and Support"), +[RFC 4291](http://tools.ietf.org/html/rfc4291 "RFC 4291: IP Version 6 Addressing Architecture"), +[RFC 5321](http://tools.ietf.org/html/rfc5321 "RFC 5321: Simple Mail Transfer Protocol") and +[RFC 5322](http://tools.ietf.org/html/rfc5322 "RFC 5322: Internet Message Format") +thanks to [is_email()][] code by [Dominic Sayers][]. + +Installation +------------ + +Just use [composer][] to add the dependency: + +``` +composer require ocubom/email-address:dev-master +``` + +Or add the dependecy manually: + +1. Update ``composer.json`` file with the lines: + + ``` + { + "require": { + "ocubom/email-address": "dev-master" + } + } + ``` + +2. And update the dependencies: + + ``` + composer update "ocubom/email-address" + ``` + +Authorship +---------- + +Current maintainer: + +* [Oscar Cubo Medina](http://github.com/ocubom/ "@ocubom projects"). + Twitter: [@ocubom](http://twitter.com/ocubom/ "@ocubom on twitter"). + +Copyright and License +--------------------- + +_Email Address_ is licensed under the MIT License — see the [`LICENSE`][0] file +for details. + +If you did not receive a copy of the license, contact with the author. + +### is_email() License + +Includes "[is_email()][]” code by [Dominic Sayers][]: + +> Copyright © 2008—2011 Dominic Sayers +> (http://isemail.info) +> BSD License (http://www.opensource.org/licenses/bsd-license.php) + +[0]: https://github.com/ocubom/email-address/blob/master/LICENSE + "PHP Email Type" + + +[Dominic Sayers]: http://github.com/dominicsayers + "@dominicsayers on github" + +[is_email()]: http://github.com/dominicsayers/isemail + "dominicsayers/isemail" + +[Composer]: http://getcomposer.org/ + "Composer Dependency Manager for PHP" + +[value object]: http://wikipedia.org/wiki/value_object + "Value object" diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..58f830a --- /dev/null +++ b/composer.json @@ -0,0 +1,39 @@ +{ + "name" : "ocubom/email-address", + "description" : "Email address value object checked against RFC 3696, RFC 1123, RFC 4291, RFC 5321 and RFC 5322.", + "keywords" : [ "address", "email", "validator", "RFC 1123", "RFC 3696", "RFC 4291", "RFC 5321", "RFC 5322" ], + "homepage" : "http://github.com/ocubom/email-address", + "license" : "MIT", + "authors" : [{ + "name" : "Oscar Cubo Medina", + "homepage" : "http://ocubom.github.io" + }], + "support" : { + "issues" : "http://github.com/ocubom/email-address/issues", + "source" : "http://github.com/ocubom/email-address" + }, + + "require": { + "php": ">=5.3.3" + }, + + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + + "autoload": { + "psr-4": { "Ocubom\\Email\\": "src/" } + }, + + "autoload-dev": { + "psr-4": { "Ocubom\\Email\\Tests\\": "tests/" } + }, + + "extra": { + "branch-alias": { "dev-master": "1.0.x-dev" } + }, + + "archive": { + "exclude": [ "tests", "*phpunit.xml*", "composer.phar" ] + } +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..2357a66 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,64 @@ + + + + + + + ./tests/ + + + + + + + ./ + + ./Resources/ + ./tests/ + ./vendor/ + + + + + + + + + + + +